Developers
Set your API contextPick a region and space ID once. Every sample fills in your base URL.
Where do I find these?

In Coevera: open your space's API application and choose Show Access. It shows the space ID and the base URL, whose host starts with your region.

From the API: if you know the space ID, the discovery endpoint GET /api/discovery/spaces/{space_id} returns its region and base URLs, without credentials.

Only the region and space ID are kept, in this browser. Never paste a key or password here.

More in the quickstart

REST APIActivities and communicationTextMessages

TextMessages

TextMessages: list, get, create, update and delete, plus batch operations.

The summaries on this page are generated from the specification; written descriptions come with the next releases of the reference.

MethodPathOperation
GET/entities/TextMessagesList TextMessages
POST/entities/TextMessagesCreate TextMessage
GET/entities/TextMessages/{id}Get TextMessage
PATCH/entities/TextMessages/{id}Update TextMessage
DEL/entities/TextMessages/{id}Delete TextMessage
POST/entities/TextMessages/batch-modifyCreate or update TextMessages in a batch
POST/entities/TextMessages/batch-deleteDelete TextMessages in a batch
POST/entities/TextMessages/batch-restoreRestore deleted TextMessages

GET List TextMessages

Returns the TextMessages the API application can read, one page at a time. In the list envelope, total counts every match and page_info pages through them.

Query parameters

NameTypeDescription
include-deletedbooleanInclude soft-deleted records. Lists only; get-by-id refuses it.
firstintegerPage size. Default 30, maximum 100; a larger value is refused with HTTP 400, code 117.
lastintegerReturn the last N records of the result; together with first, the last N of the first M. Maximum 100.
beforestringCursor from page_info.start_cursor, to page backwards. URL-encode it.
afterstringCursor from page_info.end_cursor of the previous page. URL-encode it: cursors are base64, and a raw + becomes a space.
expandstringRelated records to return inline instead of their URIs, comma-separated; dots reach nested relations, as in account_relations.account.
order-bystringFields to sort by, comma-separated. A leading - sorts descending, as in -modified; dotted paths sort by related fields.
filterobjectfilter[field]=value. Separate several values with a raw comma (OR), as in filter[name]=north,south. Encode a comma that belongs to a value as %2C. URLSearchParams and Python requests encode every comma, so build the filter part of the query string yourself. Dotted paths filter on related records, as in filter[owner.email]. Encode a + in a value as %2B: query values are form-decoded, so a raw + becomes a space.
filter-opobjectfilter-op[field]=operator, one per field: eq (the default), ieq, not-eq, not-ieq, contains, icontains, starts, istarts, ends, iends, gt, gte, lt, lte, between, null, not-null, empty and not-empty. null, not-null, empty and not-empty take no filter value; gt, gte, lt and lte take exactly one.
load-onlystringFields to return, comma-separated (raw or encoded commas both work here); dots select nested fields, as in owner.id. All fields are returned without it. Lists only: get-by-id refuses it with HTTP 400, code 118.

Responses

200 Page of TextMessage records.: success, total, page_info, data 400 Bad request 401 Not authenticated 429 Rate limited 500 Server error

GET /entities/TextMessages
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages?first=10' \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET"
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages?first=10', {
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`)
  }
})
import os

import requests

response = requests.get(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages",
    params={
      "first": "10"
    },
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"])
)

POST Create TextMessage

Creates one record and answers 201 with it.

Query parameters

NameTypeDescription
validation-levelintegerBit mask that relaxes validation on this write. 0 (the default) validates everything. Bits: 2 skip unchanged fields, 4 skip admin-defined validations, 8 allow read-only fields, 16 skip relation checks, 32 skip value checks, 64 skip invalid recalculations, 128 skip step-checklist gates, 256 add conditional field requirements, 512 skip uniqueness checks. Add bits together (20 = 4 + 16); member names and comma lists such as 4,16 work too. A value with an internal-only bit is refused with HTTP 400, code 117.

Request body

The new record's fields. Relations are set by id. Schema createTextMessageInput; the fields are in TextMessage fields. Required: content, direction.

Responses

201 The created TextMessage record.: success, data 400 Bad request 401 Not authenticated 422 Validation failed 429 Rate limited 500 Server error

POST /entities/TextMessages
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages' \
  --request POST \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "Created through the API.",
  "direction": 1
}'
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages', {
  method: 'POST',
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    content: 'Created through the API.',
    direction: 1
  })
})
import os

import requests

response = requests.post(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages",
    headers={
      "Content-Type": "application/json"
    },
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"]),
    json={
      "content": "Created through the API.",
      "direction": 1
    }
)

GET Get TextMessage

Returns one record by id. expand returns related records inline instead of their URIs.

Path parameters

NameTypeDescription
idstring (uuid)Id of the TextMessage record to retrieve. Required

Query parameters

NameTypeDescription
expandstringRelated records to return inline instead of their URIs, comma-separated; dots reach nested relations. The only parameter this call accepts.

Responses

200 The TextMessage record.: success, data 400 Bad request 401 Not authenticated 404 Not found 429 Rate limited 500 Server error

GET /entities/TextMessages/{id}
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001' \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET"
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001', {
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`)
  }
})
import os

import requests

response = requests.get(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001",
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"])
)

PATCH Update TextMessage

Changes the fields you send and leaves the rest as they are; there is no PUT.

Path parameters

NameTypeDescription
idstring (uuid)Id of the TextMessage record to update. Required

Query parameters

NameTypeDescription
validation-levelintegerBit mask that relaxes validation on this write. 0 (the default) validates everything. Bits: 2 skip unchanged fields, 4 skip admin-defined validations, 8 allow read-only fields, 16 skip relation checks, 32 skip value checks, 64 skip invalid recalculations, 128 skip step-checklist gates, 256 add conditional field requirements, 512 skip uniqueness checks. Add bits together (20 = 4 + 16); member names and comma lists such as 4,16 work too. A value with an internal-only bit is refused with HTTP 400, code 117.

Request body

The fields to change. Schema updateTextMessageInput; the fields are in TextMessage fields.

Responses

200 The changed TextMessage record.: success, data 400 Bad request 401 Not authenticated 404 Not found 422 Validation failed 429 Rate limited 500 Server error

PATCH /entities/TextMessages/{id}
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001' \
  --request PATCH \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '{
  "chat_conversation_id": "e5000000-0000-4000-a000-000000000001"
}'
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001', {
  method: 'PATCH',
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    chat_conversation_id: 'e5000000-0000-4000-a000-000000000001'
  })
})
import os

import requests

response = requests.patch(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001",
    headers={
      "Content-Type": "application/json"
    },
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"]),
    json={
      "chat_conversation_id": "e5000000-0000-4000-a000-000000000001"
    }
)

DEL Delete TextMessage

Deletes one record and answers with its id.

Path parameters

NameTypeDescription
idstring (uuid)Id of the TextMessage record to delete. Required

Responses

200 Deletion confirmation.: success, data 400 Bad request 401 Not authenticated 404 Not found 429 Rate limited 500 Server error

DEL /entities/TextMessages/{id}
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001' \
  --request DELETE \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET"
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001', {
  method: 'DELETE',
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`)
  }
})
import os

import requests

response = requests.delete(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/8a000000-0000-4000-a000-000000000001",
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"])
)

POST Create or update TextMessages in a batch

An item with an id updates that record; an item without one creates a record. By default one invalid item fails the whole call with HTTP 422 and nothing is written; with rollback-method=1 the response has an id or an error for each item, in input order.

Query parameters

NameTypeDescription
validation-levelintegerBit mask that relaxes validation on this write. 0 (the default) validates everything. Bits: 2 skip unchanged fields, 4 skip admin-defined validations, 8 allow read-only fields, 16 skip relation checks, 32 skip value checks, 64 skip invalid recalculations, 128 skip step-checklist gates, 256 add conditional field requirements, 512 skip uniqueness checks. Add bits together (20 = 4 + 16); member names and comma lists such as 4,16 work too. A value with an internal-only bit is refused with HTTP 400, code 117.
rollback-methodinteger0, the default: one failed item fails the whole batch (HTTP 422, or 404 for an unknown id) and nothing is written. 1: the valid items are written and the call answers 200 with success false and one result per item, an id or an error, in input order. Check every item.

Request body

A JSON array of records: an item with an id updates, an item without one creates. Schema batchTextMessageInput; the fields are in TextMessage fields. Required: content, direction.

Responses

200 Result per item, in request order: the id of the created or updated record, or the error.: success, data 400 Bad request 401 Not authenticated 422 Validation failed 429 Rate limited 500 Server error

POST /entities/TextMessages/batch-modify
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-modify' \
  --request POST \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "content": "Created through the API.",
    "direction": 1
  },
  {
    "id": "8a000000-0000-4000-a000-000000000001",
    "chat_conversation_id": "e5000000-0000-4000-a000-000000000001"
  }
]'
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-modify', {
  method: 'POST',
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify([
    {
      content: 'Created through the API.',
      direction: 1
    },
    {
      id: '8a000000-0000-4000-a000-000000000001',
      chat_conversation_id: 'e5000000-0000-4000-a000-000000000001'
    }
  ])
})
import os

import requests

response = requests.post(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-modify",
    headers={
      "Content-Type": "application/json"
    },
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"]),
    json=[
      {
        "content": "Created through the API.",
        "direction": 1
      },
      {
        "id": "8a000000-0000-4000-a000-000000000001",
        "chat_conversation_id": "e5000000-0000-4000-a000-000000000001"
      }
    ]
)

POST Delete TextMessages in a batch

Deletes the records whose ids are in the body, a JSON array. By default an unknown id fails the whole call with HTTP 404.

Query parameters

NameTypeDescription
rollback-methodinteger0, the default: one failed item fails the whole batch (HTTP 422, or 404 for an unknown id) and nothing is written. 1: the valid items are written and the call answers 200 with success false and one result per item, an id or an error, in input order. Check every item.

Request body

A JSON array of ids.

Responses

200 Result per id, in request order: the id of the deleted record, or the error.: success, data 400 Bad request 401 Not authenticated 404 Not found 422 Validation failed 429 Rate limited 500 Server error

POST /entities/TextMessages/batch-delete
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-delete' \
  --request POST \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '[
  "8a000000-0000-4000-a000-000000000001",
  "8a000000-0000-4000-a000-000000000002"
]'
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-delete', {
  method: 'POST',
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(['8a000000-0000-4000-a000-000000000001', '8a000000-0000-4000-a000-000000000002'])
})
import os

import requests

response = requests.post(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-delete",
    headers={
      "Content-Type": "application/json"
    },
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"]),
    json=[
      "8a000000-0000-4000-a000-000000000001",
      "8a000000-0000-4000-a000-000000000002"
    ]
)

POST Restore deleted TextMessages

Restores the deleted records whose ids are in the body, a JSON array.

Query parameters

NameTypeDescription
rollback-methodinteger0, the default: one failed item fails the whole batch (HTTP 422, or 404 for an unknown id) and nothing is written. 1: the valid items are written and the call answers 200 with success false and one result per item, an id or an error, in input order. Check every item.

Request body

A JSON array of ids.

Responses

200 Result per id, in request order: the id of the restored record, or the error.: success, data 400 Bad request 401 Not authenticated 404 Not found 422 Validation failed 429 Rate limited 500 Server error

POST /entities/TextMessages/batch-restore
curl 'https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-restore' \
  --request POST \
  --user "$COEVERA_API_KEY:$COEVERA_API_SECRET" \
  --header 'Content-Type: application/json' \
  --data '[
  "8a000000-0000-4000-a000-000000000001",
  "8a000000-0000-4000-a000-000000000002"
]'
fetch('https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-restore', {
  method: 'POST',
  headers: {
    Authorization: "Basic " + btoa(`${process.env.COEVERA_API_KEY}:${process.env.COEVERA_API_SECRET}`),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(['8a000000-0000-4000-a000-000000000001', '8a000000-0000-4000-a000-000000000002'])
})
import os

import requests

response = requests.post(
    "https://{region}.api.coevera.com/api/v100/rest/spaces/{space_id}/entities/TextMessages/batch-restore",
    headers={
      "Content-Type": "application/json"
    },
    auth=(os.environ["COEVERA_API_KEY"], os.environ["COEVERA_API_SECRET"]),
    json=[
      "8a000000-0000-4000-a000-000000000001",
      "8a000000-0000-4000-a000-000000000002"
    ]
)

TextMessage fields

FieldTypeNotes
iduuidRead-only Unique identifier of entity.
contentstringRequired on create Body of the message.
directionintegerRequired on create Direction of the message (Incoming, Outgoing).1 OutgoingEmail · 2 IncomingEmail
chat_conversation_iduuid → ChatConversationsId of the AI assistant chat conversation this message belongs to, when applicable.
datetime_sentdate-timeTimestamp the message was sent.
message_sidstringExternal message identifier from the SMS provider (e.g.
scoreintegerQuality score given to the message by the user (e.g.
statusintegerDelivery status of the message: Sending, Sent, Seen or Failed for outgoing messages, Received for incoming ones.1 Sending · 2 Sent · 3 Failed · 4 Received · 5 Seen
text_message_conversation_iduuid → TextMessageConversationsId of the text message conversation this message belongs to, or empty for AI assistant chat messages.
revisionintegerRevision when entity was lastly changed.
attachmentsarray of uri → CloudObjectRelationsFiles attached to the message (e.g.
is_delete_protectedbooleanRead-only True when the record is protected against deletion because it must always exist in the space.
is_deletedbooleanRead-only Specifies if the entity is considered deleted.
modifieddate-timeRead-only Last modification time.
createddate-timeRead-only Creation time.
Show all 20 fields
FieldTypeNotes
chat_conversationuri → ChatConversationsRead-only AI assistant chat conversation this message belongs to, when applicable.
text_message_conversationuri → TextMessageConversationsRead-only Conversation this message belongs to.
content_as_htmlstringRead-only HTML-rendered version of the message body, ready for display in chat UIs.
databinaryRead-only Structured AI payload of the message (examples or suggestions).
topic_promptsbinaryRead-only List of suggested follow-up prompts produced by the AI for this message.

Custom fields appear in your space's live spec: fetch it with your credentials.

Errors

Every error body has success: false, http_status, code, name and message. Branch on code: the status alone does not tell a missing permission from a bad parameter. All codes: error codes; how to handle them: Errors.

HTTPWhen
400Bad request: a bad or unknown parameter (codes 117, 118), a missing permission (code 50), conflicting data (code 2002) or any other API error. The REST API answers 400 where others answer 403 or 409; check code.
401Not authenticated: missing or wrong credentials, a credential of another space, or an expired token (code 401, ERROR_UNAUTHORIZED).
404No such record or entity (code 143 ERROR_NO_ENTITY, or 2006 ERROR_UNKNOWN_TYPE).
422Validation failed (code 40000, with the failing fields) or a required parameter is missing (code 119). By default one failed item fails a whole batch and nothing is written.
429Too many requests (code 182). Wait for the seconds in Retry-After, then retry.
500Unexpected server error (code 1000, ERROR_UNKNOWN).