API referenceConversations

End a conversation

POST
/conversations/{id}/end

Stops the conversation taking turns and lets every pending moment go after the turns already sent. Those moments arrive on the stream and the webhooks within seconds.

Authorization

apiKey
X-API-Key<token>

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

In: header

Path Parameters

id*string

Conversation ID

Header Parameters

Idempotency-Key*string

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

Lengthlength <= 255

Response Body

application/json

application/json

curl -X POST "https://example.com/conversations/cnv_2jxsy8cc8v0348asy6t1/end" \  -H "Idempotency-Key: string"
{  "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"  }}