Skip to content

Create Call

POST
/calls

Start a call using a blueprint or a custom configuration.

Authorization

X-Struct-API-Keyheader
string
required

The API Key you generated using the Struct Dashboard.

Request Body

application/json
blueprintId
string

The ID of the blueprint to use to create the call from. The blueprint contains the first name, last name and phone number of the recipient of the call.

firstName
string

The first name of the callee. Will override the blueprint referenced by blueprintId if given.

lastName
string

The last name of the callee. Will override the blueprint referenced by blueprintId if given.

phoneNumber
string

The phone number of the callee. Will override the blueprint referenced by blueprintId if given.

data
Record<string, string>

Custom variables to provide to the prompt, first message and goodbye message templates for this call. The field names must match column names you've created in your project. Any values provided here will override the values defined in the referenced blueprint. An error response will be returned if a field is referenced in one of your templates that is not provided in this object or in the referenced blueprint.

Example Response

{
"id": "[CALL ID]",
"type": "phone",
"status": "started",
"firstName": "Michael",
"lastName": "Bluth",
"phoneNumber": "+447123456789",
"prompt": "Your name is Lisa.... [REST OF PROMPT]",
"firstMessage": "Hi there, my name is Lisa, how can I help you today?",
"goodbyeMessage": "Thank you so much for your time. Have a great day!",
"transferNumber": null,
"answeredBy": null,
"recordingUrl": null,
"callDuration": null,
"projectId": "[PROJECT ID]",
"callBlueprintId": "[BLUEPRINT ID] (IF USED)",
"createdAt": "2024-04-17T14:48:42.000Z",
"updatedAt": "2024-04-17T14:48:42.000Z"
}