Skip to main content
POST
/
generativeagent
/
v1
/
call-transfers
Create Call Transfer
curl --request POST \
  --url https://api.sandbox.asapp.com/generativeagent/v1/call-transfers \
  --header 'Content-Type: application/json' \
  --header 'asapp-api-id: <api-key>' \
  --header 'asapp-api-secret: <api-key>' \
  --data '{
  "id": "0867617078-0032318833-2221801472-0002236962",
  "externalConversationId": "0867617078-0032318833-2221801472-0002236962",
  "type": "PHONE_NUMBER",
  "phoneNumber": {
    "country": "US"
  },
  "inputContext": {
    "taskName": "Welcome",
    "inputVariables": {
      "email": "example@gmail.com",
      "name": "name"
    }
  }
}'
{
  "id": "0867617078-0032318833-2221801472-0002236962",
  "externalConversationId": "0867617078-0032318833-2221801472-0002236962",
  "type": "PHONE_NUMBER",
  "phoneNumber": {
    "transferNumber": "+19995550199",
    "country": "US",
    "expiresAt": "2024-06-01T12:34:56Z"
  },
  "inputContext": {
    "taskName": "Welcome",
    "inputVariables": {
      "email": "example@gmail.com",
      "name": "name"
    }
  }
}

Authorizations

asapp-api-id
string
header
required
asapp-api-secret
string
header
required

Body

application/json

Post Call Transfer Request

id
string
required

A unique identifier for this call transfer request. This should be different for each transfer attempt.

Example:

"0867617078-0032318833-2221801472-0002236962"

externalConversationId
string
required

The unique identifier of the call in your call system. Multiple call transfers using the same externalConversationId will be treated as a single conversation.

This is the primary identifier for conversations within ASAPP and is reflected in reporting.

Example:

"0867617078-0032318833-2221801472-0002236962"

type
enum<string>
required

The type of call transfer being made. Currently supports:

  • PHONE_NUMBER: A temporary phone number is assigned for the transfer.
  • SIP: Session Initiation Protocol (SIP) transfer.
Available options:
PHONE_NUMBER,
SIP
phoneNumber
object

Configuration information for requesting a phone number. Mandatory if type is PHONE_NUMBER.

sip
object

Configuration for SIP transfers. Defines how the call will be transferred back when the Generative Agent finishes the conversation.

Transfer Types:

  • BYE: Ends the call with a SIP BYE message. Use for supervised transfers to Generative Agent.
  • REFER: Sends a SIP REFER message with the return URI in the Refer-To header. Use for blind transfers to another system.
  • INVITE: Initiates a new SIP INVITE to the return URI, ASAPP will continue to transcribe the call until the call is ended.
Example:
{
"returnTransferType": "REFER",
"returnUri": "sip:transfer@your-company.com:5060"
}
inputContext
object

Optional context information to pass to the Generative Agent when the call is received.

Response

Successful response

Post Call Transfer Response

id
string
required

The unique identifier for this call transfer request, matching the ID provided in the request.

Example:

"0867617078-0032318833-2221801472-0002236962"

externalConversationId
string
required

The unique identifier of the call in your call system. This will be referenced in ASAPP reporting. Usually this is the same value as the call transfer ID.

Example:

"0867617078-0032318833-2221801472-0002236962"

type
enum<string>
required

The type of call transfer method being used.

Available options:
PHONE_NUMBER,
SIP
status
enum<string>

The current status of the call transfer request.

On creation, the status is ACTIVE and is waiting for your system to transfer the call.

Available options:
ACTIVE,
ONGOING,
COMPLETED,
EXPIRED
phoneNumber
object

Details about the assigned phone number for the transfer. Available only if type is PHONE_NUMBER.

sip
object

Configuration for SIP transfers. Defines how the call will be transferred back when the Generative Agent finishes the conversation.

Transfer Types:

  • BYE: Ends the call with a SIP BYE message. Use for supervised transfers to Generative Agent.
  • REFER: Sends a SIP REFER message with the return URI in the Refer-To header. Use for blind transfers to another system.
  • INVITE: Initiates a new SIP INVITE to the return URI, ASAPP will continue to transcribe the call until the call is ended.
Example:
{
"returnTransferType": "REFER",
"returnUri": "sip:transfer@your-company.com:5060"
}
inputContext
object

The context information that will be passed to the Generative Agent when the call is received.

I