API Reference

Build on BlueSales. Manage Blues, business profiles, brains, leads, and more — all programmatically.

Base URLhttps://api-v2.bluesales.ai/functions/v1

Authentication

All requests require an X-API-Key header. Generate keys in Dashboard → API.

GET https://api-v2.bluesales.ai/functions/v1/api/blues
X-API-Key: bsk_your_api_key_here

Keep your key secret. Never expose it in client-side code. Each key has scoped permissions and rate limits.

Permissions

Each key has a set of permissions. Attempting an action without the required permission returns 403 Forbidden.

blues:read
blues:write
blues:delete
business_profiles:read
business_profiles:write
business_profiles:delete
brains:read
brains:write
brains:delete
products_services:read
products_services:write
products_services:delete
lead_lists:read
lead_lists:write
lead_lists:delete
leads:read
leads:write
leads:delete
phone_numbers:read
phone_numbers:write
calendar:read
calendar:write
calls:read
calls:write
compliance:read
compliance:write
account:read
billing:read

MCP — AI assistant access

Everything below is also exposed over the Model Context Protocol, so an AI assistant can run a BlueSales account directly — creating Blues, training brains, buying numbers, loading leads, placing calls and reading transcripts. The server speaks streamable HTTP at a single endpoint.

https://bluesales.ai/mcp

With an API key — for Claude Code, Claude Desktop, Cursor and any other client that sends headers. The key's permissions decide which tools the assistant can even see.

claude mcp add --transport http bluesales https://bluesales.ai/mcp \
  --header "X-API-Key: bsk_your_api_key_here"

With OAuth — add the same URL as a custom connector in Claude and approve it in the browser. The server supports dynamic client registration, PKCE and refresh tokens, so there is no key to paste or rotate. Connected clients are listed, and can be disconnected, in Dashboard → API → AI Access.

Buying a phone number, placing a call and booking an appointment reach the real world and cost money. The server tells the assistant to confirm those with you first — and a read-only key cannot perform them at all.

Blues

Blues are your AI voice agents. You can create them entirely via API, including creating their business profile, brain, and other resources in a single request using inline objects.

Outbound Blues require a product or service — pass product_service_id or an inline product_service. This applies to every outbound role, not just sales: an outbound Blue without one places calls whose results are never logged. It also can't be cleared later, and the product can't be deleted while an outbound Blue uses it.

blue_identity is limited to 40 characters (it becomes the voice assistant's name at the voice provider) and name to 100. first_saying substitutes <name> and <company name> — angle brackets, not {{first_name}}.

Creating or updating a Blue rebuilds its voice configuration before responding, which takes a few seconds. Edits that skip this never reach a live call.

Business Profiles

Brains

Knowledge bases for your Blues. Text and website brains can be created via API. File-based brains require the dashboard.

Products & Services

Lead Lists

Leads

Phone Numbers

Import phone numbers from your own Twilio account or read existing ones.

Voices

The shared catalogue of voices a Blue can speak with. Read-only, and the only endpoint that needs no permission on your API key — it contains no account data. Use the returned id as voice_id when you create or update a Blue.

Calendar

Supports Google Calendar, Microsoft Outlook, and a webhook (bring-your-own-calendar) mode for white-label setups where you hold your users' tokens yourself.

Calls

Trigger immediate outbound calls and retrieve call history programmatically.

Errors

All errors return JSON with an error string. Validation failures also carry errors[], one entry per problem, so you can fix everything in one retry.

{ "error": "Missing permission: blues:write" }
{
  "error": "2 problems: product_service_id, blue_identity.",
  "errors": [
    { "field": "product_service_id", "code": "required_for_outbound",
      "message": "Outbound Blues need a product or service." },
    { "field": "blue_identity", "code": "too_long",
      "message": "blue_identity is 52 characters; the maximum is 40." }
  ]
}
StatusMeaning
200OK
201Created
400Bad Request — missing or invalid fields
401Unauthorized — invalid or missing API key
403Forbidden — API key lacks required permission
404Not Found
405Method Not Allowed
409Conflict — blocked by the current state (e.g. a product still in use, or a call outside the calling window)
500Server Error

Need help? Open your API dashboard to manage keys and view request logs.

We use cookies to analyze site traffic and improve your experience. Privacy Policy