Skip to content

Automation definitions

Create, validate and update automation definitions.

Get automation definitions

GET/v1/automations/definitions/
automations:write

Parameters

NameInTypeNotes
after_idqueryintegermin 0
Response fields (200)
FieldTypeNotes
automationsobject[]read-only
automations[].idintegerread-only
automations[].is_activebooleanread-only
automations[].namestringread-only
next_after_idinteger | nullread-only

Responses

  • 200Success
  • 400The 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/v1/automations/definitions/
automations:writeIdempotency-Key required

Parameters

NameInTypeNotes
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Request body

FieldTypeNotes
documentrequiredobjectCanonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits.
document.channelstring | null—
document.entrystring | null—
document.idinteger | null—
document.is_activeboolean—
document.layoutobject—
document.namerequiredstring—
document.nodesrequiredobject[]—
document.public_repliesobject[]—
document.schema_versioninteger—
document.settingsobject—
document.triggersrequiredobject[]—
Response fields (201)
FieldTypeNotes
automation_idintegerread-only
documentobjectCanonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits.
document.channelstring | null—
document.entrystring | null—
document.idinteger | null—
document.is_activeboolean—
document.layoutobject—
document.namerequiredstring—
document.nodesrequiredobject[]—
document.public_repliesobject[]—
document.schema_versioninteger—
document.settingsobject—
document.triggersrequiredobject[]—
editor_urlstringread-only
etagstringread-only
flow_previewobject[]read-only
flow_preview[].descriptionstringread-only
flow_preview[].titlestringread-only
revisionintegerread-only

Responses

  • 201Success
  • 400The 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/v1/automations/definitions/assets/
automations:write

Parameters

NameInTypeNotes
queryquerystringmax length 255
Response fields (200)
FieldTypeNotes
linksobject[]read-only
links[].namestringread-only
links[].urlstringread-only
mediaobject[]read-only
media[].file_idstringread-only
media[].media_kindstringread-only
media[].namestringread-only

Responses

  • 200Success
  • 400The 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/v1/automations/definitions/capabilities/
automations:write
Response fields (200)
FieldTypeNotes
askbooleanread-only
audiobooleanread-only
branchingbooleanread-only
draftsbooleanread-only
follow_upsbooleanread-only
formatstringread-only
messengerbooleanread-only
new_triggersbooleanread-only
whatsappbooleanread-only

Responses

  • 200Success
  • 400The 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/v1/automations/definitions/validate/
automations:writeIdempotency-Key required

Parameters

NameInTypeNotes
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Request body

FieldTypeNotes
automation_idinteger—
documentrequiredobjectCanonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits.
document.channelstring | null—
document.entrystring | null—
document.idinteger | null—
document.is_activeboolean—
document.layoutobject—
document.namerequiredstring—
document.nodesrequiredobject[]—
document.public_repliesobject[]—
document.schema_versioninteger—
document.settingsobject—
document.triggersrequiredobject[]—
Response fields (200)
FieldTypeNotes
validbooleanread-only

Responses

  • 200Success
  • 400The 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/v1/automations/definitions/{automation_id}/
automations:write

Parameters

NameInTypeNotes
automation_idrequiredpathinteger—
Response fields (200)
FieldTypeNotes
automation_idintegerread-only
documentobjectCanonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits.
document.channelstring | null—
document.entrystring | null—
document.idinteger | null—
document.is_activeboolean—
document.layoutobject—
document.namerequiredstring—
document.nodesrequiredobject[]—
document.public_repliesobject[]—
document.schema_versioninteger—
document.settingsobject—
document.triggersrequiredobject[]—
editor_urlstringread-only
etagstringread-only
flow_previewobject[]read-only
flow_preview[].descriptionstringread-only
flow_preview[].titlestringread-only
revisionintegerread-only

Responses

  • 200Success
  • 400The 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/v1/automations/definitions/{automation_id}/
automations:writeIdempotency-Key required

Parameters

NameInTypeNotes
automation_idrequiredpathinteger—
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Request body

FieldTypeNotes
documentrequiredobjectCanonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits.
document.channelstring | null—
document.entrystring | null—
document.idinteger | null—
document.is_activeboolean—
document.layoutobject—
document.namerequiredstring—
document.nodesrequiredobject[]—
document.public_repliesobject[]—
document.schema_versioninteger—
document.settingsobject—
document.triggersrequiredobject[]—
etagrequiredstringmax length 64
revisionrequiredinteger—
Response fields (200)
FieldTypeNotes
automation_idintegerread-only
documentobjectCanonical automation graph. Read the workspace capabilities endpoint for the enabled node types, fields and limits.
document.channelstring | null—
document.entrystring | null—
document.idinteger | null—
document.is_activeboolean—
document.layoutobject—
document.namerequiredstring—
document.nodesrequiredobject[]—
document.public_repliesobject[]—
document.schema_versioninteger—
document.settingsobject—
document.triggersrequiredobject[]—
editor_urlstringread-only
etagstringread-only
flow_previewobject[]read-only
flow_preview[].descriptionstringread-only
flow_preview[].titlestringread-only
revisionintegerread-only

Responses

  • 200Success
  • 400The 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}'