Dyspatch API (2024.11)

Introduction

The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our Implementation Guide for more details on how to implement Dyspatch.

API Client Libraries

Dyspatch provides API Clients for popular languages and web frameworks.

Authentication

Bearer

Set Bearer followed by your API key as the Authorization header in your API requests.

Authorization: Bearer EXAMPLEAPIKEYXXXXXXXX12345678

Below is an example curl request with an API key in the Authorization header.

curl --request GET \
--url https://api.dyspatch.io/templates \
--header 'Authorization: Bearer EXAMPLEAPIKEYXXXXXXXX12345678' \
--header 'Accept: application/vnd.dyspatch.2024.11+json'
Security Scheme Type API Key
Header parameter name: Authorization

Templates

Templates are the email templates found in your Dyspatch account. Only the published Template Draft is returned.

A typical integration will start with using the Templates list endpoint to iterate through and sync Templates.

List Templates

Gets a list of Template Metadata objects for all published templates. Up to 25 results returned before results are paginated.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of templates

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/templates
https://api.dyspatch.io/templates

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Get Template by ID

Gets a template object with the matching ID. Templates without a published draft will result in an error.

Authorizations:
path Parameters
templateId
required
string

A template ID

query Parameters
targetLanguage
required
string
Enum: "html" "handlebars" "ampscript" "freemarker" "cheetah" "jinja" "liquid" "mandrillhandlebars" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A template object with the requested ID. Templates without a published draft will result in an error.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/templates/{templateId}
https://api.dyspatch.io/templates/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tem_g3L7Cw6Hp5wU",
  • "name": "Template Name",
  • "description": "Description of Template",
  • "url": "/templates/tem_g3L7Cw6Hp5wUaf395LehwK",
  • "compiled":
    {
    },
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "createdAt": "2024-10-31T17:55:56Z",
  • "updatedAt": "2024-10-31T17:55:56Z",
  • "publishedDraftId": "tdft_g3L7Cw6Hp5wU",
  • "localizations":
    [
    ]
}

Render Template by ID

Renders a template into HTML using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/render/template/{templateId}
https://api.dyspatch.io/render/template/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "html": "<html>Hello, world!<html>",
  • "ampHtml": "<html ⚡4email>Hello, world!<html>",
  • "text": "Hello, world!",
  • "subject": "Email Subject Line",
  • "sender": "example@example.com",
  • "replyTo": "example@example.com"
}

Render Localized Template by ID

Renders a template into HTML for the selected language using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents in the selected language, incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/render/template/{templateId}/{languageId}
https://api.dyspatch.io/render/template/{templateId}/{languageId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "html": "<html>Hello, world!<html>",
  • "ampHtml": "<html ⚡4email>Hello, world!<html>",
  • "text": "Hello, world!",
  • "subject": "Email Subject Line",
  • "sender": "example@example.com",
  • "replyTo": "example@example.com"
}

Drafts

Drafts represent unpublished versions of templates that are still mutable. There could be many in progress drafts for a template.

List Drafts

Returns all Email drafts for your organization.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

status
string
Value: "awaitingTranslation"

Filter the list of drafts by a particular status

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Drafts

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/drafts
https://api.dyspatch.io/drafts

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Submit Draft for Approval

Moves the Email draft into submitted state.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successfully submitted

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/drafts/{draftId}/publishRequest
https://api.dyspatch.io/drafts/{draftId}/publishRequest

Get Draft by ID

Gets a Email draft object with the matching ID. The "compiled" field will contain the template in the default, unlocalized form.

Authorizations:
path Parameters
draftId
required
string

A draft ID

query Parameters
targetLanguage
required
string
Enum: "html" "handlebars" "ampscript" "freemarker" "cheetah" "jinja" "liquid" "mandrillhandlebars" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A draft object with the requested ID.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/drafts/{draftId}
https://api.dyspatch.io/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tdft_g3L7Cw6Hp5wU",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "name": "Draft Name",
  • "url": "/drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU",
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:56Z",
  • "updatedAt": "2024-10-31T17:55:56Z",
  • "localizations":
    [
    ],
  • "status": "LOCKED_FOR_TRANSLATION",
  • "templateName": "Template Name",
  • "designApprovedDate": "2024-10-31T17:55:56Z"
}

Get Localizations on a Draft

Returns localization metadata for the Email draft

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of localizations

400

Invalid request

get/drafts/{draftId}/localizations
https://api.dyspatch.io/drafts/{draftId}/localizations

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
[
  • {
    }
]

Create or Update a Localization

Inserts a localization or sets the name on an existing localization that already uses the languageId

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
name
string

Responses

200

Successful upsert

400

Invalid request

put/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/drafts/{draftId}/localizations/{languageId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "English (US)"
}

Remove a Localization from Draft

Deletes the localization with the given language ID if it exists

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successful delete

400

Invalid request

delete/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/drafts/{draftId}/localizations/{languageId}

Set Draft Translations for Language

Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format %(my_variable)s and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set Content-Type header to application/json. For gettext PO format set Content-Type header to text/x-gettext-translation.

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
property name*
string

Responses

200

Successful

400

Invalid request

403

Unauthorized

put/drafts/{draftId}/localizations/{languageId}/translations
https://api.dyspatch.io/drafts/{draftId}/localizations/{languageId}/translations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "Hello %(name)s": "Bonjour %(name)s",
  • "Welcome": "Bienvenue"
}

Get Draft Localization Keys

Returns the list of values that need to be translated for the draft. Set the Accept header to application/vnd.dyspatch.2024.11+json to get a JSON object, or text/vnd.dyspatch.2024.11+x-gettext-translation to get the POT file.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Localization keys

400

Invalid request

get/drafts/{draftId}/localizationKeys
https://api.dyspatch.io/drafts/{draftId}/localizationKeys

Response samples

Content type
Copy
Expand all Collapse all
[
  • {
    }
]

Localizations

Localization objects are the same as Template objects except they contain localized content.

If your account is using localizations then use this instead of the compiled Template object.

Get Localization Object by ID

Returns the published content associated with the localization of the matching ID

Authorizations:
path Parameters
localizationId
required
string

A localization ID

query Parameters
targetLanguage
required
string
Enum: "html" "handlebars" "ampscript" "freemarker" "cheetah" "jinja" "liquid" "mandrillhandlebars" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/localizations/{localizationId}
https://api.dyspatch.io/localizations/{localizationId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:56Z",
  • "updatedAt": "2024-10-31T17:55:56Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Get Draft Localization Object by ID

Returns a specific localization object of the matching draft with a matching localization ID

Authorizations:
path Parameters
draftId
required
string

A draft ID

localizationId
required
string

A localization ID

query Parameters
targetLanguage
required
string
Enum: "html" "handlebars" "ampscript" "freemarker" "cheetah" "jinja" "liquid" "mandrillhandlebars" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object from the matching draft ID with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/localizations/{localizationId}/drafts/{draftId}
https://api.dyspatch.io/localizations/{localizationId}/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:56Z",
  • "updatedAt": "2024-10-31T17:55:56Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

SMS Templates

SMS Templates are the SMS templates found in your Dyspatch account. Only the published Template Draft is returned.

A typical integration will start with using the Templates list endpoint to iterate through and sync Templates.

List SMS Templates

Gets a list of SMS Template Metadata objects for all published templates. Up to 25 results returned before results are paginated.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of SMS templates

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/sms/templates
https://api.dyspatch.io/sms/templates

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Get SMS Template by ID

Gets an SMS template object with the matching ID. Templates without a published draft will result in an error.

Authorizations:
path Parameters
templateId
required
string

A template ID

query Parameters
smsTargetLanguage
string
Enum: "sms" "handlebars" "liquid" "django" "jinja" "ampscript" "klaviyo" "brevo" "sendpulse" "iterablehandlebars" "dotdigitalliquid"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A template object with the requested ID. Templates without a published draft will result in an error.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/sms/templates/{templateId}
https://api.dyspatch.io/sms/templates/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tem_g3L7Cw6Hp5wU",
  • "name": "Template Name",
  • "description": "Description of Template",
  • "url": "/templates/tem_g3L7Cw6Hp5wUaf395LehwK",
  • "compiled":
    {
    },
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "createdAt": "2024-10-31T17:55:56Z",
  • "updatedAt": "2024-10-31T17:55:56Z",
  • "publishedDraftId": "tdft_g3L7Cw6Hp5wU",
  • "localizations":
    [
    ]
}

Render SMS Template by ID

Renders an SMS template into HTML using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/sms/render/template/{templateId}
https://api.dyspatch.io/sms/render/template/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "sender": "John Doe",
  • "phone": "123-456-7890",
  • "content":
    [
    ]
}

Render Localized SMS Template by ID

Renders an SMS template into HTML for the selected language using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents in the selected language, incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/sms/render/template/{templateId}/{languageId}
https://api.dyspatch.io/sms/render/template/{templateId}/{languageId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "sender": "John Doe",
  • "phone": "123-456-7890",
  • "content":
    [
    ]
}

SMS Drafts

SMS Drafts represent unpublished versions of templates that are still mutable. There could be many in progress drafts for a template.

List SMS Drafts

Returns all SMS drafts for your organization.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

status
string
Value: "awaitingTranslation"

Filter the list of drafts by a particular status

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Drafts

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/sms/drafts
https://api.dyspatch.io/sms/drafts

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Submit SMS Draft for Approval

Moves the SMS draft into submitted state.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successfully submitted

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/sms/drafts/{draftId}/publishRequest
https://api.dyspatch.io/sms/drafts/{draftId}/publishRequest

Get SMS Draft by ID

Gets an SMS draft object with the matching ID. The "compiled" field will contain the template in the default, unlocalized form.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A draft object with the requested ID.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/sms/drafts/{draftId}
https://api.dyspatch.io/sms/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tdft_g3L7Cw6Hp5wU",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "name": "Draft Name",
  • "url": "/drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU",
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:56Z",
  • "updatedAt": "2024-10-31T17:55:56Z",
  • "localizations":
    [
    ],
  • "status": "LOCKED_FOR_TRANSLATION",
  • "templateName": "Template Name",
  • "designApprovedDate": "2024-10-31T17:55:56Z"
}

Get Localizations on an SMS Draft

Returns localization metadata for the SMS draft

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of localizations

400

Invalid request

get/sms/drafts/{draftId}/localizations
https://api.dyspatch.io/sms/drafts/{draftId}/localizations

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
[
  • {
    }
]

Create or Update an SMS Localization

Inserts a localization or sets the name on an existing localization that already uses the languageId

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
name
string

Responses

200

Successful upsert

400

Invalid request

put/sms/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/sms/drafts/{draftId}/localizations/{languageId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "English (US)"
}

Remove a Localization from SMS Draft

Deletes the localization with the given language ID if it exists

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successful delete

400

Invalid request

delete/sms/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/sms/drafts/{draftId}/localizations/{languageId}

Set SMS Draft Translations for Language

Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format %(my_variable)s and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set Content-Type header to application/json. For gettext PO format set Content-Type header to text/x-gettext-translation.

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
property name*
string

Responses

200

Successful

400

Invalid request

403

Unauthorized

put/sms/drafts/{draftId}/localizations/{languageId}/translations
https://api.dyspatch.io/sms/drafts/{draftId}/localizations/{languageId}/translations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "Hello %(name)s": "Bonjour %(name)s",
  • "Welcome": "Bienvenue"
}

Get SMS Draft Localization Keys

Returns the list of values that need to be translated for the draft. Set the Accept header to application/vnd.dyspatch.2024.11+json to get a JSON object, or text/vnd.dyspatch.2024.11+x-gettext-translation to get the POT file.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Localization keys

400

Invalid request

get/sms/drafts/{draftId}/localizationKeys
https://api.dyspatch.io/sms/drafts/{draftId}/localizationKeys

Response samples

Content type
Copy
Expand all Collapse all
[
  • {
    }
]

SMS Localizations

SMS Localization objects are the same as Template objects except they contain localized content.

If your account is using localizations then use this instead of the compiled Template object.

Get SMS Localization Object by ID

Returns the published SMS content associated with the localization of the matching ID

Authorizations:
path Parameters
localizationId
required
string

A localization ID

query Parameters
smsTargetLanguage
string
Enum: "sms" "handlebars" "liquid" "django" "jinja" "ampscript" "klaviyo" "brevo" "sendpulse" "iterablehandlebars" "dotdigitalliquid"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/sms/localizations/{localizationId}
https://api.dyspatch.io/sms/localizations/{localizationId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Get SMS Draft Localization Object by ID

Returns a specific localization object of the matching SMS draft with a matching localization ID

Authorizations:
path Parameters
draftId
required
string

A draft ID

localizationId
required
string

A localization ID

query Parameters
smsTargetLanguage
string
Enum: "sms" "handlebars" "liquid" "django" "jinja" "ampscript" "klaviyo" "brevo" "sendpulse" "iterablehandlebars" "dotdigitalliquid"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object from the matching draft ID with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/sms/localizations/{localizationId}/drafts/{draftId}
https://api.dyspatch.io/sms/localizations/{localizationId}/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Push Templates

Push Templates are the Push templates found in your Dyspatch account. Only the published Template Draft is returned.

A typical integration will start with using the Templates list endpoint to iterate through and sync Templates.

List Push Templates

Gets a list of Push Template Metadata objects for all published templates. Up to 25 results returned before results are paginated.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of Push templates

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/push/templates
https://api.dyspatch.io/push/templates

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Get Push Template by ID

Gets an Push template object with the matching ID. Templates without a published draft will result in an error.

Authorizations:
path Parameters
templateId
required
string

A template ID

query Parameters
pushTargetLanguage
string
Enum: "push" "handlebars" "liquid" "django" "jinja" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A template object with the requested ID. Templates without a published draft will result in an error.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/push/templates/{templateId}
https://api.dyspatch.io/push/templates/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tem_g3L7Cw6Hp5wU",
  • "name": "Template Name",
  • "description": "Description of Template",
  • "url": "/templates/tem_g3L7Cw6Hp5wUaf395LehwK",
  • "compiled":
    {
    },
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "publishedDraftId": "tdft_g3L7Cw6Hp5wU",
  • "localizations":
    [
    ]
}

Render Push Template by ID

Renders an Push template into HTML using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/push/render/template/{templateId}
https://api.dyspatch.io/push/render/template/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "content":
    [
    ]
}

Render Localized Push Template by ID

Renders an Push template into HTML for the selected language using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents in the selected language, incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/push/render/template/{templateId}/{languageId}
https://api.dyspatch.io/push/render/template/{templateId}/{languageId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "content":
    [
    ]
}

Push Drafts

Push Drafts represent unpublished versions of templates that are still mutable. There could be many in progress drafts for a template.

List Push Drafts

Returns all Push drafts for your organization.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

status
string
Value: "awaitingTranslation"

Filter the list of drafts by a particular status

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Drafts

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/push/drafts
https://api.dyspatch.io/push/drafts

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Submit Push Draft for Approval

Moves the Push draft into submitted state.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successfully submitted

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/push/drafts/{draftId}/publishRequest
https://api.dyspatch.io/push/drafts/{draftId}/publishRequest

Get Push Draft by ID

Gets an Push draft object with the matching ID. The "compiled" field will contain the template in the default, unlocalized form.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A draft object with the requested ID.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/push/drafts/{draftId}
https://api.dyspatch.io/push/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tdft_g3L7Cw6Hp5wU",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "name": "Draft Name",
  • "url": "/drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU",
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "localizations":
    [
    ],
  • "status": "LOCKED_FOR_TRANSLATION",
  • "templateName": "Template Name",
  • "designApprovedDate": "2024-10-31T17:55:57Z"
}

Get Localizations on an Push Draft

Returns localization metadata for the Push draft

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of localizations

400

Invalid request

get/push/drafts/{draftId}/localizations
https://api.dyspatch.io/push/drafts/{draftId}/localizations

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
[
  • {
    }
]

Create or Update an Push Localization

Inserts a localization or sets the name on an existing localization that already uses the languageId

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
name
string

Responses

200

Successful upsert

400

Invalid request

put/push/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/push/drafts/{draftId}/localizations/{languageId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "English (US)"
}

Remove a Localization from Push Draft

Deletes the localization with the given language ID if it exists

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successful delete

400

Invalid request

delete/push/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/push/drafts/{draftId}/localizations/{languageId}

Set Push Draft Translations for Language

Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format %(my_variable)s and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set Content-Type header to application/json. For gettext PO format set Content-Type header to text/x-gettext-translation.

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
property name*
string

Responses

200

Successful

400

Invalid request

403

Unauthorized

put/push/drafts/{draftId}/localizations/{languageId}/translations
https://api.dyspatch.io/push/drafts/{draftId}/localizations/{languageId}/translations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "Hello %(name)s": "Bonjour %(name)s",
  • "Welcome": "Bienvenue"
}

Get Push Draft Localization Keys

Returns the list of values that need to be translated for the draft. Set the Accept header to application/vnd.dyspatch.2024.11+json to get a JSON object, or text/vnd.dyspatch.2024.11+x-gettext-translation to get the POT file.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Localization keys

400

Invalid request

get/push/drafts/{draftId}/localizationKeys
https://api.dyspatch.io/push/drafts/{draftId}/localizationKeys

Response samples

Content type
Copy
Expand all Collapse all
[
  • {
    }
]

Push Localizations

Push Localization objects are the same as Template objects except they contain localized content.

If your account is using localizations then use this instead of the compiled Template object.

Get Push Localization Object by ID

Returns the published Push content associated with the localization of the matching ID

Authorizations:
path Parameters
localizationId
required
string

A localization ID

query Parameters
pushTargetLanguage
string
Enum: "push" "handlebars" "liquid" "django" "jinja" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/push/localizations/{localizationId}
https://api.dyspatch.io/push/localizations/{localizationId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Get Push Draft Localization Object by ID

Returns a specific localization object of the matching Push draft with a matching localization ID

Authorizations:
path Parameters
draftId
required
string

A draft ID

localizationId
required
string

A localization ID

query Parameters
pushTargetLanguage
string
Enum: "push" "handlebars" "liquid" "django" "jinja" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object from the matching draft ID with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/push/localizations/{localizationId}/drafts/{draftId}
https://api.dyspatch.io/push/localizations/{localizationId}/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Voice Templates

Voice Templates are the Voice templates found in your Dyspatch account. Only the published Template Draft is returned.

A typical integration will start with using the Templates list endpoint to iterate through and sync Templates.

List Voice Templates

Gets a list of Voice Template Metadata objects for all published templates. Up to 25 results returned before results are paginated.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of Voice templates

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/voice/templates
https://api.dyspatch.io/voice/templates

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Get Voice Template by ID

Gets an Voice template object with the matching ID. Templates without a published draft will result in an error.

Authorizations:
path Parameters
templateId
required
string

A template ID

query Parameters
voiceTargetLanguage
string
Enum: "voice" "handlebars" "liquid" "django" "jinja" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A template object with the requested ID. Templates without a published draft will result in an error.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/voice/templates/{templateId}
https://api.dyspatch.io/voice/templates/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tem_g3L7Cw6Hp5wU",
  • "name": "Template Name",
  • "description": "Description of Template",
  • "url": "/templates/tem_g3L7Cw6Hp5wUaf395LehwK",
  • "compiled":
    {
    },
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "publishedDraftId": "tdft_g3L7Cw6Hp5wU",
  • "localizations":
    [
    ]
}

Render Voice Template by ID

Renders an Voice template into HTML using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/voice/render/template/{templateId}
https://api.dyspatch.io/voice/render/template/{templateId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "content": "This is some text content"
}

Render Localized Voice Template by ID

Renders an Voice template into HTML for the selected language using the provided data.

Authorizations:
path Parameters
templateId
required
string

A template ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Rendered template contents in the selected language, incorporating the data passed in the request body.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/voice/render/template/{templateId}/{languageId}
https://api.dyspatch.io/voice/render/template/{templateId}/{languageId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "content": "This is some text content"
}

Voice Drafts

Voice Drafts represent unpublished versions of templates that are still mutable. There could be many in progress drafts for a template.

List Voice Drafts

Returns all Voice drafts for your organization.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

status
string
Value: "awaitingTranslation"

Filter the list of drafts by a particular status

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Drafts

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/voice/drafts
https://api.dyspatch.io/voice/drafts

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Submit Voice Draft for Approval

Moves the Voice draft into submitted state.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successfully submitted

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

post/voice/drafts/{draftId}/publishRequest
https://api.dyspatch.io/voice/drafts/{draftId}/publishRequest

Get Voice Draft by ID

Gets an Voice draft object with the matching ID. The "compiled" field will contain the template in the default, unlocalized form.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A draft object with the requested ID.

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/voice/drafts/{draftId}
https://api.dyspatch.io/voice/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "tdft_g3L7Cw6Hp5wU",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "name": "Draft Name",
  • "url": "/drafts/tdft_g3L7Cw6Hp5wUaf395LehwK/dft_g3L7Cw6Hp5wU",
  • "path": "fdr_01gb8vd6pz/fdr_01gqjmdbq/fdr_01gqjmg1",
  • "workspaceId": "fdr_01gb8vd6pz",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "localizations":
    [
    ],
  • "status": "LOCKED_FOR_TRANSLATION",
  • "templateName": "Template Name",
  • "designApprovedDate": "2024-10-31T17:55:57Z"
}

Get Localizations on an Voice Draft

Returns localization metadata for the Voice draft

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of localizations

400

Invalid request

get/voice/drafts/{draftId}/localizations
https://api.dyspatch.io/voice/drafts/{draftId}/localizations

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
[
  • {
    }
]

Create or Update an Voice Localization

Inserts a localization or sets the name on an existing localization that already uses the languageId

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
name
string

Responses

200

Successful upsert

400

Invalid request

put/voice/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/voice/drafts/{draftId}/localizations/{languageId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "English (US)"
}

Remove a Localization from Voice Draft

Deletes the localization with the given language ID if it exists

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successful delete

400

Invalid request

delete/voice/drafts/{draftId}/localizations/{languageId}
https://api.dyspatch.io/voice/drafts/{draftId}/localizations/{languageId}

Set Voice Draft Translations for Language

Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format %(my_variable)s and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set Content-Type header to application/json. For gettext PO format set Content-Type header to text/x-gettext-translation.

Authorizations:
path Parameters
draftId
required
string

A draft ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
property name*
string

Responses

200

Successful

400

Invalid request

403

Unauthorized

put/voice/drafts/{draftId}/localizations/{languageId}/translations
https://api.dyspatch.io/voice/drafts/{draftId}/localizations/{languageId}/translations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "Hello %(name)s": "Bonjour %(name)s",
  • "Welcome": "Bienvenue"
}

Get Voice Draft Localization Keys

Returns the list of values that need to be translated for the draft. Set the Accept header to application/vnd.dyspatch.2024.11+json to get a JSON object, or text/vnd.dyspatch.2024.11+x-gettext-translation to get the POT file.

Authorizations:
path Parameters
draftId
required
string

A draft ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Localization keys

400

Invalid request

get/voice/drafts/{draftId}/localizationKeys
https://api.dyspatch.io/voice/drafts/{draftId}/localizationKeys

Response samples

Content type
Copy
Expand all Collapse all
[
  • {
    }
]

Voice Localizations

Voice Localization objects are the same as Template objects except they contain localized content.

If your account is using localizations then use this instead of the compiled Template object.

Get Voice Localization Object by ID

Returns the published Voice content associated with the localization of the matching ID

Authorizations:
path Parameters
localizationId
required
string

A localization ID

query Parameters
voiceTargetLanguage
string
Enum: "voice" "handlebars" "liquid" "django" "jinja" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/voice/localizations/{localizationId}
https://api.dyspatch.io/voice/localizations/{localizationId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Get Voice Draft Localization Object by ID

Returns a specific localization object of the matching Voice draft with a matching localization ID

Authorizations:
path Parameters
draftId
required
string

A draft ID

localizationId
required
string

A localization ID

query Parameters
voiceTargetLanguage
string
Enum: "voice" "handlebars" "liquid" "django" "jinja" "handlebarsjava"

The type of templating language to use when compiling the content.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A localization object from the matching draft ID with the requested ID

400

Invalid request

401

Unauthenticated

403

Unauthorized

404

Resource not found

429

Rate limit exceeded

500

Server error

default

Server error

get/voice/localizations/{localizationId}/drafts/{draftId}
https://api.dyspatch.io/voice/localizations/{localizationId}/drafts/{draftId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
  • "languages":
    [
    ],
  • "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
  • "template": "tem_g3L7Cw6Hp5wU",
  • "compiled":
    {
    },
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "name": "English (US)",
  • "localeGroup": "lgr_alka38ajla301"
}

Workspaces

List Workspaces

Gets a list of Workspace objects for all workspaces. Up to 25 results returned before results are paginated.

Authorizations:
query Parameters
cursor
string

A cursor value used to retrieve a specific page from a paginated result set.

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of workspaces

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/workspaces
https://api.dyspatch.io/workspaces

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

List Folder

Gets a Folder with a list of its sub-folders for the provided id.

Authorizations:
path Parameters
folderId
required
string

A workspace/folder ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Folder

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/workspaces/{folderId}
https://api.dyspatch.io/workspaces/{folderId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "fdr_01g0z4d5aw",
  • "name": "Name of Folder",
  • "description": "Description of Folder",
  • "url": "/workspaces/fdr_g3L7Cw6Hp5wUaf395LehwK",
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "subfolders":
    [
    ]
}

Blocks

List Blocks

Gets a list of Blocks

Authorizations:
header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of blocks

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/blocks
https://api.dyspatch.io/blocks

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "cursor":
    {
    },
  • "data":
    [
    ]
}

Get Block by ID

Gets a block with the matching ID.

Authorizations:
path Parameters
blockId
required
string

A block ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A block

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/blocks/{blockId}
https://api.dyspatch.io/blocks/{blockId}

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
{
  • "id": "blk_01gpe172x7p6aa1c9grr48efq8",
  • "name": "Header Block",
  • "description": "string",
  • "createdAt": "2024-10-31T17:55:57Z",
  • "updatedAt": "2024-10-31T17:55:57Z",
  • "url": "/blocks/blk_01gpe172x7p6aa1c9grr48efq8"
}

Get localizations on a block

Returns localization metadata for the block

Authorizations:
path Parameters
blockId
required
string

A block ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

A list of localizations

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/blocks/{blockId}/localizations
https://api.dyspatch.io/blocks/{blockId}/localizations

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
[
  • {
    }
]

Get localization keys

Returns the list of values that need to be translated for the block.

Authorizations:
path Parameters
blockId
required
string

A block ID

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Localization keys

400

Invalid request

401

Unauthenticated

403

Unauthorized

429

Rate limit exceeded

500

Server error

default

Server error

get/blocks/{blockId}/localizationKeys
https://api.dyspatch.io/blocks/{blockId}/localizationKeys

Response samples

Content type
application/vnd.dyspatch.2024.11+json
Copy
Expand all Collapse all
[
  • {
    }
]

Create or update a block localization

Inserts a localization or sets the name on an existing localization that already uses the languageId

Authorizations:
path Parameters
blockId
required
string

A block ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
name
string

Responses

200

Successful upsert

put/blocks/{blockId}/localizations/{languageId}
https://api.dyspatch.io/blocks/{blockId}/localizations/{languageId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "English (US)"
}

Remove a localization

Deletes the localization with the given language ID if it exists

Authorizations:
path Parameters
blockId
required
string

A block ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Responses

200

Successful delete

delete/blocks/{blockId}/localizations/{languageId}
https://api.dyspatch.io/blocks/{blockId}/localizations/{languageId}

Set translations for language

Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format %(my_variable)s and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format.

Authorizations:
path Parameters
blockId
required
string

A block ID

languageId
required
string

A language ID (eg: en-US)

header Parameters
Accept
required
string

A version of the API that should be used for the request. For example, to use version "2024.11", set the value to "application/vnd.dyspatch.2024.11+json"

Request Body schema: application/json
property name*
string

Responses

200

Successful

403

Unauthorized

put/blocks/{blockId}/localizations/{languageId}/translations
https://api.dyspatch.io/blocks/{blockId}/localizations/{languageId}/translations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "Hello %(name)s": "Bonjour %(name)s",
  • "Welcome": "Bienvenue"
}