Text Message

TextMessages.batch_create_or_update

Creates or updates TextMessage records in one request: an item with an id updates that record, an item without one creates a new record.

post/entities/TextMessages/batch-modify

Request

Query parameters

validation-levelinteger

Bit 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-method0 | 1

0, 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

chat_conversation_idstring uuid

Id of the AI assistant chat conversation this message belongs to, when applicable.

contentstring

Body of the message. May be plain text or a JSON payload (e.g. AI assistant examples / suggestions).

datetime_sentstring date-time

Timestamp the message was sent.

direction1 | 2

Direction of the message (Incoming, Outgoing).

Integer enum value: 1 - OutgoingEmail, 2 - IncomingEmail

message_sidstring

External message identifier from the SMS provider (e.g. Twilio Message SID).

scoreinteger

Quality score given to the message by the user (e.g. for AI-suggested replies). Used to feed back into the suggestion engine.

status1 | 2 | 3 | 4 | 5

Delivery status of the message: Sending, Sent, Seen or Failed for outgoing messages, Received for incoming ones.

Integer enum value: 1 - Sending, 2 - Sent, 3 - Failed, 4 - Received, 5 - Seen

text_message_conversation_idstring uuid

Id of the text message conversation this message belongs to, or empty for AI assistant chat messages.

revisioninteger

Revision when entity was lastly changed.

idstring uuid

ID of object to update.

Example request

[
  {
    "chat_conversation_id": "01234567-abcd-dcba-ffff-000000000000",
    "content": "string",
    "datetime_sent": "2019-01-01T00:00:00",
    "direction": 1,
    "message_sid": "string",
    "score": 1,
    "status": 1,
    "text_message_conversation_id": "01234567-abcd-dcba-ffff-000000000000",
    "revision": 1
  }
]

Response

Result per item, in request order: the id of the created or updated record, or the error.

successboolean

True when the request succeeded; false on error.

Example response

{
  "success": true,
  "data": [
    {
      "http_status": 400,
      "code": 117,
      "name": "ERROR_PARAMETER_INVALID"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.