Call/SMS API

This OpenAPI specification provides endpoints for managing and interacting with outbound calls in Taalk. Below is a summary of each endpoint:

  1. /call - POST

    • Purpose: Initiates an outbound call to a specified client, with options to specify an agent, campaign, retry methods, and additional parameters.
    • Parameters:
    • datasource: Common parameter reference.
    • Request Body:
    • Required: name (client name), phone (client phone number).
    • Optional:
    • from: Caller ID in strict +1XXXXXXXXXX format.
    • agent: Persona ID from the Persona URL.
    • campaign: Campaign ID, adding the contact to the campaign if specified.
    • retryMethod: Retry settings (0 for no retry, 1 for retry without voicemail repeat, 2 for retry with voicemail repeat).
    • params: Additional fields referenced in the persona script.
    • Responses:
    • 200: The call is accepted, returns session ID in the payload.
    • 202: If contact already exists in the campaign, it is updated without initiating an instant call.

  2. /calls/{id} - GET

    • Purpose: Retrieves information about a specific call, including status, transcript, and summary.
    • Parameters:
    • datasource: Common parameter reference.
    • id: Required call ID.
    • Response:
    • 200: Returns call details:
    • _id: Session ID.
    • status: Call status.
    • amd: Indicates if answered by a machine.
    • createdAt: Call date.
    • messages: Array of transcript messages.
    • summary: Summary of key points.

  3. /calls/{id}/recording - GET

    • Purpose: Fetches the audio recording of the call in MP3 format once ready.
    • Parameters:
    • datasource: Common parameter reference.
    • id: Required call ID.
    • Responses:
    • 200: Audio recording is available.
    • 404: Recording not found.
    • 425: Recording is still processing, try again later.

  4. /calls/{id}/action/sms - POST

    • Purpose: Sends a text message to the client’s phone number within the session, allowed only within 3 minutes of call completion.
    • Parameters:
    • datasource: Common parameter reference.
    • id: Required call ID.
    • Responses:
    • 200: Message sent successfully.
    • 404: Session not found.
    • 403: Cannot send a message for this session due to call status constraints.