# Callingly API Documentation

Source: https://callingly.com/help/article/38-callingly-api-documentation

<div class="callout-blue mb-2"><span class="material-icons">tips_and_updates</span><div><strong>Building something new?</strong> Use version 2 of the API: see the <a href="https://callingly.com/developers/api" target="_blank">API reference</a>. This article covers version 1, which keeps working for existing integrations and for calls where Callingly rings your reps.</div></div>

<h2 id="Generating-an-API-Key-VFoSW">Generating an API Key</h2>

The API requires generating a <b>Bearer Token</b> to be used with every request.

<br>

To generate a new token:

1.  Head to the [API Keys](https://callingly.com/dashboard/settings/api_keys) page under Settings -> API Keys.
2.  Click the blue "Add API Key" button in the top right.
3.  Give the API Key a name. This name is just for your own purposes.
4.  Copy the API key and save it for use later. You cannot view the API key again so make sure you save it somewhere safe.

<br>

<h2 id="authentication-headers">Authentication Headers</h2>

With every API request, please send in the following two headers:

<pre><b>Authorization</b>: Bearer {{YOUR_BEARER_TOKEN_HERE}}


<b>Accept</b>: application/json
</pre>

<br>

<h2 id="client-account-id">Account ID for Clients</h2>

If you are an Agency partner and are using the API to make requests for your clients, along with your Bearer Token you can pass in an **account\_id** parameter with the ID number of your client's account. Get Call, Delete Lead, sending a text and the webhook endpoints don't take it: they always use the account the API key belongs to, so use a key from the client's account for those.

You can find your client's account ID number either in the Clients endpoint or by clicking Edit on the Client's account in the Clients panel and looking for the ID in the top right corner.

<br>

<h2 id="calls">Calls</h2>

<h3 id="Get-Call-JlDGl">Get Call</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/calls/{{call_id}}
</pre>

**Sample Response**

<pre>{
    "id": 1234,
    "started_at": "2020-11-11 12:08:13",
    "direction": "outbound",
    "status": "completed",
    "status_formatted": "Completed",
    "lead_status": "contacted",
    "lead_status_formatted": "Contacted",
    "ring_status": "completed",
    "seconds": 5,
    "duration": "5s",
    "retry": 0,
    "lead_retry": 0,
    "time_formatted": "11/11/20 12:08pm",
    "from_formatted": "(123) 456-7890",
    "source": "App",
    "recording_url": "https://cdn.callingly.com/recordings/example.mp3",
    "waveform_url": "https://cdn.callingly.com/waveforms/example.png",
    "error_message": null,
    "phone_number_formatted": "(123) 456-7890",
    "human_result": "contacted",
    "user": {
        "id": 1,
        "name": "Michael Scott",
        "fname": "Michael",
        "lname": "Scott",
        "email": "michael@dundermifflin.com",
        "phone_number": "+11234567890",
    },
    "lead": {
        "id": 1234567,
        "name": "Example Lead",
        "label": "Example Lead",
        "fname": "Example",
        "lname": "Lead",
        "email": "example@lead.com",
        "phone_number": "+11234567890",
        "phone_number_formatted": "(123) 456-7890",
        "source": null,
        "crm": null,
        "source_id": null,
        "deleted_at": null
    },
    "number": null,
    "tag": null,
    "notes": [],
    "profile": {
        "id": 12345,
        "name": "Example Team"
    },
    "is_voicemail": 0,
    "is_queue": 0,
    "is_team_offline": 0,
    "scheduled_call_type": null,
    "old_lead_owner_id": null,
    "transcript": "Speaker A: Hello this is a call...",
    "sales_advice": null,
    "is_error": 0,
    "error_code": ""
}
</pre>

<br>

<h3 id="list-calls">List Calls</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/calls?start=2020-01-01&amp;end=2020-02-01&amp;team_id=123&amp;limit=10&amp;page=1
</pre>

**Sample Response**

<pre>{
    data: [
        {
            id: 12343,
            started_at: "2020-11-30 10:54:01",
            direction: "outbound",
            status: "completed",
            lead_status: null,
            seconds: 37,
            duration: "37s",
            retry: 0,
            lead_retry: 0,
            time_formatted: "11/30/20 10:54am",
            source: "Dashboard",
            user: { ... },
            lead: { ... },
            profile: { ... },
            recording_url:
                 "https://cdn.callingly.com/recordings/da3c0bf.mp3",
        }
    ]
}
</pre>

<h3 id="create-call">Create Call</h3>

`team_id` decides who is called, when, and from which caller ID. `sequence_id` is optional and picks the follow-up sequence the lead is enrolled in — find the ids with [List Sequences](#list-sequences). Leave it out to use the team's sequence. An id that isn't one of the account's sequences returns a 404.

**Endpoint**

<pre>POST https://api.callingly.com/v1/calls
</pre>

**Sample Request**

<pre>{
    "account_id": 1,
    "team_id": 123,    
    "first_name": "John",
    "last_name": "Doe",
    "phone_number": "555-555-5555",
    "email": "john@doe.com",
    "company": "John's Pools",
    "category": "Pools",
    "source": "HubSpot",
    "crm_id": 123,
    "sequence_id": 456,
    "scheduled_at": "2026-03-06 14:26:35"
}
</pre>

`sequence_id` and `scheduled_at` are optional.

<br>

<h2 id="clients">Clients</h2>

<h3 id="list-clients">List Clients</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/clients
</pre>

**Sample Response**

<pre>{
	"data": [
		{
			"id": 123,
			"name": "Client Name",
			"email": "client@email.com",
			"billed_users": 12,
			"billed_numbers": 2
		}
	]
}
</pre>

<h3 id="create-client">Create Client</h3>

**Endpoint**

<pre>POST https://api.callingly.com/v1/clients
</pre>

**Sample Request**

<pre>{
	"fname": "John",
	"lname": "Smith",
	"company": "Smith Pools",
	"email": "client@email.com",
	"phone_number": "555-555-5555",
	"password": "password123"
}
</pre>

<h3 id="delete-client">Delete Client</h3>

**Endpoint**

<pre>DELETE https://api.callingly.com/v1/clients/{{id}}
</pre>

<h3 id="activate-deactivate">Activate/Deactivate</h3>

**Endpoint**

<pre>POST https://api.callingly.com/v1/clients/{{id}}/active
</pre>

**Sample Request**

<pre>{
	"is_active": 0
}
</pre>

<br>

<h2 id="Leads-ZNsJ4">Leads</h2>

<h3 id="List-Leads-_hyZk">List Leads</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/leads?start=2020-01-01&amp;end=2020-02-01&amp;phone_number=+14801234567
</pre>

Returns up to 100 leads, oldest first. Add `offset=100`, then `offset=200` and so on, to get the next ones.

**Sample Response**

<pre>[
  {
    "id": 1,
    "account_id": 1,
    "lead_owner_id": 4,
    "fname": "Test",
    "lname": "Lead",
    "email": "test@lead.com",
    "phone_number": "+14801234567",
    "source": "Webhook",
    "source_id": null,
    "created_at": "2024-05-21 23:37:54",
    "company": "Callingly",
    "category": null,
    "status": "missed",
    "result": null,
    "team": {
      "id": 1,
      "name": "Team 1"
    },
    "tags": [],
    "stage": null,
    "calls": [
      {
        "id": 1,
        "source": null,
        "seconds": 0,
        "direction": "outbound",
        "status": null,
        "result": null,
        "agent_retry": 0,
        "lead_retry": 0,
        "started_at": "2024-06-03 23:57:04",
        "recording_url": null
      }
    ],
    "scheduled_call_at": "06/13/24 3:48pm MST",
    "lead_owner": {
      "name": "Bartholome Wilkinson",
      "phone_number": "+14801239876",
      "custom_id": null
    }
  }
]
</pre>

<h3 id="Get-Lead-vwwS6">Get Lead</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/leads/{{id}}
</pre>

**Sample Response**

<pre>{
  "id": 1,
  "account_id": 1,
  "lead_owner_id": 4,
  "fname": "Test",
  "lname": "Lead",
  "email": "test@lead.com",
  "phone_number": "+14801234567",
  "source": "Webhook",
  "source_id": null,
  "created_at": "2024-05-21 23:37:54",
  "company": "Callingly",
  "category": null,
  "status": "missed",
  "result": null,
  "team": {
    "id": 1,
    "name": "Team 1"
  },
  "tags": [],
  "stage": null,
  "scheduled_call_at": "06/13/24 3:48pm MST",
  "is_stopped": 0,
  "is_blocked": 0,
  "custom": {
    "contract_proposal_url": "https://example.com/proposal"
  },
  "contract_proposal_url": "https://example.com/proposal",
  "lead_owner": {
    "name": "Bartholome Wilkinson",
    "phone_number": "+14801239876",
    "custom_id": null
  }
}
</pre>

Custom lead fields are returned in `custom`, keyed by the field's slug (e.g. `contract_proposal_url` for the merge tag `{{lead.contract_proposal_url}}`). Each is also returned top-level, unless its slug matches a built-in key such as `status` or `email`.

<h3 id="Update-Agent-sx_cL">Update Lead</h3>

**Endpoint**

<pre>PUT https://api.callingly.com/v1/leads/{{id}}
</pre>

**Sample request**

<pre>{
  "fname": "Test",
  "lname": "Lead",
  "email": "test@lead.com",
  "company": "Callingly",
  "status": "called",
  "result": "contacted",
  "stage": "Qualified",
  "is_stopped": 0,
  "is_blocked": 0,
  "contract_proposal_url": "https://example.com/proposal"
}
</pre>

A lead's phone number and source can't be changed here. `stage` takes the name of one of your stages. Leaving `stage` or `result` out, or sending `null`, keeps the current value.

To set a custom lead field, send it top-level keyed by the field's slug, or inside a `custom` object (`{"custom": {"contract_proposal_url": "https://..."}}`). Use `custom` for a field whose slug matches a built-in key such as `status` or `email` — top-level, that key only updates the built-in field. Keys that don't match one of your account's custom fields are ignored, and a value over 65,535 bytes is rejected with a 400 before anything is saved.

<h3 id="Delete-Lead-WgweT">Delete Lead</h3>

**Endpoint**

<pre>DELETE https://api.callingly.com/v1/leads/{{id}}
</pre>

**Sample Response**

<pre>{
  "success": true
}
</pre>

<br>

<h2 id="SMS-1t_mc">SMS</h2>

<h3 id="Create-SMS-99o_t">Create SMS</h3>

**Endpoint**

<pre>POST https://api.callingly.com/v1/sms
</pre>

**Fields**

<table class="hs-table"><tbody><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Required</b></td><td><b>Example</b></td></tr><tr><td>phone_number</td><td><p>string</p><ul><li><a href="https://www.twilio.com/docs/glossary/what-e164" target="_blank">E164 format </a>preferred.</li></ul></td><td><b>Yes</b></td><td><ul><li>+11234567890</li><li>(123) 456-7890</li><li>1234567890</li></ul></td></tr><tr><td>sms_number</td><td><p>string</p><ul><li><a href="https://www.twilio.com/docs/glossary/what-e164" target="_blank">E164 format </a>preferred.</li></ul></td><td><b>Yes</b></td><td><ul><li>+11234567890</li><li>(123) 456-7890</li><li>1234567890</li></ul></td></tr><tr><td>message</td><td><p>string</p><ul><li>See <a href="https://callingly.com/help/article/99-how-to-personalize-sms-messages" target="_blank">How to Personalize SMS Messages</a></li></ul></td><td><b>Yes</b></td><td>Hey {{lead.first_name | default: 'there'}}! {{from.company}} here. We received your inquiry and we'll be calling your shortly. There's a real person on the other end of this text, so if you have any questions, feel free to reply. Reply STOP to opt out of messages. Msg &amp; data rates may apply.</td></tr></tbody></table>

**Sample Body**

<pre>{
    "phone_number": "(123) 456-7890", 
    "sms_number": "(123) 987-6543", 
    "message": "Hey <i>{{lead.first_name | default: 'there'}}</i>! <i>{{from.company}}</i> here. We received your inquiry and we'll be calling your shortly. There's a real person on the other end of this text, so if you have any questions, feel free to reply. Reply STOP to opt out of messages. Msg &amp; data rates may apply."
}
</pre>

**Sample response**

<pre>{
    "lead_id": 1,
    "is_error": 0,
    "error_code": "",
    "conversation_id": 1,
    "sms_id": 1,
    "from": "+11239876543",
    "to": "+11234567890",
    "body": "Hey John! Callingly here. We received your inquiry and we'll be calling your shortly. There's a real person on the other end of this text, so if you have any questions, feel free to reply. Reply STOP to opt out of messages. Msg &amp; data rates may apply.",
    "sent_at": "2025-09-15T23:22:05.000000Z",
    "direction": "outbound"
}
</pre>

<br>

<h3 id="schedule-sms">Schedule SMS</h3>

Queues a text to an existing lead to be sent at a future time. The lead and sending-number rules are the same as <b>Create SMS</b>. Personalization fields in the message are filled in when the text is sent, not when it is scheduled.

**Endpoint**

<pre>POST https://api.callingly.com/v1/sms/scheduled
</pre>

**Fields**

<table class="hs-table"><tbody><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Required</b></td><td><b>Example</b></td></tr><tr><td>phone_number</td><td>string</td><td><b>Yes</b></td><td>+11234567890</td></tr><tr><td>sms_number</td><td>string</td><td><b>Yes</b></td><td>+11239876543</td></tr><tr><td>message</td><td>string</td><td><b>Yes</b></td><td>Hi {{lead.first_name}}, just checking in!</td></tr><tr><td>send_at</td><td><p>string</p><ul><li>Date and time in your account's timezone. A time in the past is treated as now, and the text goes out within about a minute.</li></ul></td><td><b>Yes</b></td><td>2025-09-16 09:00</td></tr></tbody></table>

**Sample Body**

<pre>{
    "phone_number": "(123) 456-7890",
    "sms_number": "(123) 987-6543",
    "message": "Hi {{lead.first_name}}, just checking in!",
    "send_at": "2025-09-16 09:00"
}
</pre>

**Sample response**

<pre>{
    "scheduled_sms_id": 1,
    "lead_id": 1,
    "from": "+11239876543",
    "to": "+11234567890",
    "body": "Hi {{lead.first_name}}, just checking in!",
    "send_at": "2025-09-16T13:00:00+00:00"
}
</pre>

<br>

<h3 id="list-sms">List SMS</h3>

Returns every SMS in your account created within a date range, newest first. Use this to export message history.

**Endpoint**

<pre>GET https://api.callingly.com/v1/sms?start=2025-09-01&amp;end=2025-09-30&amp;limit=100&amp;page=1
</pre>

**Query parameters**

<table class="hs-table"><tbody><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Required</b></td><td><b>Notes</b></td></tr><tr><td>start</td><td>date (YYYY-MM-DD)</td><td>No</td><td>Date in your account's timezone. Defaults to 29 days ago.</td></tr><tr><td>end</td><td>date (YYYY-MM-DD)</td><td>No</td><td>Date in your account's timezone, inclusive. Defaults to today.</td></tr><tr><td>lead_id</td><td>integer</td><td>No</td><td>Only messages with this lead.</td></tr><tr><td>conversation_id</td><td>integer</td><td>No</td><td>Only messages in this conversation.</td></tr><tr><td>direction</td><td>string</td><td>No</td><td><code>inbound</code> or <code>outbound</code></td></tr><tr><td>limit</td><td>integer</td><td>No</td><td>Results per page. Default 10, max 100.</td></tr><tr><td>page</td><td>integer</td><td>No</td><td>Page number. Default 1.</td></tr></tbody></table>

**Sample response**

<pre>{
    "data": [
        {
            "id": 5678,
            "account_id": 1,
            "lead_id": 1,
            "conversation_id": 42,
            "from": "+11234567890",
            "to": "+11239876543",
            "body": "Yes, tomorrow at 2pm works.",
            "media_url": null,
            "media_content_type": null,
            "sent_at": "2025-09-15T23:25:41.000000Z",
            "sent_at_formatted": "9/15/2025 7:25 PM",
            "direction": "inbound",
            "is_error": 0,
            "error_code": null,
            "actor": null,
            "user": null
        }
    ],
    "links": { "first": "...", "last": "...", "prev": null, "next": "..." },
    "meta": { "current_page": 1, "last_page": 3, "per_page": 100, "total": 245 }
}
</pre>

<br>

<h2 id="conversations">Conversations</h2>

A conversation is the SMS thread between one lead and one of your phone numbers. Agency partners can add <b>account_id</b> to any conversation or List SMS request to read a client account.

<h3 id="list-conversations">List Conversations</h3>

Returns conversations, most recently active first. Includes threads that only contain automated messages.

**Endpoint**

<pre>GET https://api.callingly.com/v1/conversations?lead_id=1&amp;limit=10&amp;page=1
</pre>

**Query parameters**

<table class="hs-table"><tbody><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Required</b></td><td><b>Notes</b></td></tr><tr><td>lead_id</td><td>integer</td><td>No</td><td>Only conversations with this lead.</td></tr><tr><td>number_id</td><td>integer</td><td>No</td><td>Only conversations on this phone number.</td></tr><tr><td>limit</td><td>integer</td><td>No</td><td>Results per page. Default 10, max 100.</td></tr><tr><td>page</td><td>integer</td><td>No</td><td>Page number. Default 1.</td></tr></tbody></table>

**Sample response**

<pre>{
    "data": [
        {
            "id": 42,
            "account_id": 1,
            "unread_count": 1,
            "last_sms_at": "2025-09-15T23:25:41.000000Z",
            "last_sms_at_formatted": "9/15/2025 7:25 PM",
            "last_sms": { ... },
            "lead": {
                "id": 1,
                "label": "John Smith",
                "country_code": "US",
                "fname": "John",
                "lname": "Smith",
                "phone_number": "+11234567890",
                "phone_number_formatted": "(123) 456-7890",
                "deleted_at": null,
                "is_ai_sms_paused": false
            },
            "number": {
                "id": 7,
                "name": "Main Line",
                "phone_number": "+11239876543",
                "phone_number_formatted": "(123) 987-6543",
                "has_ai_sms_agent": true
            }
        }
    ],
    "links": { ... },
    "meta": { ... }
}
</pre>

<h3 id="get-conversation">Get Conversation</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/conversations/{{conversation_id}}
</pre>

Returns a single conversation in the same shape as above.

<h3 id="list-conversation-sms">List Conversation Messages</h3>

Returns the messages in one conversation, newest first.

**Endpoint**

<pre>GET https://api.callingly.com/v1/conversations/{{conversation_id}}/sms?limit=30&amp;page=1
</pre>

`limit` defaults to 30, max 100.

**Sample response**

<pre>{
    "data": [
        {
            "id": 5678,
            "account_id": 1,
            "lead_id": 1,
            "conversation_id": 42,
            "from": "+11234567890",
            "to": "+11239876543",
            "body": "Yes, tomorrow at 2pm works.",
            "media_url": null,
            "media_content_type": null,
            "sent_at": "2025-09-15T23:25:41.000000Z",
            "sent_at_formatted": "9/15/2025 7:25 PM",
            "direction": "inbound",
            "is_error": 0,
            "error_code": null,
            "actor": null,
            "user": null
        }
    ],
    "links": { ... },
    "meta": { ... }
}
</pre>

<br>

<h2 id="teams">Teams</h2>

<h3 id="list-teams">List Teams</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/teams
</pre>

**Sample Response**

<pre>{
	"data": [
		{
			"id": 123,
			"account_id": 1,
			"name": "Main Team"
		}
	]
}
</pre>

<h3 id="get-team">Get Team</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/teams/{{id}}
</pre>

**Sample Response**

<pre>{
    "id": 123,
    "account_id": 1,
    "name": "Main Team",
    "is_record": 1,
    "call_mode": "simultaneous",
    "whispertext": "Please press 1 to connect to {first_name} {last_name} from {company} {category}",
    "post_whispertext": "Your call has been completed. Press 1 if you were able to reach the lead. Press 2 if you left a voicemail. Press 3 otherwise to reschedule the call.",
    "language": "en",
    "retry_schedule": [
        { "unit": "minutes", "value": 15 },
        { "unit": "hours", "value": 1 }
    ],
    "whispertext_voice": "Polly.Matthew",
    "is_users_available_for_call": true
}
</pre>

<h3 id="create-team">Create Team</h3>

**Endpoint**

<pre>POST https://api.callingly.com/v1/teams
</pre>

**Sample Request**

<pre>{
    "account_id": 1,
    "name": "New Team",
    "sequence_id": 12
}
</pre>

`sequence_id` sets how the team's leads are called and followed up. See [Update Sequence](#update-sequence). Call recording is one setting for the whole account, so a team's `is_record` always matches it.

<h3 id="update-team">Update Team</h3>

**Endpoint**

<pre>PUT https://api.callingly.com/v1/teams/{{id}}
</pre>

<h3 id="list-team-users">List Team Users</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/teams/{{id}}/agents
</pre>

**Sample Request**

<pre>{
    "agents": [
        {
            "id": 1,
            "name": "John Smith",
            "priority": 1,
            "cap": null
        },
        {
            "id": 2,
            "name": "Test Test",
            "priority": 1,
            "cap": 1000
        },
        {
            "id": 3,
            "name": "Jane Smith",
            "priority": 2,
            "cap": null
        }
    ]
}
</pre>

<h3 id="update-users">Update Users</h3>

**Endpoint**

<pre>PUT https://api.callingly.com/v1/teams/{{id}}/agents
</pre>

**Sample Request**

<pre>{
    "agents": ["1","3","5"]
}
</pre>

<h3 id="remove-agents">Remove Agent</h3>

**Endpoint**

<pre>DELETE https://api.callingly.com/v1/teams/{{id}}/agents/{{agent_id}}
</pre>

<h3 id="update-agent-settings">Update Agent Settings</h3>

**Endpoint**

<pre>PUT https://api.callingly.com/v1/teams/{{id}}/agents/{{agent_id}}
</pre>

**Sample Request**

<pre>{
    "priority": 1,
    "cap": 100
}
</pre>

<br>

<h2 id="integration-routing">Integration Routing</h2>

Routing decides which team a lead from a connected integration goes to. Rules are checked in order; the first match wins, and a lead that matches none goes to the default team. Managing routing requires an owner or admin API key.

<h3 id="list-integrations">List Integrations</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/integrations
</pre>

<h3 id="get-routing">Get Routing</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/integrations/{{id}}/routing
</pre>

**Sample Response**

<pre>{
    "default_team_id": 10,
    "default_sequence_id": null,
    "rules": [
        {
            "field": "source",
            "operator": "equals",
            "value": "Realtor.com",
            "conditions": [
                {
                    "field": "tags",
                    "operator": "is_any_of",
                    "value": "08810, 08816"
                }
            ],
            "action": "redirect",
            "team_id": 11,
            "sequence_id": 456
        }
    ]
}
</pre>

<h3 id="update-routing">Update Routing</h3>

Send `rules` to replace the whole list, in order. Leave out `rules`, `team_id` or `sequence_id` to keep the current value. A `redirect` rule's optional `sequence_id` enrolls the lead in that sequence instead of the team's own; `sequence_id` at the top level does the same for a lead no rule matches. Use `null` (or leave a rule's out) for the team's sequence. Operators: `equals`, `contains`, `starts_with`, `ends_with`, `is_any_of`, `greater_than`, `greater_than_or_equal_to`, `less_than`, `less_than_or_equal_to`, `between` (with `value2`). `action` is `redirect` (send to `team_id`) or `ignore` (don't call).

**Endpoint**

<pre>PUT https://api.callingly.com/v1/integrations/{{id}}/routing
</pre>

**Sample Request**

<pre>{
    "team_id": 10,
    "rules": [
        {
            "field": "source",
            "operator": "equals",
            "value": "Realtor.com",
            "action": "redirect",
            "team_id": 11,
            "sequence_id": 456
        }
    ]
}
</pre>

<br>

<h2 id="sequences">Sequences</h2>

A sequence is the list of follow-up steps run for each lead. Each team has a default sequence; [Create Call](#create-call) and integration [routing rules](#update-routing) can enroll a lead in a different one. Managing sequences requires an owner, admin or manager API key.

<h3 id="list-sequences">List Sequences</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/sequences
</pre>

<h3 id="get-sequence">Get Sequence</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/sequences/{{id}}
</pre>

<h3 id="update-sequence">Update Sequence</h3>

`during_steps` (while the team is available) and `outside_steps` (after hours) each replace the whole list. In `during_steps`, step types are `wait` (`unit`: `immediately`, `minutes`, `hours`, `days` or `same_day`, with `value` and `time`), `ai-call`, `sms` (with `body`), `team`, `tag`, `untag`, `stage`, `owner` and `sequence`. A `call` step is saved as an `ai-call`. `outside_steps` takes at most one each of `sms`, `ai-call` and `sequence`. A wait before the first call or text can only use `immediately`, `minutes` or `hours`. A list can't end with a wait, a wait can't come right before `sequence`, and `sequence` must be the last step. Leave out a field to keep its current value.

**Endpoint**

<pre>PUT https://api.callingly.com/v1/sequences/{{id}}
</pre>

**Sample Request**

<pre>{
    "during_steps": [
        { "type": "ai-call" },
        { "type": "wait", "unit": "hours", "value": 2 },
        { "type": "ai-call" },
        { "type": "wait", "unit": "days", "value": 1, "time": "08:00" },
        { "type": "ai-call" }
    ]
}
</pre>

<br>

<h2 id="users">Users</h2>

<h3 id="list-users">List Users</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/agents?account_id=1
</pre>

**Sample response**

<pre>{
    "data": [
        {
            "id": 123,
            "account_id": 1,
            "name": "John Smith",
            "fname": "John",
            "lname": "Smith",
            "email": "john@example.com",
            "phone_number": "+16024819661",
            "ext": "",
            "donotdisturb": 0,
            "timezone": "America/Phoenix",
            "is_available": true
        }
    ],
    "count": 1
}
</pre>

<h3 id="get-agent-schedule">Get Agent Schedule</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/agents/{{id}}/schedule
</pre>

**Sample response**

<pre>[
    {
        "label": "Sunday",
        "day": 0,
        "is_available": false,
        "times": [
            {
                "start": "allday",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Monday",
        "day": 1,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Tuesday",
        "day": 2,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "12:00:00"
            },
            {
                "start": "12:00:00",
                "end": "23:45:00"
            }
        ]
    },
    {
        "label": "Wednesday",
        "day": 3,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Thursday",
        "day": 4,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "22:00:00"
            }
        ]
    },
    {
        "label": "Friday",
        "day": 5,
        "is_available": true,
        "times": [
            {
                "start": "allday",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Saturday",
        "day": 6,
        "is_available": true,
        "times": [
            {
                "start": "allday",
                "end": "20:00:00"
            }
        ]
    }
]
</pre>

<h3 id="create-agent">Create Agent</h3>

**Endpoint**

<pre>POST https://api.callingly.com/v1/agents
</pre>

**Sample request**

<pre>{
    "account_id": 1,
    "fname": "John",
    "lname": "Smith",
    "phone_number": "555-555-5555",
    "ext": "100",
    "timezone": "America/Phoenix"
}
</pre>

**Sample response**

<pre>{
    "success": true,
    "id": 124
}
</pre>

<h3 id="update-agent">Update Agent</h3>

**Endpoint**

<pre>PUT https://api.callingly.com/v1/agents/{{id}}
</pre>

**Sample request**

<pre>{
    "account_id": 1,
    "fname": "John",
    "lname": "Smith",
    "phone_number": "555-555-5555",
    "ext": "100",
    "timezone": "America/Phoenix",
    "donotdisturb": 1,
    "donotdisturb_until": "2021-01-25 22:00:00"
}
</pre>

<h3 id="delete-agent">Delete Agent</h3>

**Endpoint**

<pre>DELETE https://api.callingly.com/v1/agents/{{id}}
</pre>

<h3 id="update-schedule">Update Schedule</h3>

**Endpoint**

<pre>PUT https://api.callingly.com/v1/agents/{{id}}/schedule
</pre>

**Sample Request**

<pre>[
    {
        "label": "Sunday",
        "day": 0,
        "is_available": false,
        "times": [
            {
                "start": "allday",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Monday",
        "day": 1,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Tuesday",
        "day": 2,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "12:00:00"
            },
            {
                "start": "12:00:00",
                "end": "23:45:00"
            }
        ]
    },
    {
        "label": "Wednesday",
        "day": 3,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Thursday",
        "day": 4,
        "is_available": true,
        "times": [
            {
                "start": "06:00:00",
                "end": "22:00:00"
            }
        ]
    },
    {
        "label": "Friday",
        "day": 5,
        "is_available": true,
        "times": [
            {
                "start": "allday",
                "end": "20:00:00"
            }
        ]
    },
    {
        "label": "Saturday",
        "day": 6,
        "is_available": true,
        "times": [
            {
                "start": "allday",
                "end": "20:00:00"
            }
        ]
    }
]
</pre>

<br>

<h2 id="Webhooks-g-XU0">Webhooks</h2>

<div class="callout-blue mb-2"><span class="material-icons">tips_and_updates</span><div><strong>Auto-disable protection</strong>: Callingly automatically disables a webhook after 100 consecutive failed deliveries. This protects your queue from repeatedly attempting to deliver to an unreachable URL. You can re-enable a disabled webhook at any time — either from the Settings → Webhooks dashboard or via the API — which also resets the failure counter so the webhook gets a fresh start.</div></div>

<h3 id="List-All-Webhooks-vkO9i">List All Webhooks</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/webhooks
</pre>

**Sample Response**

<pre>[
    {
        "id": 1122,
        "account_id": 1,
        "name": "My Webhook 1",
        "event": "lead_updated",
        "target_url": "http://example.com/",
        "call_status": null,
        "call_lead_status": null,
        "team_id": 1,
        "number_id": null,
        "field": null,
        "filter": null,
        "is_active": true,
        "consecutive_failures": 0,
        "last_failed_at": null,
        "is_auto_disabled": false
    },
    {
        "id": 1123,
        "account_id": 1,
        "name": "My Webhook 2",
        "event": "call_completed",
        "target_url": "http://example.com/",
        "call_status": null,
        "call_lead_status": null,
        "team_id": 1,
        "number_id": null,
        "field": null,
        "filter": null,
        "is_active": false,
        "consecutive_failures": 100,
        "last_failed_at": "2026-05-10T14:32:00.000000Z",
        "is_auto_disabled": true
    },
]
</pre>

<h3 id="Get-a-Webhook-iB9fR">Get a Webhook</h3>

**Endpoint**

<pre>GET https://api.callingly.com/v1/webhooks/{{id}}
</pre>

**Sample Response**

<pre>{
    "id": 1123,
    "name": "My Webhook",
    "account_id": 1,
    "event": "call_completed",
    "target_url": "http://example.com/",
    "call_status": null,
    "call_lead_status": null,
    "team_id": 1,
    "number_id": null,
    "field": null,
    "filter": null,
    "is_active": true,
    "consecutive_failures": 0,
    "last_failed_at": null,
    "is_auto_disabled": false
}
</pre>

<br>

<h3 id="Create-a-Webhook-fv07m">Create a Webhook</h3>

**Endpoint**

<pre>POST https://api.callingly.com/v1/webhooks
</pre>

**Fields**

<table class="hs-table"><tbody><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Required</b></td><td><b>Example</b></td></tr><tr><td>name</td><td><p>string</p><br></td><td><b>Yes</b></td><td>My Webhook</td></tr><tr><td>event</td><td><p>string</p><ul><li>call_completed</li><li>call_accepted</li><li>ai_scheduled_call</li><li>lead_created</li><li>lead_updated</li><li>sms</li></ul><br></td><td><b>Yes</b></td><td>call_completed</td></tr><tr><td>target_url</td><td>string (url)</td><td><b>Yes</b></td><td>http://www.example.com/</td></tr><tr><td><p>direction</p><br><p><small>call_completed and sms events only</small></p></td><td><p>string | null</p><ul><li>outbound</li><li>inbound</li></ul></td><td>No</td><td>null</td></tr><tr><td><p>call_status</p><br><p><small>call_completed event only</small></p></td><td><p>string | null</p><ul><li>completed</li><li>missed</li><li>offline</li></ul></td><td>No</td><td>completed</td></tr><tr><td><p>call_lead_status</p><br><p><small>call_completed event only</small></p></td><td><p>string | null</p><ul><li>contacted</li><li>missed</li><li>removed</li><li>voicemail</li></ul></td><td>No</td><td>contacted</td></tr><tr><td><p>team_id</p><br><p><small>call_completed and ai_scheduled_call events only; not with number_id or an inbound direction</small></p></td><td>int | null</td><td>No</td><td>123</td></tr><tr><td><p>number_id</p><br><p><small>call_completed event only; not with team_id or an outbound direction</small></p></td><td>int | null</td><td>No</td><td>456</td></tr><tr><td><p>field - only trigger the webhook when the selected lead field has changed.</p><br><p><small>lead_updated event only</small></p></td><td><p>string | null</p><ul><li>lead_owner</li><li>result</li><li>stage</li><li>status</li><li>tags</li><li>fname</li><li>lname</li><li>email</li><li>company</li><li>category</li></ul></td><td>No</td><td>stage</td></tr><tr><td><p>filter - only trigger the webhook when the new value contains this text. Separate several with commas to match any of them.</p><br><p><small>lead_updated event only</small></p></td><td>string | null</td><td>No</td><td>called</td></tr></tbody></table>

**Sample Body**

<pre>{
    "name": "My Webhook",
    "event": "call_completed",
    "target_url": "http://example.com/",
    "team_id": 1
}
</pre>

**Sample Response**

<pre>{
    "id": 1124,
    "name": "My Webhook",
    "account_id": 1,
    "event": "call_completed",
    "target_url": "http://example.com/",
    "call_status": null,
    "call_lead_status": null,
    "team_id": 1,
    "number_id": null,
    "field": null,
    "filter": null,
    "is_active": true,
    "consecutive_failures": 0,
    "last_failed_at": null,
    "is_auto_disabled": false
}
</pre>

<br>

<h3 id="Update-a-Webhook-mvgYy">Update a Webhook</h3>

This endpoint supports partial updates: send only the fields you want to change. To change a filter that only some events use, such as `number_id`, also send `event`.

**Endpoint**

<pre>PUT https://api.callingly.com/v1/webhooks/{{id}}
</pre>

**Fields**

<table class="hs-table"><tbody><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Required</b></td><td><b>Example</b></td></tr><tr><td>name</td><td><p>string</p><br></td><td>No</td><td>My Webhook</td></tr><tr><td>event</td><td><p>string</p><ul><li>call_completed</li><li>call_accepted</li><li>ai_scheduled_call</li><li>lead_created</li><li>lead_updated</li><li>sms</li></ul><br></td><td>No</td><td>call_completed</td></tr><tr><td>target_url</td><td>string (url)</td><td>No</td><td>http://www.example.com/</td></tr><tr><td><p>direction</p><br><p><small>call_completed and sms events only</small></p></td><td><p>string | null</p><ul><li>outbound</li><li>inbound</li></ul></td><td>No</td><td>null</td></tr><tr><td><p>call_status</p><br><p><small>call_completed event only</small></p></td><td><p>string | null</p><ul><li>completed</li><li>missed</li><li>offline</li></ul></td><td>No</td><td>completed</td></tr><tr><td><p>call_lead_status</p><br><p><small>call_completed event only</small></p></td><td><p>string | null</p><ul><li>contacted</li><li>missed</li><li>removed</li><li>voicemail</li></ul></td><td>No</td><td>contacted</td></tr><tr><td><p>team_id</p><br><p><small>call_completed and ai_scheduled_call events only; not with number_id or an inbound direction</small></p></td><td>int | null</td><td>No</td><td>123</td></tr><tr><td><p>number_id</p><br><p><small>call_completed event only; not with team_id or an outbound direction</small></p></td><td>int | null</td><td>No</td><td>456</td></tr><tr><td><p>field - only trigger the webhook when the selected lead field has changed.</p><br><p><small>lead_updated event only</small></p></td><td><p>string | null</p><ul><li>lead_owner</li><li>result</li><li>stage</li><li>status</li><li>tags</li><li>fname</li><li>lname</li><li>email</li><li>company</li><li>category</li></ul></td><td>No</td><td>stage</td></tr><tr><td><p>filter - only trigger the webhook when the new value contains this text. Separate several with commas to match any of them.</p><br><p><small>lead_updated event only</small></p></td><td>string | null</td><td>No</td><td>called</td></tr><tr><td><p>is_active - enable or disable the webhook. Setting to <code>true</code> re-enables a disabled or auto-disabled webhook and resets the consecutive failure counter.</p></td><td>boolean</td><td>No</td><td>true</td></tr></tbody></table>

**Sample Body**

<pre>{
    "target_url": "http://example.com/new_url"
}
</pre>

**Sample Response**

<pre>{
    "id": 1124,
    "name": "My Webhook",
    "account_id": 1,
    "event": "call_completed",
    "target_url": "http://example.com/new_url",
    "call_status": null,
    "call_lead_status": null,
    "team_id": 1,
    "number_id": null,
    "field": null,
    "filter": null,
    "is_active": true,
    "consecutive_failures": 0,
    "last_failed_at": null,
    "is_auto_disabled": false
}
</pre>

<h3 id="Delete-a-Webhook-GyGhB">Delete a Webhook</h3>

**Endpoint**

<pre>DELETE https://api.callingly.com/v1/webhooks/{{id}}
</pre>

**Sample Response**

<pre>{
    "message": "Webhook deleted."
}
</pre>
