Speko Docs
API Reference

Calls

Inspect call detail, events, reports, recordings, and live call transfers.

GET
/v1/calls/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

{
  "id": "string",
  "call_id": "string",
  "resource_uri": "string",
  "agent_id": "string",
  "status": "string",
  "kind": "string",
  "room_name": "string",
  "language": "string",
  "pipeline_config": {},
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "ended_at": "2019-08-24T14:15:22Z",
  "duration_seconds": 0,
  "recording_status": "string",
  "recording_duration_ms": 0,
  "recording_resource_uri": "string",
  "report": {
    "session_id": "string",
    "organization_id": "string",
    "summary": "string",
    "outcome": "string",
    "structured_data": {},
    "transcript": {
      "entries": [
        {
          "id": "string",
          "index": 0,
          "source": "user",
          "text": "string",
          "started_at": "2019-08-24T14:15:22Z",
          "ended_at": "2019-08-24T14:15:22Z",
          "provider": "string",
          "model": "string",
          "metadata": {}
        }
      ]
    },
    "cost_micro_usd": "string",
    "cost_breakdown": [
      {}
    ],
    "metadata": {},
    "scheduled_callback": {},
    "analysis_status": "heuristic",
    "post_call_webhook_status": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "transfers": [
    {
      "id": "string",
      "session_id": "string",
      "organization_id": "string",
      "kind": "blind",
      "status": "requested",
      "transfer_to": "string",
      "from_room_name": "string",
      "consultation_room_name": "string",
      "caller_participant_identity": "string",
      "recipient_participant_identity": "string",
      "outbound_trunk_id": "string",
      "screening_prompt": "string",
      "summary": "string",
      "failure_cause": "string",
      "metadata": {},
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "completed_at": "2019-08-24T14:15:22Z"
    }
  ],
  "transcript": {
    "entries": [
      {
        "id": "string",
        "index": 0,
        "source": "user",
        "text": "string",
        "started_at": "2019-08-24T14:15:22Z",
        "ended_at": "2019-08-24T14:15:22Z",
        "provider": "string",
        "model": "string",
        "metadata": {}
      }
    ]
  },
  "span_tree": {}
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
GET
/v1/calls/{id}/events

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

{
  "events": [
    {
      "id": "string",
      "session_id": "string",
      "organization_id": "string",
      "provider": "string",
      "event_type": "string",
      "status": "string",
      "failure_cause": "string",
      "sip_status_code": 0,
      "sip_status": "string",
      "occurred_at": "2019-08-24T14:15:22Z",
      "payload": {},
      "created_at": "2019-08-24T14:15:22Z"
    }
  ]
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
GET
/v1/calls/{id}/report

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

{
  "session_id": "string",
  "organization_id": "string",
  "summary": "string",
  "outcome": "string",
  "structured_data": {},
  "transcript": {
    "entries": [
      {
        "id": "string",
        "index": 0,
        "source": "user",
        "text": "string",
        "started_at": "2019-08-24T14:15:22Z",
        "ended_at": "2019-08-24T14:15:22Z",
        "provider": "string",
        "model": "string",
        "metadata": {}
      }
    ]
  },
  "cost_micro_usd": "string",
  "cost_breakdown": [
    {}
  ],
  "metadata": {},
  "scheduled_callback": {},
  "analysis_status": "heuristic",
  "post_call_webhook_status": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/calls/{id}/report/finalize

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

{
  "session_id": "string",
  "summary": "string",
  "outcome": "string",
  "cost_micro_usd": "string",
  "webhook": {}
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
GET
/v1/calls/{id}/recording

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

{
  "url": "http://example.com"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/calls/{id}/transfers/blind

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

{
  "id": "string",
  "session_id": "string",
  "organization_id": "string",
  "kind": "blind",
  "status": "requested",
  "transfer_to": "string",
  "from_room_name": "string",
  "consultation_room_name": "string",
  "caller_participant_identity": "string",
  "recipient_participant_identity": "string",
  "outbound_trunk_id": "string",
  "screening_prompt": "string",
  "summary": "string",
  "failure_cause": "string",
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/calls/{id}/transfers/warm

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

{
  "id": "string",
  "session_id": "string",
  "organization_id": "string",
  "kind": "blind",
  "status": "requested",
  "transfer_to": "string",
  "from_room_name": "string",
  "consultation_room_name": "string",
  "caller_participant_identity": "string",
  "recipient_participant_identity": "string",
  "outbound_trunk_id": "string",
  "screening_prompt": "string",
  "summary": "string",
  "failure_cause": "string",
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "routing_attempts": [
    {
      "id": "string",
      "session_id": "string",
      "organization_id": "string",
      "kind": "blind",
      "status": "requested",
      "transfer_to": "string",
      "from_room_name": "string",
      "consultation_room_name": "string",
      "caller_participant_identity": "string",
      "recipient_participant_identity": "string",
      "outbound_trunk_id": "string",
      "screening_prompt": "string",
      "summary": "string",
      "failure_cause": "string",
      "metadata": {},
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "completed_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_transfer": {
    "id": "string",
    "session_id": "string",
    "organization_id": "string",
    "kind": "blind",
    "status": "requested",
    "transfer_to": "string",
    "from_room_name": "string",
    "consultation_room_name": "string",
    "caller_participant_identity": "string",
    "recipient_participant_identity": "string",
    "outbound_trunk_id": "string",
    "screening_prompt": "string",
    "summary": "string",
    "failure_cause": "string",
    "metadata": {},
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "completed_at": "2019-08-24T14:15:22Z"
  },
  "fallback": {}
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/calls/{id}/transfers/{transferId}/complete

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

transferId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

{
  "id": "string",
  "session_id": "string",
  "organization_id": "string",
  "kind": "blind",
  "status": "requested",
  "transfer_to": "string",
  "from_room_name": "string",
  "consultation_room_name": "string",
  "caller_participant_identity": "string",
  "recipient_participant_identity": "string",
  "outbound_trunk_id": "string",
  "screening_prompt": "string",
  "summary": "string",
  "failure_cause": "string",
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/calls/{id}/transfers/{transferId}/cancel

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

transferId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

{
  "id": "string",
  "session_id": "string",
  "organization_id": "string",
  "kind": "blind",
  "status": "requested",
  "transfer_to": "string",
  "from_room_name": "string",
  "consultation_room_name": "string",
  "caller_participant_identity": "string",
  "recipient_participant_identity": "string",
  "outbound_trunk_id": "string",
  "screening_prompt": "string",
  "summary": "string",
  "failure_cause": "string",
  "metadata": {},
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "routing_attempts": [
    {
      "id": "string",
      "session_id": "string",
      "organization_id": "string",
      "kind": "blind",
      "status": "requested",
      "transfer_to": "string",
      "from_room_name": "string",
      "consultation_room_name": "string",
      "caller_participant_identity": "string",
      "recipient_participant_identity": "string",
      "outbound_trunk_id": "string",
      "screening_prompt": "string",
      "summary": "string",
      "failure_cause": "string",
      "metadata": {},
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "completed_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_transfer": {
    "id": "string",
    "session_id": "string",
    "organization_id": "string",
    "kind": "blind",
    "status": "requested",
    "transfer_to": "string",
    "from_room_name": "string",
    "consultation_room_name": "string",
    "caller_participant_identity": "string",
    "recipient_participant_identity": "string",
    "outbound_trunk_id": "string",
    "screening_prompt": "string",
    "summary": "string",
    "failure_cause": "string",
    "metadata": {},
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "completed_at": "2019-08-24T14:15:22Z"
  },
  "fallback": {}
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}