SendGrid Templates Versions API

Twilio SendGrid Templates API: Versions operations

Documentation

📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/account-provisioning
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/alerts
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/api-keys
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/email-activity
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/email-address-validation
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/enforced-tls
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/sendgrid-integrations
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/ip-access-management
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/ip-address-management-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/ip-warmup
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/ip-address
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/link-branding
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/campaigns-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/contacts-api-custom-fields
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/sender-identities-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/mail-settings
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/mail-send
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/contacts
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/custom-fields
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/designs-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/lists
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/segmenting-contacts-v2
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/segmenting-contacts
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/senders
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/single-sends
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/marketing-campaign-stats
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/send-test-email
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/partner-settings
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/recipients-data-erasure
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/reverse-dns
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/cancel-scheduled-sends
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/api-key-permissions
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/sendgrid-engagement-quality-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/single-sign-on-settings
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/stats
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/subusers-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/suppressions-unsubscribe-groups
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/teammates
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/transactional-templates
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/settings-tracking
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/users-api
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/sender-verification
📖
Documentation
https://www.twilio.com/docs/sendgrid/api-reference/webhooks

Specifications

OpenAPI Specification

sendgrid-templates-versions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Twilio SendGrid Provisioning Account Templates Versions API
  summary: The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts.
  description: 'The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid.


    You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/).'
  termsOfService: https://www.twilio.com/legal/tos
  contact:
    name: Twilio SendGrid Support
    url: https://support.sendgrid.com/hc/en-us
  license:
    name: MIT
    url: https://code.hq.twilio.com/twilio/sendgrid-oas/blob/main/LICENSE
  version: 1.0.0
  x-sendgrid:
    libraryPackage: account_provisioning
servers:
- url: https://api.sendgrid.com
  description: for global users and subusers
- url: https://api.eu.sendgrid.com
  description: for EU regional subusers
security:
- BearerAuth: []
tags:
- name: Templates Versions
  description: 'Twilio SendGrid Templates API: Versions operations'
paths:
  /v3/templates/{template_id}/versions:
    parameters:
    - name: template_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    post:
      operationId: CreateTemplateVersion
      summary: Create a new transactional template version.
      tags:
      - Templates Versions
      description: '**This endpoint allows you to create a new version of a template.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      requestBody:
        $ref: '#/components/requestBodies/PostPatchTransactionalTemplateVersion'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplateVersionOutput'
              examples:
                response:
                  value:
                    id: 8aefe0ee-f12b-4575-b5b7-c97e21cb36f3
                    template_id: ddb96bbc-9b92-425e-8979-99464621b543
                    active: 1
                    name: example_version_name
                    html_content: <%body%>
                    plain_content: <%body%>
                    generate_plain_content: true
                    subject: <%subject%>
                    updated_at: '2019-03-13 18:56:33'
                    editor: code
  /v3/templates/{template_id}/versions/{version_id}:
    parameters:
    - name: template_id
      in: path
      description: ' The ID of the original template'
      required: true
      schema:
        type: string
        format: uuid
    - name: version_id
      in: path
      description: The ID of the template version
      required: true
      schema:
        type: string
        format: uuid
    get:
      operationId: GetTemplateVersion
      summary: Retrieve a specific transactional template version.
      tags:
      - Templates Versions
      description: '**This endpoint allows you to retrieve a specific version of a template.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplateVersionOutput'
              examples:
                response:
                  value:
                    id: 8aefe0ee-f12b-4575-b5b7-c97e21cb36f3
                    template_id: ddb96bbc-9b92-425e-8979-99464621b543
                    active: 1
                    name: example_version_name
                    html_content: <%body%>
                    plain_content: <%body%>
                    generate_plain_content: true
                    subject: <%subject%>
                    updated_at: '2019-03-13 18:56:33'
                    editor: code
    patch:
      operationId: UpdateTemplateVersion
      summary: Edit a transactional template version.
      tags:
      - Templates Versions
      description: '**This endpoint allows you to edit the content of your template version.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      requestBody:
        $ref: '#/components/requestBodies/PostPatchTransactionalTemplateVersion'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplateVersionOutput'
              examples:
                response:
                  value:
                    id: 8aefe0ee-f12b-4575-b5b7-c97e21cb36f3
                    template_id: ddb96bbc-9b92-425e-8979-99464621b543
                    active: 1
                    name: example_version_name
                    html_content: <%body%>
                    plain_content: <%body%>
                    generate_plain_content: true
                    subject: <%subject%>
                    updated_at: '2019-03-13 18:56:33'
                    editor: code
    delete:
      operationId: DeleteTemplateVersion
      summary: Delete a transactional template version.
      tags:
      - Templates Versions
      description: '**This endpoint allows you to delete a transactional template version.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      responses:
        '204':
          description: ''
  /v3/templates/{template_id}/versions/{version_id}/activate:
    parameters:
    - name: template_id
      in: path
      description: The ID of the original template
      required: true
      schema:
        type: string
        format: uuid
    - name: version_id
      in: path
      description: The ID of the template version
      required: true
      schema:
        type: string
        format: uuid
    post:
      operationId: ActivateTemplateVersion
      summary: Activate a transactional template version.
      tags:
      - Templates Versions
      description: '**This endpoint allows you to activate a version of one of your templates.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplateVersionOutput'
              examples:
                response:
                  value:
                    id: 8aefe0ee-f12b-4575-b5b7-c97e21cb36f3
                    template_id: ddb96bbc-9b92-425e-8979-99464621b543
                    active: 1
                    name: example_version_name
                    html_content: <%body%>
                    plain_content: <%body%>
                    generate_plain_content: true
                    subject: <%subject%>
                    updated_at: '2019-03-13 18:56:33'
                    editor: code
components:
  schemas:
    TransactionalTemplateVersionOutput:
      title: 'Transactional Templates: Version Output'
      type: object
      properties:
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/TransactionalTemplateWarning'
        active:
          type: integer
          description: Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.
          $ref: '#/components/schemas/Active1'
        name:
          type: string
          description: Name of the transactional template version.
          maxLength: 100
        html_content:
          type: string
          description: The HTML content of the Design.
        plain_content:
          type: string
          description: Plain text content of the Design.
        generate_plain_content:
          type: boolean
          description: If true, plain_content is always generated from html_content. If false, plain_content is not altered.
          default: true
        subject:
          type: string
          description: Subject of the new transactional template version.
          maxLength: 255
        editor:
          type: string
          description: The editor used in the UI.
          $ref: '#/components/schemas/Editor1'
        test_data:
          type: string
          description: For dynamic templates only, the mock json data that will be used for template preview and test sends.
        id:
          type: string
          description: ID of the transactional template version.
          format: uuid
        template_id:
          type: string
          description: ID of the transactional template.
        updated_at:
          type: string
          description: The date and time that this transactional template version was updated.
        thumbnail_url:
          type: string
          description: A Thumbnail preview of the template's html content.
      required:
      - name
      - subject
    TransactionalTemplateWarning:
      title: Warning
      type: object
      properties:
        message:
          type: string
          description: Warning message for the user
      example:
        message: A sample warning message.
    Editor1:
      type: string
      enum:
      - code
      - design
    TransactionalTemplateVersionCreate:
      title: 'Transactional Templates: Version Create'
      type: object
      properties:
        active:
          type: integer
          description: Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active.
          $ref: '#/components/schemas/Active'
        name:
          type: string
          description: Name of the transactional template version.
          maxLength: 100
        html_content:
          type: string
          description: The HTML content of the version. Maximum of 1048576 bytes allowed.
          maxLength: 1048576
        plain_content:
          type: string
          description: Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed.
          maxLength: 1048576
          default: <generated from html_content if left empty>
        generate_plain_content:
          type: boolean
          description: If true, plain_content is always generated from html_content. If false, plain_content is not altered.
          default: true
        subject:
          type: string
          description: Subject of the new transactional template version.
          maxLength: 255
        editor:
          type: string
          description: The editor used in the UI.
          $ref: '#/components/schemas/Editor'
        test_data:
          type: string
          description: For dynamic templates only, the mock json data that will be used for template preview and test sends.
      required:
      - name
      - subject
      example:
        template_id: Excepteur Ut qui
        active: 1
        name: pariatur non incididunt commodo
        html_content: dolor
        generate_plain_content: false
        subject: aliquip nulla Ut
        editor: design
        plain_content: labore dolore
    Active1:
      type: integer
      enum:
      - 0
      - 1
    Editor:
      type: string
      enum:
      - code
      - design
    Active:
      type: integer
      enum:
      - 0
      - 1
  parameters:
    OnBehalfOf:
      name: on-behalf-of
      in: header
      description: '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 <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: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.'
      required: false
      schema:
        type: string
  requestBodies:
    PostPatchTransactionalTemplateVersion:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TransactionalTemplateVersionCreate'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Twilio SendGrid requires you to authenticate with its APIs using an API key. The API key must be sent as a bearer token in the Authorization header.
externalDocs:
  description: Twilio SendGrid's official developer documentation.
  url: https://www.twilio.com/docs/sendgrid