Get started
Quickstart
-
Create an API key
Create a key at app.callshift.ai/api-keys and keep it in an environment variable. Check that it works by listing your agents:
export CALLSHIFT_API_KEY="your-api-key" curl "https://api.callshift.ai/v1/agents?limit=5" \ -H "Authorization: Bearer $CALLSHIFT_API_KEY" -
Pick an agent
Note the
idof the agent that will place the call. To try a change without touching an agent in production, duplicate it first with POST/v1/agents/{agentId}/duplicateand work on the copy.{ "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Alice", "gender": "FEMALE", "language": "en", "entityId": null } ], "pageCount": 1 } -
Pick a phone number
GET
/v1/phoneslists every number of the account. Take one whoseisOutboundAllowedistrue: itsidis thephoneIdof the campaign. -
Create a campaign
A campaign is created inactive, so nothing is dialed yet.
curl -X POST "https://api.callshift.ai/v1/campaigns" \ -H "Authorization: Bearer $CALLSHIFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "API quickstart", "agentId": "550e8400-e29b-41d4-a716-446655440000", "phoneId": "0d3a7e6b-2b8e-4c5b-9c4e-5f4b9d2a1c8e" }'const res = await fetch("https://api.callshift.ai/v1/campaigns", { method: "POST", headers: { Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "API quickstart", agentId: "550e8400-e29b-41d4-a716-446655440000", phoneId: "0d3a7e6b-2b8e-4c5b-9c4e-5f4b9d2a1c8e", }), }); const { id: campaignId } = await res.json();import os import requests res = requests.post( "https://api.callshift.ai/v1/campaigns", headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"}, json={ "name": "API quickstart", "agentId": "550e8400-e29b-41d4-a716-446655440000", "phoneId": "0d3a7e6b-2b8e-4c5b-9c4e-5f4b9d2a1c8e", }, ) campaign_id = res.json()["id"] -
Add yourself and start the campaign
Add one contact, your own mobile in E.164 format, then activate the campaign. An active campaign dials new contacts as soon as they arrive.
curl -X POST "https://api.callshift.ai/v1/campaigns/$CAMPAIGN_ID/contacts" \ -H "Authorization: Bearer $CALLSHIFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contacts": [ { "firstName": "Ada", "phoneNumber": "+33612345678" } ] }' curl -X PATCH "https://api.callshift.ai/v1/campaigns/$CAMPAIGN_ID" \ -H "Authorization: Bearer $CALLSHIFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "isActive": true }'Your phone rings within seconds. Answer and talk to the agent.
-
Read the call back
Once you hang up, the call carries its outcome. The list gives the status, the ended reason and the summary; the detail adds the transcript and the recording.
curl "https://api.callshift.ai/v1/calls?campaignId=$CAMPAIGN_ID" \ -H "Authorization: Bearer $CALLSHIFT_API_KEY"
Before a real campaign, send a test batch of one or two internal numbers, and let the welcome message say that the caller is talking to an AI assistant.
Answer inbound calls instead
To have the agent answer a number, assign it with PATCH/v1/phones/{phoneId}, then call the number.
curl -X PATCH "https://api.callshift.ai/v1/phones/$PHONE_ID" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "agentId": "550e8400-e29b-41d4-a716-446655440000" }'