Automation definitions
Create, validate and update automation definitions.
GET
/v1/automations/definitions/Get automation definitionsPOST/v1/automations/definitions/Create automation definitionsGET/v1/automations/definitions/assets/Get automation assetsGET/v1/automations/definitions/capabilities/Get automation capabilitiesPOST/v1/automations/definitions/validate/Validate automation definitionGET/v1/automations/definitions/{automation_id}/Get automation definitionPUT/v1/automations/definitions/{automation_id}/Set automation definitionGet automation definitions
GET
automations:write/v1/automations/definitions/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
after_id | query | integer | min 0 |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
automations | object[] | read-only |
automations[].id | integer | read-only |
automations[].is_active | boolean | read-only |
automations[].name | string | read-only |
next_after_id | integer | null | read-only |
Responses
200Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/automations/definitions/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Create automation definitions
POST
automations:writeIdempotency-Key required/v1/automations/definitions/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
documentrequired | object | Canonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits. |
document.channel | string | null | — |
document.entry | string | null | — |
document.id | integer | null | — |
document.is_active | boolean | — |
document.layout | object | — |
document.namerequired | string | — |
document.nodesrequired | object[] | — |
document.public_replies | object[] | — |
document.schema_version | integer | — |
document.settings | object | — |
document.triggersrequired | object[] | — |
Response fields (201)
| Field | Type | Notes |
|---|---|---|
automation_id | integer | read-only |
document | object | Canonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits. |
document.channel | string | null | — |
document.entry | string | null | — |
document.id | integer | null | — |
document.is_active | boolean | — |
document.layout | object | — |
document.namerequired | string | — |
document.nodesrequired | object[] | — |
document.public_replies | object[] | — |
document.schema_version | integer | — |
document.settings | object | — |
document.triggersrequired | object[] | — |
editor_url | string | read-only |
etag | string | read-only |
flow_preview | object[] | read-only |
flow_preview[].description | string | read-only |
flow_preview[].title | string | read-only |
revision | integer | read-only |
Responses
201Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.409The write conflicts with current state or an identical request is still running.422The write contains fields outside its closed input schema.429The request-rate budget is exhausted.
Example request
curl
curl -X POST "https://api.themochi.app/v1/automations/definitions/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"document":{"name":"string","nodes":[{}],"triggers":[{}]}}'Get automation assets
GET
automations:write/v1/automations/definitions/assets/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
query | query | string | max length 255 |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
links | object[] | read-only |
links[].name | string | read-only |
links[].url | string | read-only |
media | object[] | read-only |
media[].file_id | string | read-only |
media[].media_kind | string | read-only |
media[].name | string | read-only |
Responses
200Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/automations/definitions/assets/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Get automation capabilities
GET
automations:write/v1/automations/definitions/capabilities/Response fields (200)
| Field | Type | Notes |
|---|---|---|
ask | boolean | read-only |
audio | boolean | read-only |
branching | boolean | read-only |
drafts | boolean | read-only |
follow_ups | boolean | read-only |
format | string | read-only |
messenger | boolean | read-only |
new_triggers | boolean | read-only |
whatsapp | boolean | read-only |
Responses
200Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/automations/definitions/capabilities/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Validate automation definition
POST
automations:writeIdempotency-Key required/v1/automations/definitions/validate/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
automation_id | integer | — |
documentrequired | object | Canonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits. |
document.channel | string | null | — |
document.entry | string | null | — |
document.id | integer | null | — |
document.is_active | boolean | — |
document.layout | object | — |
document.namerequired | string | — |
document.nodesrequired | object[] | — |
document.public_replies | object[] | — |
document.schema_version | integer | — |
document.settings | object | — |
document.triggersrequired | object[] | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
valid | boolean | read-only |
Responses
200Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.409The write conflicts with current state or an identical request is still running.422The write contains fields outside its closed input schema.429The request-rate budget is exhausted.
Example request
curl
curl -X POST "https://api.themochi.app/v1/automations/definitions/validate/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"document":{"name":"string","nodes":[{}],"triggers":[{}]}}'Get automation definition
GET
automations:write/v1/automations/definitions/{automation_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
automation_idrequired | path | integer | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
automation_id | integer | read-only |
document | object | Canonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits. |
document.channel | string | null | — |
document.entry | string | null | — |
document.id | integer | null | — |
document.is_active | boolean | — |
document.layout | object | — |
document.namerequired | string | — |
document.nodesrequired | object[] | — |
document.public_replies | object[] | — |
document.schema_version | integer | — |
document.settings | object | — |
document.triggersrequired | object[] | — |
editor_url | string | read-only |
etag | string | read-only |
flow_preview | object[] | read-only |
flow_preview[].description | string | read-only |
flow_preview[].title | string | read-only |
revision | integer | read-only |
Responses
200Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/automations/definitions/<automation_id>/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Set automation definition
PUT
automations:writeIdempotency-Key required/v1/automations/definitions/{automation_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
automation_idrequired | path | integer | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
documentrequired | object | Canonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits. |
document.channel | string | null | — |
document.entry | string | null | — |
document.id | integer | null | — |
document.is_active | boolean | — |
document.layout | object | — |
document.namerequired | string | — |
document.nodesrequired | object[] | — |
document.public_replies | object[] | — |
document.schema_version | integer | — |
document.settings | object | — |
document.triggersrequired | object[] | — |
etagrequired | string | max length 64 |
revisionrequired | integer | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
automation_id | integer | read-only |
document | object | Canonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits. |
document.channel | string | null | — |
document.entry | string | null | — |
document.id | integer | null | — |
document.is_active | boolean | — |
document.layout | object | — |
document.namerequired | string | — |
document.nodesrequired | object[] | — |
document.public_replies | object[] | — |
document.schema_version | integer | — |
document.settings | object | — |
document.triggersrequired | object[] | — |
editor_url | string | read-only |
etag | string | read-only |
flow_preview | object[] | read-only |
flow_preview[].description | string | read-only |
flow_preview[].title | string | read-only |
revision | integer | read-only |
Responses
200Success400The request is invalid.401Authentication is missing, invalid, or revoked.403The authenticated identity lacks the required scope or capability.404The resource is unavailable or not visible to this organization.409The write conflicts with current state or an identical request is still running.422The write contains fields outside its closed input schema.429The request-rate budget is exhausted.
Example request
curl
curl -X PUT "https://api.themochi.app/v1/automations/definitions/<automation_id>/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"document":{"name":"string","nodes":[{}],"triggers":[{}]},"etag":"string","revision":1}'