Browse the docs

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.

List variables

GET/v1/variables
Bearer API key

A 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

Authorizationstringrequired

Bearer <API key>, a key created at app.callshift.ai/api-keys.

Responses

Variables retrieved successfully

dataobject[]required
Show child attributes
idstring<uuid>required
example 7c9e6679-7425-40de-944b-e07fc1f90ae7
keystringrequired

What an agent writes after variable.: the camelCase form of the name.

example currentOffer
namestringrequired
example Current offer
valuestring | nullrequired

The default value, for all entities, or null when there is none.

example First month free
entityValuesobject[]required

The entities that have their own value.

Show child attributes
entityIdstring<uuid>required
example 550e8400-e29b-41d4-a716-446655440000
valuestringrequired
createdAtstringrequired
example 2026-01-01T00:00:00.000Z
updatedAtstringrequired
example 2026-01-01T00:00:00.000Z
agentsintegerrequired

The agents whose prompts or transfers use the variable.

example 3

Unauthorized

errorstringrequired

Internal server error

errorstringrequired
GET
curl "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())
Response
{
  "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

POST/v1/variables
Bearer API key

A 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

Authorizationstringrequired

Bearer <API key>, a key created at app.callshift.ai/api-keys.

Body application/json

namestringrequired
1 to 255 characters
valuestring | null
up to 10000 characters

Responses

Variable created successfully

idstring<uuid>required
example 7c9e6679-7425-40de-944b-e07fc1f90ae7
keystringrequired

What an agent writes after variable.: the camelCase form of the name.

example currentOffer
namestringrequired
example Current offer
valuestring | nullrequired

The default value, for all entities, or null when there is none.

example First month free
entityValuesobject[]required

The entities that have their own value.

Show child attributes
entityIdstring<uuid>required
example 550e8400-e29b-41d4-a716-446655440000
valuestringrequired
createdAtstringrequired
example 2026-01-01T00:00:00.000Z
updatedAtstringrequired
example 2026-01-01T00:00:00.000Z

Invalid request body

successenum<boolean>required
Allowedfalse
errorobjectrequired
Show child attributes
nameenum<string>required
AllowedZodError
issuesobject[]required
Show child attributes
codestringrequired
example invalid_enum_value
pathstring | number[]required
messagestringrequired
example Invalid email
errorstringrequired

Unauthorized

errorstringrequired

Another variable already has the key this name gives

errorstringrequired

The body was not sent as application/json

errorstringrequired

Internal server error

errorstringrequired
POST
curl -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())
Response
{
  "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

PATCH/v1/variables/{variableId}
Bearer API key

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

Authorizationstringrequired

Bearer <API key>, a key created at app.callshift.ai/api-keys.

Path parameters

variableIdstring<uuid>required
example 7c9e6679-7425-40de-944b-e07fc1f90ae7

Body application/json

The default value, for all entities. null removes it; entities keep their own.

valuestring | nullrequired
up to 10000 characters

Responses

Variable updated successfully

successbooleanrequired

Invalid request body

successenum<boolean>required
Allowedfalse
errorobjectrequired
Show child attributes
nameenum<string>required
AllowedZodError
issuesobject[]required
Show child attributes
codestringrequired
example invalid_enum_value
pathstring | number[]required
messagestringrequired
example Invalid email
errorstringrequired

Unauthorized

errorstringrequired

Variable not found

errorstringrequired

The body was not sent as application/json

errorstringrequired

Internal server error

errorstringrequired
PATCH
curl -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())
Response
{
  "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

DELETE/v1/variables/{variableId}
Bearer API key

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

Authorizationstringrequired

Bearer <API key>, a key created at app.callshift.ai/api-keys.

Path parameters

variableIdstring<uuid>required
example 7c9e6679-7425-40de-944b-e07fc1f90ae7

Responses

Variable deleted successfully

No content.

Unauthorized

errorstringrequired

Variable not found

errorstringrequired

Agents still use the variable. Remove it from their prompts and transfers first.

errorstringrequired
agentsintegerrequired

Internal server error

errorstringrequired
DELETE
curl -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); // 204
import 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)  # 204
Response
No 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

GET/v1/entities/{entityId}/variables
Bearer API key

The value each variable takes on a call of this entity: the entity's own, else the default value.

Authorization

Authorizationstringrequired

Bearer <API key>, a key created at app.callshift.ai/api-keys.

Path parameters

entityIdstring<uuid>required
example 550e8400-e29b-41d4-a716-446655440000

Responses

Values retrieved successfully

valuesobjectrequired

The value each variable takes for the entity: its own, else the default value. A variable with neither is left out.

Unauthorized

errorstringrequired

Entity not found

errorstringrequired

Internal server error

errorstringrequired
GET
curl "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())
Response
{
  "values": {
    "currentOffer": "No joining fee"
  }
}
{
  "error": "Authentication error"
}
{
  "error": "Entity not found"
}
{
  "error": "Internal server error"
}

Set the variable values of an entity

PUT/v1/entities/{entityId}/variables
Bearer API key

Give 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

Authorizationstringrequired

Bearer <API key>, a key created at app.callshift.ai/api-keys.

Path parameters

entityIdstring<uuid>required
example 550e8400-e29b-41d4-a716-446655440000

Body 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.

valuesobjectrequired

Responses

Values written successfully

valuesobjectrequired

The 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>required
Allowedfalse
errorobjectrequired
Show child attributes
nameenum<string>required
AllowedZodError
issuesobject[]required
Show child attributes
codestringrequired
example invalid_enum_value
pathstring | number[]required
messagestringrequired
example Invalid email
errorstringrequired

Unauthorized

errorstringrequired

Entity not found

errorstringrequired

The body was not sent as application/json

errorstringrequired

A key matches no variable. Nothing was written.

errorstringrequired
keysstring[]required

Internal server error

errorstringrequired
PUT
curl -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())
Response
{
  "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"
}