{"note":"OpenAPI conversion -- returning structured metadata","name":"sendgrid-templates","description":"Twilio SendGrid Templates API","version":"1.0.0","base_url":"https://api.sendgrid.com","endpoints":11,"raw":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Twilio SendGrid Templates API\n@base https://api.sendgrid.com\n@version 1.0.0\n@auth Bearer bearer\n@common_fields {on-behalf-of: str # The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.}\n@endpoints 11\n@toc templates(11)\n\n@endpoint POST /v3/templates\n@desc Create a transactional template.\n@required {name: str # The name for the new transactional template.}\n@optional {generation: str(legacy/dynamic)}\n@returns(201) {id: str(uuid), name: str, generation: str, updated_at: str, versions: [map], warning: map{message: str}}\n\n@endpoint GET /v3/templates\n@desc Retrieve paged transactional templates.\n@required {page_size: num # The number of templates to be returned in each page of results}\n@optional {generations: str=legacy # Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`., page_token: str # A token corresponding to a specific page of results, as provided by metadata}\n@returns(200) {result: [map], _metadata: map{prev: str(uri), self: str(uri), next: str(uri), count: int}}\n@errors {400}\n\n@endpoint POST /v3/templates/{template_id}\n@desc Duplicate a transactional template.\n@optional {name: str # The name for the new transactional template.}\n@returns(201) {id: str(uuid), name: str, generation: str, updated_at: str, versions: [map], warning: map{message: str}}\n\n@endpoint GET /v3/templates/{template_id}\n@desc Retrieve a single transactional template.\n@returns(200) {id: str(uuid), name: str, generation: str, updated_at: str, versions: [map], warning: map{message: str}}\n\n@endpoint PATCH /v3/templates/{template_id}\n@desc Edit a transactional template.\n@optional {name: str # The name of the transactional template.}\n@returns(200) {id: str(uuid), name: str, generation: str, updated_at: str, versions: [map], warning: map{message: str}}\n\n@endpoint DELETE /v3/templates/{template_id}\n@desc Delete a template.\n@returns(204)\n\n@endpoint POST /v3/templates/{template_id}/versions\n@desc Create a new transactional template version.\n@required {name: str # Name of the transactional template version., subject: str # Subject of the new transactional template version.}\n@optional {active: int(0/1), html_content: str # The HTML content of the version. Maximum of 1048576 bytes allowed., plain_content: str=<generated from html_content if left empty> # Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed., generate_plain_content: bool=true # If true, plain_content is always generated from html_content. If false, plain_content is not altered., editor: str(code/design), test_data: str # For dynamic templates only, the mock json data that will be used for template preview and test sends.}\n@returns(201) {warnings: [map], active: int, name: str, html_content: str, plain_content: str, generate_plain_content: bool, subject: str, editor: str, test_data: str, id: str(uuid), template_id: str, updated_at: str, thumbnail_url: str}\n\n@endpoint GET /v3/templates/{template_id}/versions/{version_id}\n@desc Retrieve a specific transactional template version.\n@returns(200) {warnings: [map], active: int, name: str, html_content: str, plain_content: str, generate_plain_content: bool, subject: str, editor: str, test_data: str, id: str(uuid), template_id: str, updated_at: str, thumbnail_url: str}\n\n@endpoint PATCH /v3/templates/{template_id}/versions/{version_id}\n@desc Edit a transactional template version.\n@required {name: str # Name of the transactional template version., subject: str # Subject of the new transactional template version.}\n@optional {active: int(0/1), html_content: str # The HTML content of the version. Maximum of 1048576 bytes allowed., plain_content: str=<generated from html_content if left empty> # Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed., generate_plain_content: bool=true # If true, plain_content is always generated from html_content. If false, plain_content is not altered., editor: str(code/design), test_data: str # For dynamic templates only, the mock json data that will be used for template preview and test sends.}\n@returns(200) {warnings: [map], active: int, name: str, html_content: str, plain_content: str, generate_plain_content: bool, subject: str, editor: str, test_data: str, id: str(uuid), template_id: str, updated_at: str, thumbnail_url: str}\n\n@endpoint DELETE /v3/templates/{template_id}/versions/{version_id}\n@desc Delete a transactional template version.\n@returns(204)\n\n@endpoint POST /v3/templates/{template_id}/versions/{version_id}/activate\n@desc Activate a transactional template version.\n@returns(200) {warnings: [map], active: int, name: str, html_content: str, plain_content: str, generate_plain_content: bool, subject: str, editor: str, test_data: str, id: str(uuid), template_id: str, updated_at: str, thumbnail_url: str}\n\n@end\n"}