API reference
Variables
Named values of the account that agents say in their prompts and use as transfer numbers, with a default value and one value per entity.
/v1/variablesPOST/v1/variablesPATCH/v1/variables/{variableId}DELETE/v1/variables/{variableId}GET/v1/entities/{entityId}/variablesPUT/v1/entities/{entityId}/variablesList variables
/v1/variablesA variable is a named value used in agent prompts as {{variable.key}}, the key being the camelCase form of its name ("Current offer" gives currentOffer), and as the destination of a call transfer. It has a default value, for all entities, and each entity can have its own, which replaces it. On a call, the value is the one of the call's entity: the agent's entity, or the line's when the agent is shared.
Variables are sorted by name, each with the entities that have their own value and the number of agents using it.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Responses
Variables retrieved successfully
dataobject[]requiredShow child attributes
idstring<uuid>requiredkeystringrequiredWhat an agent writes after variable.: the camelCase form of the name.
namestringrequiredvaluestring | nullrequiredThe default value, for all entities, or null when there is none.
entityValuesobject[]requiredThe entities that have their own value.
Show child attributes
entityIdstring<uuid>requiredvaluestringrequiredcreatedAtstringrequiredupdatedAtstringrequiredagentsintegerrequiredThe agents whose prompts or transfers use the variable.
Unauthorized
errorstringrequiredInternal server error
errorstringrequiredcurl "https://api.callshift.ai/v1/variables" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY"const res = await fetch("https://api.callshift.ai/v1/variables", {
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://api.callshift.ai/v1/variables",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
)
print(res.json()){
"data": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"key": "currentOffer",
"name": "Current offer",
"value": "First month free",
"entityValues": [
{
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"value": "string"
}
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"agents": 3
}
]
}{
"error": "Authentication error"
}{
"error": "Internal server error"
}Create a variable
/v1/variablesA variable is a named value used in agent prompts as {{variable.key}}, the key being the camelCase form of its name ("Current offer" gives currentOffer), and as the destination of a call transfer. It has a default value, for all entities, and each entity can have its own, which replaces it. On a call, the value is the one of the call's entity: the agent's entity, or the line's when the agent is shared.
The name is in plain words and cannot be changed afterwards; its camelCase form is the key, unique within the account. The value is the default value, for all entities; leave it out when only entities have a value.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Body application/json
namestringrequiredvaluestring | nullResponses
Variable created successfully
idstring<uuid>requiredkeystringrequiredWhat an agent writes after variable.: the camelCase form of the name.
namestringrequiredvaluestring | nullrequiredThe default value, for all entities, or null when there is none.
entityValuesobject[]requiredThe entities that have their own value.
Show child attributes
entityIdstring<uuid>requiredvaluestringrequiredcreatedAtstringrequiredupdatedAtstringrequiredInvalid request body
successenum<boolean>requiredfalseerrorobjectrequiredShow child attributes
nameenum<string>requiredZodErrorissuesobject[]requiredShow child attributes
codestringrequiredpathstring | number[]requiredmessagestringrequirederrorstringrequiredUnauthorized
errorstringrequiredAnother variable already has the key this name gives
errorstringrequiredThe body was not sent as application/json
errorstringrequiredInternal server error
errorstringrequiredcurl -X POST "https://api.callshift.ai/v1/variables" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Current offer",
"value": "First month free"
}'const res = await fetch("https://api.callshift.ai/v1/variables", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Current offer",
"value": "First month free"
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://api.callshift.ai/v1/variables",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
json={
"name": "Current offer",
"value": "First month free",
},
)
print(res.json()){
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"key": "currentOffer",
"name": "Current offer",
"value": "First month free",
"entityValues": [
{
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"value": "string"
}
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}{
"success": false,
"error": {
"name": "ZodError",
"issues": [
{
"code": "invalid_enum_value",
"path": [
"contacts",
0,
"email"
],
"message": "Invalid email"
}
]
}
}{
"error": "Authentication error"
}{
"error": "Another variable already has the key this name gives"
}{
"error": "The body was not sent as `application/json`"
}{
"error": "Internal server error"
}Update a variable's default value
/v1/variables/{variableId}Change or remove the default value, the one for all entities. Entities that have their own value keep it. The change applies to the next call of every agent using the variable.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Path parameters
variableIdstring<uuid>requiredBody application/json
The default value, for all entities. null removes it; entities keep their own.
valuestring | nullrequiredResponses
Variable updated successfully
successbooleanrequiredInvalid request body
successenum<boolean>requiredfalseerrorobjectrequiredShow child attributes
nameenum<string>requiredZodErrorissuesobject[]requiredShow child attributes
codestringrequiredpathstring | number[]requiredmessagestringrequirederrorstringrequiredUnauthorized
errorstringrequiredVariable not found
errorstringrequiredThe body was not sent as application/json
errorstringrequiredInternal server error
errorstringrequiredcurl -X PATCH "https://api.callshift.ai/v1/variables/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "Two weeks free"
}'const res = await fetch("https://api.callshift.ai/v1/variables/550e8400-e29b-41d4-a716-446655440000", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"value": "Two weeks free"
}),
});
const data = await res.json();import os
import requests
res = requests.patch(
"https://api.callshift.ai/v1/variables/550e8400-e29b-41d4-a716-446655440000",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
json={
"value": "Two weeks free",
},
)
print(res.json()){
"success": true
}{
"success": false,
"error": {
"name": "ZodError",
"issues": [
{
"code": "invalid_enum_value",
"path": [
"contacts",
0,
"email"
],
"message": "Invalid email"
}
]
}
}{
"error": "Authentication error"
}{
"error": "Variable not found"
}{
"error": "The body was not sent as `application/json`"
}{
"error": "Internal server error"
}Delete a variable
/v1/variables/{variableId}Delete a variable and every entity's own value of it. While an agent still uses it the request is refused with the number of agents, rather than leaving their prompts or transfers with a blank.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Path parameters
variableIdstring<uuid>requiredResponses
Variable deleted successfully
No content.
Unauthorized
errorstringrequiredVariable not found
errorstringrequiredAgents still use the variable. Remove it from their prompts and transfers first.
errorstringrequiredagentsintegerrequiredInternal server error
errorstringrequiredcurl -X DELETE "https://api.callshift.ai/v1/variables/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY"const res = await fetch("https://api.callshift.ai/v1/variables/550e8400-e29b-41d4-a716-446655440000", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
},
});
console.log(res.status); // 204import os
import requests
res = requests.delete(
"https://api.callshift.ai/v1/variables/550e8400-e29b-41d4-a716-446655440000",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
)
print(res.status_code) # 204No content{
"error": "Authentication error"
}{
"error": "Variable not found"
}{
"error": "Agents still use the variable. Remove it from their prompts and transfers first",
"agents": 0
}{
"error": "Internal server error"
}Get the variable values of an entity
/v1/entities/{entityId}/variablesThe value each variable takes on a call of this entity: the entity's own, else the default value.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Path parameters
entityIdstring<uuid>requiredResponses
Values retrieved successfully
valuesobjectrequiredThe value each variable takes for the entity: its own, else the default value. A variable with neither is left out.
Unauthorized
errorstringrequiredEntity not found
errorstringrequiredInternal server error
errorstringrequiredcurl "https://api.callshift.ai/v1/entities/550e8400-e29b-41d4-a716-446655440000/variables" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY"const res = await fetch("https://api.callshift.ai/v1/entities/550e8400-e29b-41d4-a716-446655440000/variables", {
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://api.callshift.ai/v1/entities/550e8400-e29b-41d4-a716-446655440000/variables",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
)
print(res.json()){
"values": {
"currentOffer": "No joining fee"
}
}{
"error": "Authentication error"
}{
"error": "Entity not found"
}{
"error": "Internal server error"
}Set the variable values of an entity
/v1/entities/{entityId}/variablesGive an entity its own values, by variable key, in one call. Answers with the value each variable now takes for the entity. The change applies to the entity's next call.
Authorization
AuthorizationstringrequiredBearer <API key>, a key created at app.callshift.ai/api-keys.
Path parameters
entityIdstring<uuid>requiredBody application/json
The entity's own values, by variable key. null clears the entity's own value, so the variable takes the default value again. Variables left out are unchanged.
valuesobjectrequiredResponses
Values written successfully
valuesobjectrequiredThe value each variable takes for the entity: its own, else the default value. A variable with neither is left out.
Invalid request body
successenum<boolean>requiredfalseerrorobjectrequiredShow child attributes
nameenum<string>requiredZodErrorissuesobject[]requiredShow child attributes
codestringrequiredpathstring | number[]requiredmessagestringrequirederrorstringrequiredUnauthorized
errorstringrequiredEntity not found
errorstringrequiredThe body was not sent as application/json
errorstringrequiredA key matches no variable. Nothing was written.
errorstringrequiredkeysstring[]requiredInternal server error
errorstringrequiredcurl -X PUT "https://api.callshift.ai/v1/entities/550e8400-e29b-41d4-a716-446655440000/variables" \
-H "Authorization: Bearer $CALLSHIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": {
"currentOffer": "No joining fee",
"openingHours": null
}
}'const res = await fetch("https://api.callshift.ai/v1/entities/550e8400-e29b-41d4-a716-446655440000/variables", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.CALLSHIFT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"values": {
"currentOffer": "No joining fee",
"openingHours": null
}
}),
});
const data = await res.json();import os
import requests
res = requests.put(
"https://api.callshift.ai/v1/entities/550e8400-e29b-41d4-a716-446655440000/variables",
headers={"Authorization": f"Bearer {os.environ['CALLSHIFT_API_KEY']}"},
json={
"values": {
"currentOffer": "No joining fee",
"openingHours": None,
},
},
)
print(res.json()){
"values": {
"currentOffer": "No joining fee"
}
}{
"success": false,
"error": {
"name": "ZodError",
"issues": [
{
"code": "invalid_enum_value",
"path": [
"contacts",
0,
"email"
],
"message": "Invalid email"
}
]
}
}{
"error": "Authentication error"
}{
"error": "Entity not found"
}{
"error": "The body was not sent as `application/json`"
}{
"error": "A key matches no variable. Nothing was written",
"keys": [
"string"
]
}{
"error": "Internal server error"
}