Skip to main content
POST
Create a Chat Message

Authorizations

Authorization
string
header
required

A static Affinity API key, presented as a bearer token.

Body

application/json

Request body for creating a chat message.

sentAt
string<date-time>
required

The timestamp of when the chat message was sent. Must not be in the future.

Example:

"2023-01-01T00:00:00Z"

direction
enum<string>
required

The direction of the chat message.

Available options:
sent,
received
Example:

"sent"

participants
PersonReference · object[]
required

The people who took part in the chat message. Each item references a Person by id.

Required array length: 2 - 100 elements
Example:

Response

Created

id
integer<int64>
required

The chat message's unique identifier

Required range: 1 <= x <= 9007199254740991
Example:

1

sentAt
string<date-time>
required

The timestamp of when the chat message was sent

Example:

"2023-01-01T00:00:00Z"

loggingType
string
required

Indicates how the interaction was added to Affinity: either manually by a user ('manual') or automatically through Affinity's capture process ('automated'). Currently, chat messages can only be logged as 'manual'.

Allowed value: "manual"
Example:

"manual"

direction
enum<string>
required

The direction of the chat message

Available options:
sent,
received
Example:

"sent"

creator
PersonData · object
required

The creator of the chat message

createdAt
string<date-time>
required

The timestamp of when the chat message was created

Example:

"2022-01-01T00:00:00Z"

updatedAt
string<date-time> | null
required

The timestamp of when the chat message was updated

Example:

"2023-01-01T00:00:00Z"

participantsPreview
PersonDataPreview · object
required

A preview of the participants who are in the chat message