SendGrid Templates API

Twilio SendGrid Templates API

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-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Twilio SendGrid Provisioning Account Templates 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
  description: Twilio SendGrid Templates API
paths:
  /v3/templates:
    post:
      operationId: CreateTemplate
      summary: Create a transactional template.
      tags:
      - Templates
      description: '**This endpoint allows you to create a transactional template.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name for the new transactional template.
                  maxLength: 100
                generation:
                  type: string
                  description: Defines whether the template supports dynamic replacement.
                  default: legacy
                  $ref: '#/components/schemas/Generation'
              required:
              - name
              example:
                name: example_name
                generation: dynamic
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplate'
              examples:
                response:
                  value:
                    id: 733ba07f-ead1-41fc-933a-3976baa23716
                    name: example_name
                    generation: legacy
                    updated_at: '2021-04-28 13:12:46'
                    versions: []
    get:
      operationId: ListTemplate
      summary: Retrieve paged transactional templates.
      tags:
      - Templates
      description: '**This endpoint allows you to retrieve all transactional templates.**'
      parameters:
      - name: generations
        in: query
        description: Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`.
        required: false
        schema:
          type: string
          default: legacy
          $ref: '#/components/schemas/Generations'
      - name: page_size
        in: query
        description: The number of templates to be returned in each page of results
        required: true
        schema:
          type: number
          minimum: 1
          maximum: 200
      - name: page_token
        in: query
        description: A token corresponding to a specific page of results, as provided by metadata
        required: false
        schema:
          type: string
      - $ref: '#/components/parameters/OnBehalfOf'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: ''
                    items:
                      $ref: '#/components/schemas/TransactionalTemplatesTemplateLean'
                  _metadata:
                    $ref: '#/components/schemas/Metadata'
              examples:
                response:
                  value:
                    result:
                    - id: fae7c985-eb92-4b47-9987-28ec29dbc698
                      name: example_name
                      generation: legacy
                      updated_at: '2020-11-12 12:00:09'
                      versions: []
                    _metadata:
                      self: https://api.sendgrid.com/v3/templates
                      count: 1
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                        error_id:
                          type: string
  /v3/templates/{template_id}:
    parameters:
    - name: template_id
      in: path
      required: true
      schema:
        type: string
    post:
      operationId: DuplicateTemplate
      summary: Duplicate a transactional template.
      tags:
      - Templates
      description: '**This endpoint allows you to duplicate a transactional template.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name for the new transactional template.
                  maxLength: 100
              example:
                name: example_name
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplate'
              examples:
                response:
                  value:
                    id: 733ba07f-ead1-41fc-933a-3976baa23716
                    name: example_name
                    generation: dynamic
                    updated_at: '2020-12-12 58:26:65'
                    versions: []
    get:
      operationId: GetTemplate
      summary: Retrieve a single transactional template.
      tags:
      - Templates
      description: '**This endpoint allows you to retrieve a single transactional template.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplate'
              examples:
                response:
                  value:
                    id: 40da60e6-66f3-4223-9406-ba58b7f55a62
                    name: Duis in dolor
                    generation: legacy
                    updated_at: '2020-12-12 58:26:65'
                    versions: []
    patch:
      operationId: UpdateTemplate
      summary: Edit a transactional template.
      tags:
      - Templates
      description: '**This endpoint allows you to edit the name of a transactional template.**


        To edit the template itself, [create a new transactional template version](https://docs.sendgrid.com/api-reference/transactional-templates-versions/create-a-new-transactional-template-version).'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the transactional template.
                  maxLength: 100
              example:
                name: new_example_name
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionalTemplate'
              examples:
                response:
                  value:
                    id: 733ba07f-ead1-41fc-933a-3976baa23716
                    name: new_example_name
                    generation: legacy
                    updated_at: '2021-04-28 13:12:46'
                    versions: []
    delete:
      operationId: DeleteTemplate
      summary: Delete a template.
      tags:
      - Templates
      description: '**This endpoint allows you to delete a transactional template.**'
      parameters:
      - $ref: '#/components/parameters/OnBehalfOf'
      responses:
        '204':
          description: ''
components:
  schemas:
    TransactionalTemplateWarning:
      title: Warning
      type: object
      properties:
        message:
          type: string
          description: Warning message for the user
      example:
        message: A sample warning message.
    TransactionalTemplatesTemplateLean:
      title: 'Transactional Templates: Template Lean'
      type: object
      properties:
        id:
          type: string
          description: The ID of the transactional template.
          minLength: 36
          maxLength: 36
          format: uuid
        name:
          type: string
          description: The name for the transactional template.
          maxLength: 100
        generation:
          type: string
          description: Defines the generation of the template.
          $ref: '#/components/schemas/Generation1'
        updated_at:
          type: string
          description: The date and time that this transactional template version was updated.
          pattern: ^(\d{4}-\d{2}-\d{2}) ((\d{2}):(\d{2}):(\d{2}))$
        versions:
          type: array
          description: The different versions of this transactional template.
          items:
            $ref: '#/components/schemas/TransactionalTemplatesVersionOutputLean'
      required:
      - id
      - name
      - generation
      - updated_at
      example:
        id: 0c314114-a2b7-4523-8cbc-a293d7d19007
        name: example_name
        generation: legacy
        updated_at: '2021-04-28 13:12:46'
        versions: []
    Metadata:
      title: _metadata
      type: object
      properties:
        prev:
          type: string
          format: uri
        self:
          type: string
          format: uri
        next:
          type: string
          format: uri
        count:
          type: integer
          minimum: 0
    Generations:
      type: string
      enum:
      - legacy
      - dynamic
      - legacy,dynamic
    Editor1:
      type: string
      enum:
      - code
      - design
    TransactionalTemplate:
      title: 'Transactional Templates: Template'
      example:
        id: 33feeff2-5069-43fe-8853-428651e5be79
        name: example_name
        updated_at: '2021-04-28 13:12:46'
        warning:
          message: Sample warning message
        generation: legacy
      type: object
      properties:
        id:
          type: string
          description: The ID of the transactional template.
          minLength: 36
          maxLength: 36
          format: uuid
        name:
          type: string
          description: The name for the transactional template.
          maxLength: 100
        generation:
          type: string
          description: Defines the generation of the template.
          $ref: '#/components/schemas/Generation1'
        updated_at:
          type: string
          description: The date and time that this transactional template version was updated.
          pattern: ^(\d{4}-\d{2}-\d{2}) ((\d{2}):(\d{2}):(\d{2}))$
        versions:
          type: array
          description: The different versions of this transactional template.
          items:
            $ref: '#/components/schemas/TransactionalTemplatesVersionOutputLean'
        warning:
          $ref: '#/components/schemas/TransactionalTemplateWarning'
      required:
      - generation
      - id
      - name
      - updated_at
    Active1:
      type: integer
      enum:
      - 0
      - 1
    Generation1:
      type: string
      enum:
      - legacy
      - dynamic
    Generation:
      type: string
      enum:
      - legacy
      - dynamic
    TransactionalTemplatesVersionOutputLean:
      title: 'Transactional Templates: Version Output Lean'
      type: object
      properties:
        id:
          type: string
          description: ID of the transactional template version.
          format: uuid
        template_id:
          type: string
          description: ID of the transactional template.
        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
        subject:
          type: string
          description: Subject of the new transactional template version.
          maxLength: 255
        updated_at:
          type: string
          description: The date and time that this transactional template version was updated.
        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
        html_content:
          type: string
          description: The HTML content of the Design.
        plain_content:
          type: string
          description: Plain text content of the Design.
        editor:
          type: string
          description: The editor used in the UI.
          $ref: '#/components/schemas/Editor1'
        thumbnail_url:
          type: string
          description: A Thumbnail preview of the template's html content.
  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
  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