Skip to documentation
Customers & messagingChat templates

Chat templates

Methods, permissions, request fields and response schemas for chat templates.

Read and search

Retrieve current records, history and status.

List chat automation templatesSearch and paginate chat templates records accessible to your organization.GET/auth/chat-auto-messages
Token scope chat:readActor permission managerAction type read

Pagination: Default 50, maximum 100. Follow nextCursor with the same search, tenant and resource until null. Creation cutoff excludes later inserts; mutable fields may change between pages. Unsupported search returns 400.

Query parameters

FieldTypeDescription and constraints
limitOptionalintegerMinimum 1 · Maximum 100 · Default: 50
cursorOptionalstringAt least 1 characters · At most 768 characters
searchOptionalstringAt least 0 characters · At most 200 characters
Explore this request

Edit example fields and validate the request against its schema.

What you receive

{data: bounded chat-templates summaries[], nextCursor: string | null}. Fetch detail endpoints for full records.

Request example · cURL

Replace example IDs and values. Supply the token from your secret store. Each intended write uses one stable $ACTION_KEY.

curl -X GET "$BASE/auth/chat-auto-messages?limit=50" \
  -H "Authorization: Bearer $ALLPROFILES_API_TOKEN"
Success response schema · HTTP 200
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "organizationId": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "eventKind": {
                "type": "string"
              },
              "body": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean"
              },
              "createdById": {
                "type": "string",
                "format": "uuid"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "organizationId",
              "name",
              "eventKind",
              "body",
              "enabled",
              "createdById",
              "createdAt",
              "updatedAt"
            ],
            "additionalProperties": false
          },
          "maxItems": 100,
          "minItems": 0
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 768
        }
      },
      "required": [
        "data",
        "nextCursor"
      ],
      "additionalProperties": false
    }
  }
}
Errors and recovery
400
Invalid JSON, request fields, query, path identifier or missing Idempotency-Key.
401
Missing, invalid, revoked or expired organization API token; its issuing actor must still be the current organization owner.
403
Token scope or actor capability denied, disabled/banned account, or action unavailable.
404
Unknown route or resource not accessible in the bound organization. Cross-tenant resources are not enumerated.
409
Conflicting profile/rental state, duplicate resource, idempotency payload mismatch or operation still in progress.
410
event_cursor_expired: the event cursor is behind retained history. Reconcile current resources and start from the supplied recovery cursor.
422
Business validation/moderation rejected the operation. CHAT_MESSAGE_BLOCKED was not delivered.
429
API rate/concurrency limit exceeded; use backoff and Retry-After when present.
500
Internal operation error. Sensitive implementation details are not returned. Investigate using the request ID before repeating a write.
503
Provider or configuration unavailable; uncertain writes must retain the same Idempotency-Key.

These are documented API errors. The local sandbox checks schema fields only and does not test authorization, moderation or provider behavior.

Financial fields named ...Cents or ...InCents use integer cents. Path fields and nested constraints are shown above and in the downloadable OpenAPI contract.

Create and import

Add records, prepare imports or start a new setup.

Create a chat automation templateCreated template. Enabled templates can send messages when a rental begins.POST/auth/chat-auto-messages
Token scope chat:writeActor permission managerAction type write

Send Idempotency-Key. Retry the same intended action with the same key and exact payload to retrieve its saved result.

Request body

FieldTypeDescription and constraints
nameRequiredstringAt least 1 characters · At most 80 characters
eventKindRequiredstringOne of: "rental_started"
bodyRequiredstringAt least 1 characters · At most 4000 characters
enabledOptionalboolean
Explore this request

Edit example fields and validate the request against its schema.

What you receive

Created template. Enabled templates can send messages when a rental begins.

Request example · cURL

Replace example IDs and values. Supply the token from your secret store. Each intended write uses one stable $ACTION_KEY.

curl -X POST "$BASE/auth/chat-auto-messages" \
  -H "Authorization: Bearer $ALLPROFILES_API_TOKEN" \
  -H "Idempotency-Key: $ACTION_KEY" \
  -H "Content-Type: application/json" \
  --data '{"name":"example","eventKind":"rental_started","body":"Reviewed content"}'
Full JSON request schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "eventKind": {
      "type": "string",
      "enum": [
        "rental_started"
      ]
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "required": [
    "name",
    "eventKind",
    "body"
  ],
  "additionalProperties": false
}
Success response schema · HTTP 201
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "organizationId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string",
          "minLength": 0,
          "maxLength": 5000
        },
        "eventKind": {
          "type": "string",
          "enum": [
            "rental_started"
          ]
        },
        "body": {
          "type": "string",
          "minLength": 0,
          "maxLength": 4000
        },
        "enabled": {
          "type": "boolean"
        },
        "createdById": {
          "type": "string",
          "format": "uuid"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "organizationId",
        "name",
        "eventKind",
        "body",
        "enabled",
        "createdById",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": true
    }
  }
}
Errors and recovery
400
Invalid JSON, request fields, query, path identifier or missing Idempotency-Key.
401
Missing, invalid, revoked or expired organization API token; its issuing actor must still be the current organization owner.
403
Token scope or actor capability denied, disabled/banned account, or action unavailable.
404
Unknown route or resource not accessible in the bound organization. Cross-tenant resources are not enumerated.
409
Conflicting profile/rental state, duplicate resource, idempotency payload mismatch or operation still in progress.
410
event_cursor_expired: the event cursor is behind retained history. Reconcile current resources and start from the supplied recovery cursor.
422
Business validation/moderation rejected the operation. CHAT_MESSAGE_BLOCKED was not delivered.
429
API rate/concurrency limit exceeded; use backoff and Retry-After when present.
500
Internal operation error. Sensitive implementation details are not returned. Investigate using the request ID before repeating a write.
503
Provider or configuration unavailable; uncertain writes must retain the same Idempotency-Key.

These are documented API errors. The local sandbox checks schema fields only and does not test authorization, moderation or provider behavior.

Financial fields named ...Cents or ...InCents use integer cents. Path fields and nested constraints are shown above and in the downloadable OpenAPI contract.

Update and configure

Change existing records, assignments and configuration.

Edit a chat automation templateUpdated template.PATCH/auth/chat-auto-messages/:id
Token scope chat:writeActor permission managerAction type write

Send Idempotency-Key. Retry the same intended action with the same key and exact payload to retrieve its saved result.

Path parameters

FieldTypeDescription and constraints
idRequiredstring · uuid

Resource UUID scoped to the current organization.

Request body

FieldTypeDescription and constraints
nameOptionalstringAt least 1 characters · At most 80 characters
eventKindOptionalstringOne of: "rental_started"
bodyOptionalstringAt least 1 characters · At most 4000 characters
enabledOptionalboolean
Explore this request

Edit example fields and validate the request against its schema.

What you receive

Updated template.

Request example · cURL

Replace example IDs and values. Supply the token from your secret store. Each intended write uses one stable $ACTION_KEY.

curl -X PATCH "$BASE/auth/chat-auto-messages/$ID" \
  -H "Authorization: Bearer $ALLPROFILES_API_TOKEN" \
  -H "Idempotency-Key: $ACTION_KEY" \
  -H "Content-Type: application/json" \
  --data '{}'
Full JSON request schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "eventKind": {
      "type": "string",
      "enum": [
        "rental_started"
      ]
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "required": [],
  "additionalProperties": false
}
Success response schema · HTTP 200
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "organizationId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string",
          "minLength": 0,
          "maxLength": 5000
        },
        "eventKind": {
          "type": "string",
          "enum": [
            "rental_started"
          ]
        },
        "body": {
          "type": "string",
          "minLength": 0,
          "maxLength": 4000
        },
        "enabled": {
          "type": "boolean"
        },
        "createdById": {
          "type": "string",
          "format": "uuid"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "organizationId",
        "name",
        "eventKind",
        "body",
        "enabled",
        "createdById",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": true
    }
  }
}
Errors and recovery
400
Invalid JSON, request fields, query, path identifier or missing Idempotency-Key.
401
Missing, invalid, revoked or expired organization API token; its issuing actor must still be the current organization owner.
403
Token scope or actor capability denied, disabled/banned account, or action unavailable.
404
Unknown route or resource not accessible in the bound organization. Cross-tenant resources are not enumerated.
409
Conflicting profile/rental state, duplicate resource, idempotency payload mismatch or operation still in progress.
410
event_cursor_expired: the event cursor is behind retained history. Reconcile current resources and start from the supplied recovery cursor.
422
Business validation/moderation rejected the operation. CHAT_MESSAGE_BLOCKED was not delivered.
429
API rate/concurrency limit exceeded; use backoff and Retry-After when present.
500
Internal operation error. Sensitive implementation details are not returned. Investigate using the request ID before repeating a write.
503
Provider or configuration unavailable; uncertain writes must retain the same Idempotency-Key.

These are documented API errors. The local sandbox checks schema fields only and does not test authorization, moderation or provider behavior.

Financial fields named ...Cents or ...InCents use integer cents. Path fields and nested constraints are shown above and in the downloadable OpenAPI contract.

Remove and disconnect

Remove a record, revoke access or end a connection.

Delete a chat automation templateTemplate deletion result.DELETE/auth/chat-auto-messages/:id
Token scope chat:writeActor permission managerAction type destructive

Send Idempotency-Key. Retry the same intended action with the same key and exact payload to retrieve its saved result.

Path parameters

FieldTypeDescription and constraints
idRequiredstring · uuid

Resource UUID scoped to the current organization.

Explore this request

Edit example fields and validate the request against its schema.

What you receive

Template deletion result.

Request example · cURL

Replace example IDs and values. Supply the token from your secret store. Each intended write uses one stable $ACTION_KEY.

curl -X DELETE "$BASE/auth/chat-auto-messages/$ID" \
  -H "Authorization: Bearer $ALLPROFILES_API_TOKEN" \
  -H "Idempotency-Key: $ACTION_KEY"
Success response schema · HTTP 200
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "minLength": 0,
          "maxLength": 5000
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": true
    }
  }
}
Errors and recovery
400
Invalid JSON, request fields, query, path identifier or missing Idempotency-Key.
401
Missing, invalid, revoked or expired organization API token; its issuing actor must still be the current organization owner.
403
Token scope or actor capability denied, disabled/banned account, or action unavailable.
404
Unknown route or resource not accessible in the bound organization. Cross-tenant resources are not enumerated.
409
Conflicting profile/rental state, duplicate resource, idempotency payload mismatch or operation still in progress.
410
event_cursor_expired: the event cursor is behind retained history. Reconcile current resources and start from the supplied recovery cursor.
422
Business validation/moderation rejected the operation. CHAT_MESSAGE_BLOCKED was not delivered.
429
API rate/concurrency limit exceeded; use backoff and Retry-After when present.
500
Internal operation error. Sensitive implementation details are not returned. Investigate using the request ID before repeating a write.
503
Provider or configuration unavailable; uncertain writes must retain the same Idempotency-Key.

These are documented API errors. The local sandbox checks schema fields only and does not test authorization, moderation or provider behavior.

Financial fields named ...Cents or ...InCents use integer cents. Path fields and nested constraints are shown above and in the downloadable OpenAPI contract.