openapi: 3.0.1 info: title: Templates API description: Allows the maintenance of templates for use with messaging APIs. version: '1.0' servers: - url: https://{region}-api.dotdigital.com variables: region: default: r1 enum: - r1 - r2 - r3 description: The Dotdigital region id your account belongs to security: - basicAuth: [] paths: /cpaas/templates: get: summary: Retrieves a list of all available templates responses: '200': description: A list of templates content: application/json: schema: type: array items: $ref: '#/components/schemas/templateFull' '404': description: The template was not found content: {} post: summary: Create a template requestBody: description: Detail of the template to create content: application/json: schema: $ref: '#/components/schemas/templateCreate' required: true responses: '201': description: The created template headers: ETag: description: A unique value representing the version of the template, optionally used for optimistic concurrency control on PUT and DELETE schema: type: string Last-Modified: description: The date the template was last updated in ISO 8601 format schema: type: string format: date-time content: application/json: schema: $ref: '#/components/schemas/templateFull' '404': description: The template was not found content: {} x-codegen-request-body-name: templateData /cpaas/templates/{templateId}: get: summary: Retrieves a template parameters: - name: templateId in: path description: The template id required: true schema: type: string - name: includeDeleted in: query description: Indicates whether deleted templates should be returned schema: type: boolean responses: '200': description: The requested template headers: ETag: description: A unique value representing the version of the template, optionally used for optimistic concurrency control on PUT and DELETE schema: type: string Last-Modified: description: The date the template was last updated in ISO 8601 format schema: type: string format: date-time content: application/json: schema: $ref: '#/components/schemas/templateFull' '404': description: The template was not found content: {} put: summary: Updates a template parameters: - name: templateId in: path description: The template id required: true schema: type: string - name: if-match in: header description: An optional ETag for optimistic concurrency control schema: type: string requestBody: description: Detail of the template to update content: application/json: schema: $ref: '#/components/schemas/templateUpdate' required: true responses: '200': description: The updated template headers: ETag: description: A unique value representing the version of the template, optionally used for optimistic concurrency control on PUT and DELETE schema: type: string Last-Modified: description: The date the template was last updated in ISO 8601 format schema: type: string format: date-time content: application/json: schema: $ref: '#/components/schemas/templateFull' '404': description: The template was not found content: {} '412': description: The ETag supplied did not match, another update may have taken place content: {} x-codegen-request-body-name: templateData delete: summary: Deletes a template parameters: - name: templateId in: path description: The template id required: true schema: type: string - name: if-match in: header description: An optional ETag for optimistic concurrency control schema: type: string responses: '204': description: Indicates successful deletion of an template content: {} '404': description: The template was not found content: {} '412': description: The ETag supplied did not match, another update may have taken place content: {} components: schemas: messagePart: type: object templateCreate: required: - messageParts - name type: object properties: id: pattern: ^[a-zA-Z\d-_] type: string description: The templates unique identifier, can only contain alpha numerics, hyphens and underscores name: type: string description: The name of the template. In the absence of an id, the name will be stripped of invalid characters and used as the id description: type: string description: The description of the template. messageParts: type: array description: MessageParts items: $ref: '#/components/schemas/messagePart' templateUpdate: required: - messageParts - name type: object properties: name: type: string description: The name of the template description: type: string description: The description of the template. messageParts: type: array description: MessageParts items: $ref: '#/components/schemas/messagePart' templateFull: type: object properties: id: pattern: ^a-zA-Z\d-_ type: string description: The templates unique identifier, can only contain alpha numerics, hyphens and underscores readOnly: true name: type: string description: The name of the template. In the absence of an id, the name will be stripped of invalid characters and used as the id description: type: string description: The description of the template. messageParts: type: array description: MessageParts items: $ref: '#/components/schemas/messagePart' _createdOn: type: string description: The date (in UTC, ISO 8601 format) that the template was created format: date-time readOnly: true _createdBy: type: string description: The identity that created the template readOnly: true _updatedOn: type: string description: The date (in UTC, ISO 8601 format) that the template was last updated format: date-time readOnly: true _updatedBy: type: string description: The identity that created the template readOnly: true parameters: templateIdParameter: name: templateId in: path description: The template id required: true schema: type: string includeDeletedQueryParameter: name: includeDeleted in: query description: Indicates whether deleted templates should be returned schema: type: boolean securitySchemes: basicAuth: type: http scheme: basic x-readme: samples-languages: - curl - csharp - java - node - php - python - ruby explorer-enabled: true proxy-enabled: true