POST
/
v1
/
chat
Create a chat
curl --request POST \
  --url https://api.roark.ai/v1/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "startTimestamp": "2024-01-15T10:00:00Z",
  "endTimestamp": "2024-01-15T10:30:00Z",
  "properties": {
    "source": "web",
    "region": "US",
    "sessionId": "abc123"
  },
  "segments": [
    {
      "startTimestamp": "<string>",
      "endTimestamp": "<string>",
      "type": "<string>",
      "text": "<string>",
      "languageCode": "<string>",
      "participant": {
        "role": "AGENT",
        "phoneNumber": "<string>",
        "name": "<string>"
      }
    }
  ]
}'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "projectId": "660e8400-e29b-41d4-a716-446655440001",
    "organizationId": "770e8400-e29b-41d4-a716-446655440002",
    "title": "Account assistance request",
    "summary": "Customer inquired about account balance and recent transactions",
    "startTimestamp": "2024-01-15T10:00:00Z",
    "endTimestamp": "2024-01-15T10:30:00Z",
    "durationMs": 1800000,
    "createdAt": "2024-01-15T10:31:00Z",
    "updatedAt": "2024-01-15T10:31:00Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for creating a new chat conversation with segments

startTimestamp
string
required

Timestamp when the chat started

Example:

"2024-01-15T10:00:00Z"

endTimestamp
string
required

Timestamp when the chat ended

Example:

"2024-01-15T10:30:00Z"

segments
object[]
required

Array of chat segments including text messages and tool invocations with required timestamps

properties
object

Custom properties for storing additional metadata about the chat

Example:
{
"source": "web",
"region": "US",
"sessionId": "abc123"
}

Response

Chat created successfully

data
object
required

Response containing the created chat information