API reference
Actions
What an agent can do beyond answering, and what its forms gathered.
GET /agents/{agent_id}/actions
List an agent's actions
What the agent can do beyond answering: HTTP calls on verified hosts, collect-data forms, client tools the host page runs, integrations. The headers an HTTP action sends are never returned, only their names.
Scope: agents:read
Parameters
agent_idrequired in the path ·string
Returns ActionOut
idrequiredstringId
agent_idrequiredstringAgent Id
namerequiredstringName
kindrequiredstringhttp, collect_data, client_tool or integration.
description_enrequiredstringDescription En
description_arrequiredstringDescription Ar
methodrequiredstringMethod
url_templaterequiredstringUrl Template
hostrequiredstringHost
host_verifiedrequiredbooleanHost Verified
input_schemarequiredobjectInput Schema
output_pickrequiredstring[]Output Pick
data_accessrequiredstringData Access
requires_approvalrequiredbooleanRequires Approval
enabledrequiredbooleanEnabled
has_headersrequiredbooleanHas Headers
header_namesrequiredstring[]Header Names
created_atoptionalstringCreated At
updated_atoptionalstringUpdated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/agents/AGENT_ID/actions \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"POST /agents/{agent_id}/actions
Create an action
A new action, switched off unless enabled is true (an HTTP action switches on only once its host is verified). The plan caps actions per agent (402 plan_required beyond it).
Scope: agents:write
Parameters
agent_idrequired in the path ·string
Request body
nameoptionalstringName
kindoptionalstringKind
description_enoptionalstringDescription En
description_aroptionalstringDescription Ar
methodoptionalstringMethod
url_templateoptionalstringUrl Template
headersoptionalobjectHeaders
input_schemaoptionalobjectInput Schema
output_pickoptional[]Output Pick
data_accessoptionalstringData Access
requires_approvaloptionalbooleanRequires Approval
enabledoptionalbooleanEnabled
configoptionalobjectConfig
Returns ActionOut
idrequiredstringId
agent_idrequiredstringAgent Id
namerequiredstringName
kindrequiredstringhttp, collect_data, client_tool or integration.
description_enrequiredstringDescription En
description_arrequiredstringDescription Ar
methodrequiredstringMethod
url_templaterequiredstringUrl Template
hostrequiredstringHost
host_verifiedrequiredbooleanHost Verified
input_schemarequiredobjectInput Schema
output_pickrequiredstring[]Output Pick
data_accessrequiredstringData Access
requires_approvalrequiredbooleanRequires Approval
enabledrequiredbooleanEnabled
has_headersrequiredbooleanHas Headers
header_namesrequiredstring[]Header Names
created_atoptionalstringCreated At
updated_atoptionalstringUpdated At
Responses
201Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.402plan_required: the agent already has as many actions as its plan allows, or the action waits for approval and the plan has no helpdesk;required_plannames the plan to move to. On the plan that holds the most actions there is none:required_planis absent and the way out is removing one.409name_taken: another action of this agent has that name.
curl -X POST https://www.bidii.ai/api/v2/agents/AGENT_ID/actions \
-H "Authorization: Bearer bidi_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "open_cart", "kind": "client_tool", "description_en": "Open the cart on this page.", "description_ar": "يفتح سلة المشتريات في هذه الصفحة."}'PATCH /agents/{agent_id}/actions/{action_id}
Update an action
Any field, enabled, or headers (they replace the stored ones; {} removes them).
Scope: agents:write
Parameters
agent_idrequired in the path ·stringaction_idrequired in the path ·string
Request body
nameoptionalstringName
kindoptionalstringKind
description_enoptionalstringDescription En
description_aroptionalstringDescription Ar
methodoptionalstringMethod
url_templateoptionalstringUrl Template
headersoptionalobjectHeaders
input_schemaoptionalobjectInput Schema
output_pickoptional[]Output Pick
data_accessoptionalstringData Access
requires_approvaloptionalbooleanRequires Approval
enabledoptionalbooleanEnabled
configoptionalobjectConfig
Returns ActionOut
idrequiredstringId
agent_idrequiredstringAgent Id
namerequiredstringName
kindrequiredstringhttp, collect_data, client_tool or integration.
description_enrequiredstringDescription En
description_arrequiredstringDescription Ar
methodrequiredstringMethod
url_templaterequiredstringUrl Template
hostrequiredstringHost
host_verifiedrequiredbooleanHost Verified
input_schemarequiredobjectInput Schema
output_pickrequiredstring[]Output Pick
data_accessrequiredstringData Access
requires_approvalrequiredbooleanRequires Approval
enabledrequiredbooleanEnabled
has_headersrequiredbooleanHas Headers
header_namesrequiredstring[]Header Names
created_atoptionalstringCreated At
updated_atoptionalstringUpdated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.402plan_required: the action would wait for approval and the plan has no helpdesk;required_plannames the plan to move to.409name_taken: another action of this agent has that name.
curl -X PATCH https://www.bidii.ai/api/v2/agents/AGENT_ID/actions/ACTION_ID \
-H "Authorization: Bearer bidi_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'DELETE /agents/{agent_id}/actions/{action_id}
Delete an action
The action is gone; what its forms gathered goes with it.
Scope: agents:write
Parameters
agent_idrequired in the path ·stringaction_idrequired in the path ·string
Responses
204Deleted.401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl -X DELETE https://www.bidii.ai/api/v2/agents/AGENT_ID/actions/ACTION_ID \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"GET /agents/{agent_id}/actions/{action_id}/calls
List an action's calls
The action's calls in conversations, newest first: when, the outcome, why it failed or was not run, how long it took and the conversation it came from. A request the team approved is one call, with who decided it (their user id). Preview calls are left out. failures_only keeps what failed, was not run, or expired. What it was asked is the names of the action's inputs only, never their values; where the owner's system lives is not here (GET /agents/{agent_id}/actions, agents:read).
Scope: conversations:read
Parameters
agent_idrequired in the path ·stringaction_idrequired in the path ·stringlimitoptional in the query ·integerRows per page, 1 to 100.
cursoroptional in the query ·stringThe next_cursor of the previous page.
failures_onlyoptional in the query ·boolean
Returns CallOut
idrequiredstringId
atrequiredstringAt
outcomerequiredstringworked, failed, refused (not run), waiting (for the team's approval), approved, rejected, expired, or sent (asked for approval before this record kept the request).
reasonoptionalstringWhy it failed, was refused or expired, as a stable code (timeout, http_status, invalid_input, conversation_cap, closed, ...); null when the record names none.
detailrequiredobjectWhat the reason names: the status a system answered, the inputs that did not fit, the vendor.
latency_msoptionalintegerLatency Ms
conversation_idoptionalstringThe conversation it came from, while it exists.
ticket_idoptionalstringThe ticket the team approves a request on.
inputsrequiredstring[]The names of the action's inputs it was called with, never their values.
approvaloptionalCallApprovalresultoptionalCallResultAn approved request: how the call went.
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/agents/AGENT_ID/actions/ACTION_ID/calls \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"GET /agents/{agent_id}/submissions
List form submissions
What the agent's collect-data actions gathered in conversations, newest first, each with the conversation it came from.
Scope: leads:read
Parameters
agent_idrequired in the path ·stringlimitoptional in the query ·integerRows per page, 1 to 100.
cursoroptional in the query ·stringThe next_cursor of the previous page.
action_idoptional in the query ·string
Returns SubmissionOut
idrequiredstringId
actionrequiredSubmissionActionconversation_idoptionalstringConversation Id
datarequiredobjectData
created_atrequiredstringCreated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/agents/AGENT_ID/submissions \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"