Connector keys

A connector key is for a server that sits on someone else's network or runs software you don't fully control, such as a phone system or dialer. It's sent as x-key and x-secret like an API key, but it's narrower:

  • It holds only the connector scopes: tts:synthesize, connect:trigger and sip:agent. Every route whose scopes don't include one of them refuses it.
  • It works only from the IP ranges in its allowed_cidrs.
  • It can carry a daily request cap and a daily spend cap.
  • The account owner and admins get an email the first time the key is used from a new address, and the first time a request from outside its ranges is refused. Each address is reported once. You can switch these emails off with the Connector key security account alert.
  • Its requests show in Settings > API Logs under the key's name, refused ones included. A refused request is logged without its body.

Creating, changing and revoking connector keys and presets needs account:write. Listing and reading them needs balance:read or account:write, so a read-only key can see them. Connector keys can't manage themselves, because no management route accepts a connector scope.

Method Route Scope What it does
POST /register/public/connector-keys account:write Create a key
GET /register/public/connector-keys balance:read or account:write List your connector keys
GET /register/public/connector-keys/{key_id} balance:read or account:write Get one key
PUT /register/public/connector-keys/{key_id} account:write Change a key's name, scopes, ranges or caps
POST /register/public/connector-keys/{key_id}/sip-secret account:write Replace a key's SIP secret
DELETE /register/public/connector-keys/{key_id} account:write Revoke a key

Create a connector key

Your account must be verified first. An account can have up to 25 connector keys.

curl -X POST https://api-v2.dropcowboy.com/register/public/connector-keys \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Office phone system",
    "scopes": ["tts:synthesize", "connect:trigger"],
    "allowed_cidrs": ["203.0.113.0/24", "2001:db8:1::/48"],
    "daily_request_cap": 5000,
    "daily_spend_cap_cents": 2500
  }'
Field Type Required Description
name string No Up to 100 characters. Defaults to "Connector key - " plus today's date.
scopes array Yes One or more of tts:synthesize, connect:trigger and sip:agent. Any other scope returns 400.
allowed_cidrs array No Up to 50 IPv4 or IPv6 addresses or CIDR ranges. Defaults to the single address you're calling from. See Allowed IP ranges.
open_to_any_ip boolean No Send true to confirm a key that works from any address. Required when allowed_cidrs includes 0.0.0.0/0 or ::/0. Sent without allowed_cidrs, it sets both.
daily_request_cap integer No The most requests the key can make per UTC day, from 1 to 10000000. null or left out for no cap.
daily_spend_cap_cents integer No The most the key can spend per UTC day, in cents, from 1 to 100000000. null or left out for no cap.
sip_preset_id string No A sip_agent preset that sets where the key's SIP calls can be transferred. null or left out for none.
max_concurrent integer No The most SIP calls the key can have connected at once, from 1 to 10000. null or left out for no cap.
max_cps integer No The most new SIP calls the key can start per second, from 1 to 1000. null or left out for no cap.
daily_minute_cap integer No The most SIP call minutes the key can use per UTC day, from 1 to 1000000. null or left out for no cap.

The route answers 201 with the key and its secret. Store the secret now. It isn't shown again. A key with the sip:agent scope also gets a sip_secret, which is shown only once too. See SIP login.

{
  "data": {
    "key_id": "6c2e8a4f-1b7d-4e3a-9c5f-8d2b6e1a4c73",
    "name": "Office phone system",
    "key": "9a4d1f7c-3e8b-4c2a-b6d5-1f9e3a7c5d82",
    "secret": "e7b3c9a1-5d2f-4a8e-9b6c-3d1f7e5a2c94",
    "scopes": ["tts:synthesize", "connect:trigger"],
    "allowed_cidrs": ["203.0.113.0/24", "2001:db8:1::/48"],
    "open_to_any_ip": false,
    "daily_request_cap": 5000,
    "daily_spend_cap_cents": 2500,
    "sip": null,
    "sip_preset_id": null,
    "max_concurrent": null,
    "max_cps": null,
    "daily_minute_cap": null,
    "usage_today": { "requests": 0, "spend_cents": 0 },
    "last_used_ip": null,
    "last_used_at": null,
    "created_at": 1774041600000,
    "updated_at": 1774041600000
  },
  "meta": { "request_id": "c2a6e8f4-3b9d-4c1e-8a7f-5d3b1e9c6a24" }
}
Field Type Description
key_id string The key's id. Pass it to the get, update and revoke routes.
key string The x-key value.
secret string The x-secret value, in the create response only.
scopes array The connector scopes the key holds.
allowed_cidrs array The ranges the key works from, as stored.
open_to_any_ip boolean true when allowed_cidrs includes 0.0.0.0/0 or ::/0.
daily_request_cap integer The daily request cap, or null.
daily_spend_cap_cents integer The daily spend cap in cents, or null.
sip object The key's SIP login without its secret: username, realm, secret_hint (the secret's last 4 characters) and rotated_at in epoch milliseconds. null for a key that has never held sip:agent.
sip_secret string The SIP password. Only in the response that created it: creating a key with sip:agent, first adding sip:agent to a key, or replacing the secret.
sip_preset_id string The key's sip_agent preset, or null.
max_concurrent, max_cps, daily_minute_cap integer The key's SIP call caps, or null.
usage_today object requests and spend_cents so far this UTC day.
last_used_ip string The address of the key's last accepted request, or null.
last_used_at integer When the key was last used, in epoch milliseconds, or null.
created_at, updated_at integer Epoch milliseconds.

The list and get routes return the same fields without secret or sip_secret.

SIP login

A key with the sip:agent scope can connect calls to your published AI agents over SIP, using digest authentication:

  • The username is the key's key_id.
  • The realm is sip.dropcowboy.com.
  • The password is the sip_secret.

SIP calls to AI agents are enabled per account. Until yours has them, the sip:agent scope, the SIP fields and sip_agent presets return 403 with problem type sip-agent-unavailable, and keys are returned without the SIP fields.

We keep only a hash of the secret, so it can't be shown again. If you lose it, or think someone else has it, replace it:

curl -X POST https://api-v2.dropcowboy.com/register/public/connector-keys/6c2e8a4f-1b7d-4e3a-9c5f-8d2b6e1a4c73/sip-secret \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET"

The response is the key with its new sip_secret. The old SIP secret stops working at once, and calls fail until your phone system has the new one. The key's secret doesn't change. A key without the sip:agent scope returns 400.

The key's allowed_cidrs apply to SIP calls too. Removing sip:agent from a key stops its SIP login. Adding the scope back brings back the same SIP secret, so replace it if you're not sure who has it.

Allowed IP ranges

  • Each entry is an IPv4 or IPv6 address or CIDR range, such as 203.0.113.0/24 or 2001:db8::/32. A bare address is stored as /32 or /128.
  • Ranges are normalized when saved: host bits are cleared, so 203.0.113.7/24 is stored as 203.0.113.0/24, and IPv6 is written in short lower-case form. Duplicates are dropped.
  • An invalid entry, an empty list or more than 50 entries returns 400, and detail names the bad entries.
  • 0.0.0.0/0 allows any IPv4 address and ::/0 any IPv6 address. A request that sets either one must also send open_to_any_ip: true, or it returns 400 open-range-needs-confirmation. Any range that covers every address, such as 198.51.100.9/0, counts as one of these. The key then shows open_to_any_ip: true. Use them only when the server's address really can't be pinned down.
  • open_to_any_ip: true without allowed_cidrs sets both 0.0.0.0/0 and ::/0. Sent with ranges that don't include either one, it returns 400.
  • The address checked is the one that connects to the API. Headers such as X-Forwarded-For are ignored, so a proxy in front of your server must use an address in the list.

Change or revoke a connector key

PUT /register/public/connector-keys/{key_id} changes only the fields you send: name, scopes, allowed_cidrs, daily_request_cap, daily_spend_cap_cents, sip_preset_id, max_concurrent, max_cps or daily_minute_cap. null clears a cap or the preset. Opening a key to any address needs open_to_any_ip: true, as on create. Changing other fields on a key that's already open doesn't. The key and secret don't change, so the server using them needs no update. The response is the key, without secret. It includes sip_secret only when this change first gives the key sip:agent.

curl -X PUT https://api-v2.dropcowboy.com/register/public/connector-keys/6c2e8a4f-1b7d-4e3a-9c5f-8d2b6e1a4c73 \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"allowed_cidrs": ["198.51.100.20"], "daily_spend_cap_cents": null}'

DELETE /register/public/connector-keys/{key_id} revokes the key. It stops working immediately and returns {"key_id": "...", "revoked": true}. An unknown key_id returns 404.

Connector key errors

Status Problem type When What to do
400 validation-error A field is invalid when you create or change a key. detail names it. Fix the field and send the request again
400 open-range-needs-confirmation allowed_cidrs includes 0.0.0.0/0 or ::/0 without open_to_any_ip: true Send open_to_any_ip: true if the key really must work from any address. Otherwise list your server's ranges.
401 unauthorized Wrong key or secret, or a revoked key Check the headers, or create a new key
403 ip-not-allowed The request came from outside every range in allowed_cidrs. detail names the address. Add the address to allowed_cidrs if it's yours. If it isn't, revoke the key.
403 insufficient-scope The route doesn't accept connector keys, or accepts a connector scope the key lacks Use an API key for that route, or add the scope to the connector key
429 daily-cap-reached The key reached a daily cap. details.cap is daily_request_cap or daily_spend_cap_cents. Wait for 00:00 UTC, or raise the cap
503 service-unavailable The caps couldn't be checked Retry after a few seconds

Connector presets

A preset fixes what a connector can send: the action, the content, the phone line, which call dispositions may trigger it and the consent rule. Creating one returns a send_token that names the preset. A connector holding that token can send that one approved message, and nothing else.

Method Route Scope What it does
POST /register/public/connector-presets account:write Create a preset
GET /register/public/connector-presets balance:read or account:write List presets, newest first
GET /register/public/connector-presets/{preset_id} balance:read or account:write Get one preset
PUT /register/public/connector-presets/{preset_id} account:write Rename a preset, or change a sip_agent preset's transfers
DELETE /register/public/connector-presets/{preset_id} account:write Revoke a preset and its send token
curl -X POST https://api-v2.dropcowboy.com/register/public/connector-presets \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "No-answer voicemail",
    "action": "rvm",
    "media_id": "6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c",
    "phone_line_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "allowed_dispositions": ["NA", "B"],
    "consent_rule": { "type": "lead_field", "field": "rvm_optin", "value": "Y" }
  }'
Field Type Required Description
name string No Up to 100 characters. Defaults to "Connector preset - " plus today's date.
action string Yes rvm, sms, voice_broadcast, ai_broadcast or sip_agent. A sip_agent preset takes different fields: see SIP agent presets.
media_id string See below A recording, for rvm and voice_broadcast.
tts_body and voice_id string See below Text to speak (up to 1200 characters) and the voice to speak it, for rvm and voice_broadcast, instead of media_id.
template_id string For sms The text template.
agent_id string For ai_broadcast The AI agent.
phone_line_id string Yes The phone line to send from.
allowed_dispositions array No Up to 100 disposition codes, each up to 64 characters, that may trigger the send. Leave it out to allow any disposition. An empty list returns 400.
consent_rule object Yes {"type": "lead_field", "field": "<field>", "value": "<value>"} sends only when the lead's field holds that value. field is up to 64 letters, digits, _, . or -, and value is up to 256 characters. {"type": "team_attestation"} relies on your account's own consent attestation.

Each action takes exactly one kind of content: rvm and voice_broadcast take media_id or tts_body with voice_id, sms takes template_id, and ai_broadcast takes agent_id. Content an action doesn't use returns 400. All ids are UUIDs. An account can have up to 100 presets.

Every id must be one your account can use, or the route returns 400 validation-error with detail naming the field:

  • media_id is a recording on your account that has finished uploading.
  • voice_id is one of your voices or a library voice from GET /voice/public/voices.
  • template_id is a template on your account. A template limited to certain channels must include SMS or RCS.
  • agent_id is an active, published AI agent on your account.
  • phone_line_id is a phone line on your account from GET /phone/public/lines. For sms it must have an SMS campaign.

They're checked when you create the preset. Deleting one of them later doesn't revoke the preset, so revoke it and create a new one.

The route answers 201:

{
  "data": {
    "preset_id": "b8e4a2c6-7d1f-4e9b-a3c5-2f6d8b1e4a97",
    "name": "No-answer voicemail",
    "action": "rvm",
    "content": { "media_id": "6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c" },
    "phone_line_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "allowed_dispositions": ["NA", "B"],
    "consent_rule": { "type": "lead_field", "field": "rvm_optin", "value": "Y" },
    "send_token": "4d9c2a7e-6b1f-4e3d-8a5c-9f2e7b4d1a63",
    "send_token_hint": "1a63",
    "created_at": 1774041600000,
    "updated_at": 1774041600000
  },
  "meta": { "request_id": "c2a6e8f4-3b9d-4c1e-8a7f-5d3b1e9c6a24" }
}

send_token appears only in this response. We keep only a hash of it, so it can't be shown again; send_token_hint is its last 4 characters.

PUT /register/public/connector-presets/{preset_id} with {"name": "..."} renames a preset. What a preset sends can't change: any other field returns 400. To send something else, create a new preset and revoke the old one, which stops its token working.

SIP agent presets

A sip_agent preset sets where an AI agent can hand back a call that came in over a key's SIP login. It has no send token. To use it, set the key's sip_preset_id.

curl -X POST https://api-v2.dropcowboy.com/register/public/connector-presets \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Front desk transfers",
    "action": "sip_agent",
    "refer_targets": [
      { "name": "sales", "user": "2001" },
      { "name": "billing", "user": "billing.queue" }
    ],
    "outcome_routes": { "booked": "2001", "not_interested": "" }
  }'
Field Type Required Description
name string No Up to 100 characters.
action string Yes sip_agent.
refer_targets array No Up to 20 transfers the agent can choose during the call. name is what the agent picks: 1 to 32 lowercase letters, digits or _, starting with a letter, each used once. user is the extension or SIP user on your phone system the call is sent back to: 1 to 64 letters, digits, +, *, _, . or -.
outcome_routes object No Up to 50 entries mapping an outcome the agent reports to the user the call goes back to when the agent finishes. Each outcome is 1 to 64 lowercase letters, digits or _, starting with a letter. An empty string hangs up instead.

A sip_agent preset doesn't take media_id, tts_body, voice_id, template_id, agent_id, phone_line_id, allowed_dispositions or consent_rule, and sending any of them returns 400. refer_targets and outcome_routes work only on a sip_agent preset.

The response has the same fields as other presets, plus refer_targets and outcome_routes. content is {}, and phone_line_id, consent_rule and send_token_hint are null.

You can change a sip_agent preset in place. PUT accepts name, refer_targets and outcome_routes, and replaces each field you send. Keys using the preset pick up the change for their next call. Revoking the preset clears it from every key that used it.


API access is subject to rate limits and usage policies. API availability, endpoints, and features may change with notice. Breaking changes will be communicated via changelog with migration period when possible. API keys must be kept secure. Customers are responsible for all activity under their API credentials.

Code samples

The requests from this page, ready to copy. Set DC_KEY and DC_SECRET to your API key pair first.

Create a connector key
curl -X POST https://api-v2.dropcowboy.com/register/public/connector-keys \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Office phone system",
    "scopes": ["tts:synthesize", "connect:trigger"],
    "allowed_cidrs": ["203.0.113.0/24", "2001:db8:1::/48"],
    "daily_request_cap": 5000,
    "daily_spend_cap_cents": 2500
  }'
SIP login
curl -X POST https://api-v2.dropcowboy.com/register/public/connector-keys/6c2e8a4f-1b7d-4e3a-9c5f-8d2b6e1a4c73/sip-secret \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET"
Change or revoke a connector key
curl -X PUT https://api-v2.dropcowboy.com/register/public/connector-keys/6c2e8a4f-1b7d-4e3a-9c5f-8d2b6e1a4c73 \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"allowed_cidrs": ["198.51.100.20"], "daily_spend_cap_cents": null}'
Connector presets
curl -X POST https://api-v2.dropcowboy.com/register/public/connector-presets \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "No-answer voicemail",
    "action": "rvm",
    "media_id": "6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c",
    "phone_line_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "allowed_dispositions": ["NA", "B"],
    "consent_rule": { "type": "lead_field", "field": "rvm_optin", "value": "Y" }
  }'
SIP agent presets
curl -X POST https://api-v2.dropcowboy.com/register/public/connector-presets \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Front desk transfers",
    "action": "sip_agent",
    "refer_targets": [
      { "name": "sales", "user": "2001" },
      { "name": "billing", "user": "billing.queue" }
    ],
    "outcome_routes": { "booked": "2001", "not_interested": "" }
  }'