Ditto API (v1)

Programmatically read and write data in your Ditto workspace.
Base URL
https://api.dittowords.com/v1
Please ensure that your requests are using the `/v1` path prefix to avoid interacting with a deprecated version of the Ditto API.

Authentication

A Ditto API key is required to access the API. API keys are created at the workspace-level, and can be managed by anyone who has edit permission in the workspace.
Generate an API key
  1. 1.
    Log into Ditto and navigate to the Developer Integrations page.
  2. 2.
    Enable developer integrations for your workspace if they haven't been enabled already (see this page for more information).
  1. 3.
    Under the section titled API Keys, click + Create API key.
An open modal for creating an API key on the Developer Integrations page.
  1. 4.
    Enter a name for the API key and click Create.
  2. 5.
    Copy the value of the API key to your clipboard and store it somewhere safe. You won't be able to access the full value of the API Key again after closing the modal.
Authorize your requests by passing an API key in an Authorization header as follows:
"Authorization": "token <YOUR_API_KEY>"
Here's an example request to the /components endpoint:
curl -X GET \
--header "Authorization: token <YOUR_API_KEY>" \
"https://api.dittowords.com/v1/components"

Endpoints

Projects

Only projects that have developer mode enabled have their text accessible via the API.
get
https://api.dittowords.com/v1
/projects
Fetch projects
get
https://api.dittowords.com/v1
/projects/:id
Fetch text by project id
get
https://api.dittowords.com/v1
/projects/:id/components
Fetch component text by project id

Components

get
https://api.dittowords.com/v1
/components
Fetch component text
put
https://api.dittowords.com/v1
/components
Update component text variant
Update component text variant — Payload
The shape that the request body should conform to for the Update component text variant endpoint.
{
"[API ID]": {
"text": "[TEXT OF TEXT ITEM (CAN INCLUDE VARIABLES)]",
"notes": "[NOTES OF TEXT ITEM]", // optional
"tags": [ ... ], // optional: array of strings
"plurals": [ // optional: array of plural objects
{
"text": "[TEXT OF PLURAL FORM]",
"form": "[one|two|zero|few|many|other]"
}
]
}
}

Component Folders

get
https://api.dittowords.com/v1
/component-folders
Fetch component folders
get
https://api.dittowords.com/v1
/component-folders/:api_id/components
Fetch component text by component folder

Variables

get
https://api.dittowords.com/v1
/variables
Fetch variables

Variants

get
https://api.dittowords.com
/variants
Fetch variants