Skip to main content

Agents

Every call needs Authorization: Bearer <key>. 7 calls:

Choose an agent’s model​

Each agent answers with an AI model. bubbl3 turns models on and picks a default for AI agents; you choose one of those models for each agent under Model on the agent’s page, then Save changes. New agents start on the default, which the list marks.

  • The list shows only the models bubbl3 has turned on for your workspace. A workspace with the HIPAA add-on only sees models covered by a business associate agreement.
  • To answer, the agent sends the model exactly this, and nothing from other conversations or contacts:
    • the agent’s instructions;
    • the conversation’s recent messages (the last 30);
    • the contact’s name, when a contact tool (Read the contact, Search contacts, Update the contact) or List conversations reads it;
    • the contact’s phone number, only when Update the contact or Check iMessage is on. Otherwise it’s hidden in every common format (with or without +1, spaces, dashes, dots or brackets) everywhere in the request: messages, tool results and custom fields. Search contacts then doesn’t match on it;
    • with the optional contact tools (Read the contact, Search contacts, Update the contact) on, the contact’s email, company, custom fields and labels;
    • with List conversations on, the contact’s name, company and labels and a preview of the conversation’s last message.
  • If bubbl3 turns an agent’s model off, the agent uses the default from its next run, and its page says so: “This agent’s model was turned off; it now uses …”. Saving the agent keeps its model, so it goes back to it once the model is on again.
  • If there’s no model left for your workspace, the page says AI agents can’t answer until bubbl3 turns one on, and each conversation the agent would answer goes to a person instead, with the reason “No model available” on the run. A model turned off while a run is going ends that run the same way, with “Model turned off during the run”.
  • Each run on the Runs tab shows the model it used.

From the API, call List the models this workspace’s agents can use and send one of its ids as the agent’s model when you create or edit it. Any other model is refused with a 400 on model.

List the models this workspace’s agents can use​

GET /v1/agent-models

The AI models bubbl3 has turned on that this workspace may use, with the AI agents default marked. A workspace with the HIPAA add-on only sees models whose provider is covered by a business associate agreement. When the list is empty, agents hand every conversation to a person until bubbl3 turns a model on. An agent whose model is turned off later uses the default.

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.

Response 200

FieldTypeDescription
dataobject[]
data[].defaultboolean
data[].idstring
data[].namestring
data[].provider_namestring
default_modelstring or null
hipaaboolean
unavailableenum or nullOne of: none_enabled, hipaa_no_baa, no_default.

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.

List agent runs, newest first​

GET /v1/agent-runs

Query parameters

NameTypeRequiredDescription
limitintegerNoFrom 1 to 100. Default 50.
cursorstringNoOpaque cursor from next_cursor. Up to 512 characters.
agent_idstring (uuid)No
conversation_idstringNoConversation id (cnv_...).
outcomeenumNoOne of: running, resolved, handoff, error.

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.

Response 200

FieldTypeDescription
dataobject[]
data[].agent_idstring (uuid)
data[].conversation_idstring or nullConversation id (cnv_...).
data[].error_codestring or null
data[].finished_atstring (date-time) or nullISO 8601 timestamp.
data[].handoff_reasonstring or null
data[].idstring (uuid)
data[].input_tokensintegerFrom 0 to 9007199254740991.
data[].modelstring or null
data[].outcomeenum or nullOne of: running, resolved, handoff, error.
data[].output_tokensintegerFrom 0 to 9007199254740991.
data[].shadowboolean
data[].started_atstring (date-time)ISO 8601 timestamp.
data[].tool_callsintegerFrom 0 to 9007199254740991.
data[].trigger_message_idstring or nullMessage id (msg_...).
data[].turnsintegerFrom 0 to 9007199254740991.
data[].workflow_run_idstring (uuid) or null
next_cursorstring or nullPass as cursor to get the next page; null at the end.

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.

Get an agent run and its steps​

GET /v1/agent-runs/:id

What the agent said appears in the steps only for callers who can read conversations.

Path parameters

NameTypeRequiredDescription
idstring (uuid)Yes

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.

Response 200

FieldTypeDescription
agent_idstring (uuid)
conversation_idstring or nullConversation id (cnv_...).
error_codestring or null
finished_atstring (date-time) or nullISO 8601 timestamp.
handoff_reasonstring or null
idstring (uuid)
input_tokensintegerFrom 0 to 9007199254740991.
modelstring or null
outcomeenum or nullOne of: running, resolved, handoff, error.
output_tokensintegerFrom 0 to 9007199254740991.
shadowboolean
started_atstring (date-time)ISO 8601 timestamp.
stepsobject[]
steps[].atstring (date-time)ISO 8601 timestamp.
steps[].codestring
steps[].detailobject
steps[].kindenumOne of: model, tool, message, handoff, guard.
steps[].statusenumOne of: ok, refused, failed, shadowed.
steps[].toolstring
tool_callsintegerFrom 0 to 9007199254740991.
trigger_message_idstring or nullMessage id (msg_...).
turnsintegerFrom 0 to 9007199254740991.
workflow_run_idstring (uuid) or null

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.

List AI agents, newest first​

GET /v1/agents

Query parameters

NameTypeRequiredDescription
limitintegerNoFrom 1 to 100. Default 50.
cursorstringNoOpaque cursor from next_cursor. Up to 512 characters.
statusenumNoOne of: draft, shadow, live, paused.

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.

Response 200

FieldTypeDescription
dataobject[]
data[].created_atstring (date-time)ISO 8601 timestamp.
data[].handoff_rulesobject
data[].handoff_rules.keywordsstring[]Hand off, without asking the model, when the contact’s message has one of these. Up to 50 items.
data[].handoff_rules.max_turnsintegerFrom 1 to 100.
data[].handoff_rules.on_low_confidencebooleanHand off when the model answers with neither text nor a tool call. Default true.
data[].handoff_rules.team_idstring (uuid) or nullTeam the conversation is assigned to on handoff.
data[].handoff_rules.user_idstring (uuid) or nullPerson the conversation is assigned to on handoff.
data[].idstring (uuid)
data[].instructionsstring
data[].limitsobject
data[].limits.max_messages_per_conversationintegerFrom 1 to 100.
data[].limits.max_runs_per_conversation_per_dayintegerFrom 1 to 200.
data[].limits.max_tokens_per_runintegerFrom 1 to 200000.
data[].limits.max_tool_calls_per_runintegerFrom 1 to 20.
data[].limits.max_turns_per_runintegerFrom 1 to 10.
data[].modelstring
data[].model_fallbackboolean
data[].model_in_useobject or null
data[].model_in_use.idstring
data[].model_in_use.namestring
data[].namestring
data[].pool_idsstring[]
data[].runs_7dobject
data[].runs_7d.conversationsintegerFrom 0 to 9007199254740991.
data[].runs_7d.errorintegerFrom 0 to 9007199254740991.
data[].runs_7d.handoffintegerFrom 0 to 9007199254740991.
data[].runs_7d.resolvedintegerFrom 0 to 9007199254740991.
data[].runs_7d.totalintegerFrom 0 to 9007199254740991.
data[].statusenumOne of: draft, shadow, live, paused.
data[].toolsenum[]
data[].updated_atstring (date-time)ISO 8601 timestamp.
data[].usable_toolsenum[]
next_cursorstring or nullPass as cursor to get the next page; null at the end.

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.

Create an AI agent​

POST /v1/agents

Creates the agent and the service identity its tool calls run with. You can only give it tools your own role can use, and they stay capped by your role. Live and shadow agents need at least one pool. model must be one of GET /v1/agent-models; without it the agent starts on the AI agents default. Signed-in members only: API keys are refused.

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.
idempotency-keystringNoMakes the write safe to retry for 24 hours. 1 to 255 printable characters. Keys starting with outreach:, workflow: or agent: are reserved for messages bubbl3 sends itself and are refused with 400. Up to 255 characters.

Request body

FieldTypeRequiredDescription
handoff_rulesobjectNoDefault {"keywords":[],"on_low_confidence":true}.
handoff_rules.keywordsstring[]NoHand off, without asking the model, when the contact’s message has one of these. Up to 50 items.
handoff_rules.max_turnsintegerNoFrom 1 to 100.
handoff_rules.on_low_confidencebooleanNoHand off when the model answers with neither text nor a tool call. Default true.
handoff_rules.team_idstring (uuid) or nullNoTeam the conversation is assigned to on handoff.
handoff_rules.user_idstring (uuid) or nullNoPerson the conversation is assigned to on handoff.
instructionsstringNoUp to 20000 characters.
limitsobjectNoDefault {}.
limits.max_messages_per_conversationintegerNoFrom 1 to 100.
limits.max_runs_per_conversation_per_dayintegerNoFrom 1 to 200.
limits.max_tokens_per_runintegerNoFrom 1 to 200000.
limits.max_tool_calls_per_runintegerNoFrom 1 to 20.
limits.max_turns_per_runintegerNoFrom 1 to 10.
modelstringNoUp to 100 characters.
namestringYesUp to 80 characters.
pool_idsstring[]NoUp to 50 items.
statusenumNoOne of: draft, shadow, live. Default "draft".
toolsenum[]NoUp to 20 items.

Response 201

FieldTypeDescription
created_atstring (date-time)ISO 8601 timestamp.
handoff_rulesobject
handoff_rules.keywordsstring[]Hand off, without asking the model, when the contact’s message has one of these. Up to 50 items.
handoff_rules.max_turnsintegerFrom 1 to 100.
handoff_rules.on_low_confidencebooleanHand off when the model answers with neither text nor a tool call. Default true.
handoff_rules.team_idstring (uuid) or nullTeam the conversation is assigned to on handoff.
handoff_rules.user_idstring (uuid) or nullPerson the conversation is assigned to on handoff.
idstring (uuid)
instructionsstring
limitsobject
limits.max_messages_per_conversationintegerFrom 1 to 100.
limits.max_runs_per_conversation_per_dayintegerFrom 1 to 200.
limits.max_tokens_per_runintegerFrom 1 to 200000.
limits.max_tool_calls_per_runintegerFrom 1 to 20.
limits.max_turns_per_runintegerFrom 1 to 10.
modelstring
model_fallbackboolean
model_in_useobject or null
model_in_use.idstring
model_in_use.namestring
namestring
pool_idsstring[]
runs_7dobject
runs_7d.conversationsintegerFrom 0 to 9007199254740991.
runs_7d.errorintegerFrom 0 to 9007199254740991.
runs_7d.handoffintegerFrom 0 to 9007199254740991.
runs_7d.resolvedintegerFrom 0 to 9007199254740991.
runs_7d.totalintegerFrom 0 to 9007199254740991.
statusenumOne of: draft, shadow, live, paused.
toolsenum[]
updated_atstring (date-time)ISO 8601 timestamp.
usable_toolsenum[]

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.

Get an AI agent​

GET /v1/agents/:id

Path parameters

NameTypeRequiredDescription
idstring (uuid)Yes

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.

Response 200

FieldTypeDescription
created_atstring (date-time)ISO 8601 timestamp.
handoff_rulesobject
handoff_rules.keywordsstring[]Hand off, without asking the model, when the contact’s message has one of these. Up to 50 items.
handoff_rules.max_turnsintegerFrom 1 to 100.
handoff_rules.on_low_confidencebooleanHand off when the model answers with neither text nor a tool call. Default true.
handoff_rules.team_idstring (uuid) or nullTeam the conversation is assigned to on handoff.
handoff_rules.user_idstring (uuid) or nullPerson the conversation is assigned to on handoff.
idstring (uuid)
instructionsstring
limitsobject
limits.max_messages_per_conversationintegerFrom 1 to 100.
limits.max_runs_per_conversation_per_dayintegerFrom 1 to 200.
limits.max_tokens_per_runintegerFrom 1 to 200000.
limits.max_tool_calls_per_runintegerFrom 1 to 20.
limits.max_turns_per_runintegerFrom 1 to 10.
modelstring
model_fallbackboolean
model_in_useobject or null
model_in_use.idstring
model_in_use.namestring
namestring
pool_idsstring[]
runs_7dobject
runs_7d.conversationsintegerFrom 0 to 9007199254740991.
runs_7d.errorintegerFrom 0 to 9007199254740991.
runs_7d.handoffintegerFrom 0 to 9007199254740991.
runs_7d.resolvedintegerFrom 0 to 9007199254740991.
runs_7d.totalintegerFrom 0 to 9007199254740991.
statusenumOne of: draft, shadow, live, paused.
toolsenum[]
updated_atstring (date-time)ISO 8601 timestamp.
usable_toolsenum[]

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.

Edit an AI agent, or turn it on, put it in shadow or pause it​

PATCH /v1/agents/:id

Changing its tools or pools makes you the member whose role caps them. A new model must be one of GET /v1/agent-models; sending the agent’s current model, even one that was turned off, keeps it. Moving a live agent to any other status hands its conversations back to people. A paused organisation can still pause an agent. Signed-in members only: API keys are refused.

Path parameters

NameTypeRequiredDescription
idstring (uuid)Yes

Headers

NameTypeRequiredDescription
x-workspace-idstringNoWorkspace for session (JWT) callers. API keys carry their own workspace.
idempotency-keystringNoMakes the write safe to retry for 24 hours. 1 to 255 printable characters. Keys starting with outreach:, workflow: or agent: are reserved for messages bubbl3 sends itself and are refused with 400. Up to 255 characters.

Request body

FieldTypeRequiredDescription
handoff_rulesobjectNo
handoff_rules.keywordsstring[]NoHand off, without asking the model, when the contact’s message has one of these. Up to 50 items.
handoff_rules.max_turnsintegerNoFrom 1 to 100.
handoff_rules.on_low_confidencebooleanNoHand off when the model answers with neither text nor a tool call. Default true.
handoff_rules.team_idstring (uuid) or nullNoTeam the conversation is assigned to on handoff.
handoff_rules.user_idstring (uuid) or nullNoPerson the conversation is assigned to on handoff.
instructionsstringNoUp to 20000 characters.
limitsobjectNo
limits.max_messages_per_conversationintegerNoFrom 1 to 100.
limits.max_runs_per_conversation_per_dayintegerNoFrom 1 to 200.
limits.max_tokens_per_runintegerNoFrom 1 to 200000.
limits.max_tool_calls_per_runintegerNoFrom 1 to 20.
limits.max_turns_per_runintegerNoFrom 1 to 10.
modelstringNoUp to 100 characters.
namestringNoUp to 80 characters.
pool_idsstring[]NoUp to 50 items.
statusenumNoOne of: draft, shadow, live, paused.
toolsenum[]NoUp to 20 items.

Response 200

FieldTypeDescription
created_atstring (date-time)ISO 8601 timestamp.
handoff_rulesobject
handoff_rules.keywordsstring[]Hand off, without asking the model, when the contact’s message has one of these. Up to 50 items.
handoff_rules.max_turnsintegerFrom 1 to 100.
handoff_rules.on_low_confidencebooleanHand off when the model answers with neither text nor a tool call. Default true.
handoff_rules.team_idstring (uuid) or nullTeam the conversation is assigned to on handoff.
handoff_rules.user_idstring (uuid) or nullPerson the conversation is assigned to on handoff.
idstring (uuid)
instructionsstring
limitsobject
limits.max_messages_per_conversationintegerFrom 1 to 100.
limits.max_runs_per_conversation_per_dayintegerFrom 1 to 200.
limits.max_tokens_per_runintegerFrom 1 to 200000.
limits.max_tool_calls_per_runintegerFrom 1 to 20.
limits.max_turns_per_runintegerFrom 1 to 10.
modelstring
model_fallbackboolean
model_in_useobject or null
model_in_use.idstring
model_in_use.namestring
namestring
pool_idsstring[]
runs_7dobject
runs_7d.conversationsintegerFrom 0 to 9007199254740991.
runs_7d.errorintegerFrom 0 to 9007199254740991.
runs_7d.handoffintegerFrom 0 to 9007199254740991.
runs_7d.resolvedintegerFrom 0 to 9007199254740991.
runs_7d.totalintegerFrom 0 to 9007199254740991.
statusenumOne of: draft, shadow, live, paused.
toolsenum[]
updated_atstring (date-time)ISO 8601 timestamp.
usable_toolsenum[]

Errors: 400, 401, 403, 404, 409, 413, 415, 429, 500. See errors for the shape and codes.