API referenceConversations

Import a finished transcript

POST
/conversations/import

Creates a conversation, in the environment of the API key, from a whole transcript and runs it through the same gate as a live one, on the transcript's own clock, settle windows and all. It answers at once with the conversation processing; its moments arrive on the stream and the webhooks as they are let go, progress counts the turns read, and the conversation ends by itself, conversation.ended last.

Authorization

apiKey
X-API-Key<token>

API key (prefix spk_test_ or spk_live_) or personal access token (prefix pat_)

In: header

Header Parameters

Idempotency-Key*string

Idempotency key that prevents processing a request twice. Use a unique UUID v4 per request.

Lengthlength <= 255

Request Body

application/json

metadata?

Your own data, returned as sent; up to 16 KB as JSON

moment_types?array<string>

The moment types to detect; absent or empty detects every type

title?string

A label for the conversation log

Lengthlength <= 200
turns*array<>

The whole transcript, up to 5,000 turns in any order, times in seconds from its start. Only final turns are read.

Itemsitems <= 5000
webhook_url?string

An https URL that receives this conversation's events, signed with a secret shown once in the response. http is accepted for localhost only.

Lengthlength <= 2048

Response Body

application/json

application/json

curl -X POST "https://example.com/conversations/import" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "turns": [      {        "channel": "mic",        "end": 0.1,        "final": true,        "id": "string",        "speaker": "string",        "start": 0.1,        "text": "string"      }    ]  }'
{  "conversation": {    "created_at": "2019-08-24T14:15:22Z",    "ended_at": "2019-08-24T14:15:22Z",    "environment": "test",    "id": "cnv_2jxsy8cc8v0348asy6t1",    "metadata": {      "property1": null,      "property2": null    },    "moment_types": [      "string"    ],    "moments_count": 0,    "organization_id": "string",    "origin": "api",    "progress": {      "turns_done": 0,      "turns_total": 0    },    "started_at": "2019-08-24T14:15:22Z",    "status": "live",    "tenant_id": "string",    "title": "string",    "updated_at": "2019-08-24T14:15:22Z",    "usage": {      "metered_seconds": 126,      "transcription_seconds": 30.5    },    "webhook": {      "id": "whs_2jxsy8cc8v0348asy6t1",      "url": "string"    }  },  "webhook": {    "id": "whs_2jxsy8cc8v0348asy6t1",    "secret": "string",    "url": "string"  }}