ایجنت
ساختن و تغییر برنامه با گفتوگو.
/v1/agent/configAgent's limits and price#
Whether Agent is served, the limits of a message, a file and a voice message, and the price of one credit (one credit is one US cent of the work a run does).
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پاسخ
200AgentConfig
availablebooleanlimitsobjecttext_charsintegerattachments_per_messageintegerfile_bytesintegermessage_bytesintegerall of one message's files together
links_per_messageintegervoice_bytesinteger
priceobjectcredits_per_usdintegercredit_rialsintegerwhat one credit costs, in rials
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/agent/config" \
-H "Authorization: Bearer $KEY"/v1/agent/projectsRecent Agent projects#
The team's projects with an Agent conversation, the most recently active first, for the Agent home. A member limited to chosen projects sees only those.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
limitintegerکوئری1 to 100 (20)
پاسخ
200object
projectsAgentProjectSummary[]idstringnamestringtitlestringupdated_atstring (date-time)last_runobjectidstringstatusstring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/agent/projects" \
-H "Authorization: Bearer $KEY"/v1/agent/projectsStart Agent from a prompt#
The first message makes a new project named from the idea (or name), or, with project, goes to an existing project (deploy rights on it). Agent's key for the project and the place it works are made, and the message starts at once; follow it with the run's stream. A new project made for a start that then fails is removed again. Agent's own key is refused.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
بدنهٔ درخواستapplication/json
textstringالزامیthe first message, 1 to 32,000 characters
namestringthe new project's name (default a short name from the idea, made free with -2, -3…)
projectstringan existing project's name or id (default a new project)
attachmentsstring[]ids from POST /v1/agent/attachments (held) or, for an existing project, its own; at most 100 MB together
0–10 items
linksstring[]web addresses for Agent to read itself, at most 10
0–10 items
languagestringthe language of the screen the message is sent from. Agent answers in the language of the message itself; this one is used when the message has none of its own (a name, code, a link, only files, "ok") and the conversation has none yet (default the person's saved language, else the request's Accept-Language, else fa)
one of
fa,envoicestringthe voice message (
avj_…) the words came from, one of yours; the language it was spoken in counts when the words have none of their ownstand_in_textbooleantrue when text is the client's own stand-in for a message of only files or links; it then gives the message no language
پاسخ
201object
projectobjectidstringnamestringcreatedbooleana new project was made
conversationAgentConversationidstringacv_…titlestringarchivedbooleanan older conversation of the project, from before one conversation per project; readable, never continued
created_atstring (date-time)updated_atstring (date-time)created_bystringlast_runobjectidstringstatusstring
runAgentRunidstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_text, bad_name, bad_attachment, bad_link, bad_language, bad_voice, bad_request, bad_json |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 402 | No credit: insufficient_credit; Agent's monthly limit reached for the team or the project: agent_spend_cap |
| 403 | Forbidden: forbidden, agent_blocked, agent_key |
| 404 | Not found: not_found (no such project) |
| 409 | Conflict: name_taken, agent_busy, agent_no_new_project (Agent cannot open a new project now: continue in an existing one, or contact support) |
| 413 | Too large: too_large |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable, agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/agent/projects" \
-H "Authorization: Bearer $KEY" \
-d '{"text":"…"}'/v1/agent/nameA project name from an idea#
A short name from the idea (lowercase letters, digits and hyphens, at most 30 characters), not taken in the team; the person can change it.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
بدنهٔ درخواستapplication/json
textstringالزامیthe idea
پاسخ
200object
namestring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_text |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/agent/name" \
-H "Authorization: Bearer $KEY" \
-d '{"text":"…"}'/v1/agent/attachmentsAttach a file before the project exists#
A file for the first message, held for the team for 24 hours until a start (POST /v1/agent/projects) names its id. The body and headers as for a project's attachment.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
content-sha256stringheaderالزامیthe SHA-256 of the bytes, in hex; a different hash is refused and nothing is kept
content-lengthintegerheaderالزامیthe size in bytes
x-file-namestringheaderالزامیthe file's name, UTF-8, percent-encoded
بدنهٔ درخواستapplication/octet-stream
the file's bytes; its content-type is kept
string (binary)
پاسخ
201AgentAttachment
idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_attachment, bad_hash |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 411 | Length required: length_required |
| 413 | Too large: too_large |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/agent/attachments" \
-H "Authorization: Bearer $KEY" \
--data-binary @file- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
attachmentstringمسیرالزامیthe attachment's id (
aat_…)
پاسخ
200object
idstringdeletedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X DELETE "https://api.ibel.ai/v1/agent/attachments/attachment" \
-H "Authorization: Bearer $KEY"/v1/agent/voiceA voice message before the project exists#
A recorded voice message (at most 10 MB) turned into text for the Agent home's box, as a project's voice message.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
content-sha256stringheaderالزامیthe SHA-256 of the bytes, in hex
content-lengthintegerheaderالزامیthe size in bytes
asyncstringکوئری1: answer
202at once with the job (AgentVoiceJob) and pollGET …/voice/{voice}for the text; without it the call waits for the text (up to a few minutes).Prefer: respond-asyncdoes the same.one of
1,true
بدنهٔ درخواستaudio/webm
the recording
string (binary)
پاسخ
200object
textstringattachmentAgentAttachmentidstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
202AgentVoiceJobAccepted (with ?async=1): the job, working; Location is its address
idstringavj_…statusstringone of
working,done,failedtextstringwhen done, the text for the box
errorobjectwhen failed:
{code, message}codestringmessagestring
attachmentAgentAttachmentidstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
formatstringthe recording's format (
webm,m4a,ogg, ...)languagestring | nullthe language found in it (
fa,en), once donesecondsnumberseconds since it was sent, or until it finished
accepted_snumber | nullcreated_atstring (date-time)finished_atstring (date-time) | null
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_audio, bad_hash |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 402 | No credit: insufficient_credit |
| 415 | Unsupported: bad_audio (a recording that cannot be read) |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: voice_failed, agent_unavailable |
نمونه
curl -X POST "https://api.ibel.ai/v1/agent/voice" \
-H "Authorization: Bearer $KEY" \
--data-binary @file/v1/agent/voice/{voice}A voice message's text, before the project exists#
A voice message sent with ?async=1: working until its text is ready (seconds to minutes), then done with text, or failed with error ({code, message}: voice_failed, bad_audio, ...). Ask again every 2 s or so; each ask is answered at once. Only the person who sent it sees it; kept a day.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
voicestringمسیرالزامیthe voice message's job id (
avj_…)
پاسخ
200AgentVoiceJob
idstringavj_…statusstringone of
working,done,failedtextstringwhen done, the text for the box
errorobjectwhen failed:
{code, message}codestringmessagestring
attachmentAgentAttachmentidstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
formatstringthe recording's format (
webm,m4a,ogg, ...)languagestring | nullthe language found in it (
fa,en), once donesecondsnumberseconds since it was sent, or until it finished
accepted_snumber | nullcreated_atstring (date-time)finished_atstring (date-time) | null
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/agent/voice/voice" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/settingsAgent on a project#
Whether Agent holds a key for the project now, and since when. Agent is always available: the first message makes its key.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
any
پاسخ
200AgentSettings
activebooleanAgent holds a key for the project now (it is always available; the first message makes the key)
sincestring (date-time)when the key in use was made
enabledbooleanthe same as active, kept for older clients
enabled_atstring (date-time)enabled_bystringkeyobjectAgent's key for this project (its secret is never shown)
idstringcreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/settings" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/settingsMake or stop Agent's key (older clients)#
Kept for older clients: Agent has no on or off switch (it is always available). false stops Agent on the project as POST …/agent/stop (its runs stop and its key is revoked at once); true makes its key now.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین
پارامترها
any
بدنهٔ درخواستapplication/json
enabledbooleanالزامی
پاسخ
200AgentSettings
activebooleanAgent holds a key for the project now (it is always available; the first message makes the key)
sincestring (date-time)when the key in use was made
enabledbooleanthe same as active, kept for older clients
enabled_atstring (date-time)enabled_bystringkeyobjectAgent's key for this project (its secret is never shown)
idstringcreated_atstring (date-time)
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_setting |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Forbidden: forbidden |
| 404 | Not found: not_found |
| 409 | Conflict: agent_no_new_project (Agent cannot open a new project now: continue in an existing one, or contact support) |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable (Agent cannot be reached right now), agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X PATCH "https://api.ibel.ai/v1/projects/my-api/agent/settings" \
-H "Authorization: Bearer $KEY" \
-d '{"enabled":true}'/v1/projects/{project}/agent/conversationsAgent's conversations#
The project's conversation with Agent first, then its archived older ones (archived: true), readable.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyanyany
پاسخ
200object
conversationsAgentConversation[]idstringacv_…titlestringarchivedbooleanan older conversation of the project, from before one conversation per project; readable, never continued
created_atstring (date-time)updated_atstring (date-time)created_bystringlast_runobjectidstringstatusstring
next_cursorstring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_param, bad_cursor |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/conversations" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/conversationsSend a message (older clients)#
Kept for older clients: the project has one conversation, and this continues it, as POST …/agent/messages (the conversation is made on the first message). Follow the run with its stream. One message at a time per project. Needs credit in the wallet.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
any
بدنهٔ درخواستapplication/json
textstringالزامیthe person's message, 1 to 32,000 characters
attachmentsstring[]ids of attachments of this project (
aat_…), at most 10 and 100 MB together; Agent sees images and PDFs as they are and reads the text of documents, recordings and videos0–10 items
linksstring[]web addresses (
httporhttps, on the public internet) for Agent to read itself, at most 10; addresses written intextare read too0–10 items
languagestringthe language of the screen the message is sent from. Agent answers in the language of the message itself; this one is used when the message has none of its own (a name, code, a link, only files, "ok") and the conversation has none yet (default the person's saved language, else the request's Accept-Language, else fa)
one of
fa,envoicestringthe voice message (
avj_…) the words came from, one of yours; the language it was spoken in counts when the words have none of their ownstand_in_textbooleantrue when text is the client's own stand-in for a message of only files or links; it then gives the message no language
پاسخ
201object
conversationAgentConversationidstringacv_…titlestringarchivedbooleanan older conversation of the project, from before one conversation per project; readable, never continued
created_atstring (date-time)updated_atstring (date-time)created_bystringlast_runobjectidstringstatusstring
runAgentRunidstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_text, bad_attachment (also a file no longer stored: attach it again), bad_link, bad_language, bad_voice, bad_request, bad_json |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 402 | No credit: insufficient_credit |
| 403 | Forbidden: agent_off, agent_blocked, forbidden |
| 404 | Not found: not_found |
| 409 | Conflict: agent_busy (the project's last message is still being worked on), agent_no_new_project (Agent cannot open a new project now: continue in an existing one, or contact support) |
| 413 | Too large: too_large (the files are over 100 MB together) |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable (Agent cannot be reached right now), agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/conversations" \
-H "Authorization: Bearer $KEY" \
-d '{"text":"…"}'/v1/projects/{project}/agent/conversations/{conversation}One conversation#
The conversation and its runs, oldest first: each message, its files, Agent's reply, its questions and approvals, and its cost.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyconversationstringمسیرالزامیthe conversation's id (
acv_…)
پاسخ
200object
conversationAgentConversationidstringacv_…titlestringarchivedbooleanan older conversation of the project, from before one conversation per project; readable, never continued
created_atstring (date-time)updated_atstring (date-time)created_bystringlast_runobjectidstringstatusstring
runsAgentRun[]idstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/conversations/conversation" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/conversations/{conversation}Delete a conversation#
Stops its run if one is going and removes the conversation from the list.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyconversationstringمسیرالزامیthe conversation's id (
acv_…)
پاسخ
200object
idstringdeletedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X DELETE "https://api.ibel.ai/v1/projects/my-api/agent/conversations/conversation" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/conversations/{conversation}Rename a conversation#
A new title, 1 to 120 characters.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyconversationstringمسیرالزامیthe conversation's id (
acv_…)
بدنهٔ درخواستapplication/json
titlestringالزامی
پاسخ
200AgentConversation
idstringacv_…titlestringarchivedbooleanan older conversation of the project, from before one conversation per project; readable, never continued
created_atstring (date-time)updated_atstring (date-time)created_bystringlast_runobjectidstringstatusstring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_title |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X PATCH "https://api.ibel.ai/v1/projects/my-api/agent/conversations/conversation" \
-H "Authorization: Bearer $KEY" \
-d '{"title":"…"}'/v1/projects/{project}/agent/conversations/{conversation}/runsSend the next message of a conversation (older clients)#
Kept for older clients: the next message of that conversation (the project's one; an archived one answers 409 archived). Use POST …/agent/messages. One message at a time per project.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyconversationstringمسیرالزامیthe conversation's id (
acv_…)
بدنهٔ درخواستapplication/json
textstringالزامیthe person's message, 1 to 32,000 characters
attachmentsstring[]ids of attachments of this project (
aat_…), at most 10 and 100 MB together; Agent sees images and PDFs as they are and reads the text of documents, recordings and videos0–10 items
linksstring[]web addresses (
httporhttps, on the public internet) for Agent to read itself, at most 10; addresses written intextare read too0–10 items
languagestringthe language of the screen the message is sent from. Agent answers in the language of the message itself; this one is used when the message has none of its own (a name, code, a link, only files, "ok") and the conversation has none yet (default the person's saved language, else the request's Accept-Language, else fa)
one of
fa,envoicestringthe voice message (
avj_…) the words came from, one of yours; the language it was spoken in counts when the words have none of their ownstand_in_textbooleantrue when text is the client's own stand-in for a message of only files or links; it then gives the message no language
پاسخ
201AgentRun
idstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_text, bad_attachment (also a file no longer stored: attach it again), bad_link, bad_language, bad_voice, bad_request |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 402 | No credit: insufficient_credit; Agent's monthly limit reached for the team or the project: agent_spend_cap |
| 403 | Forbidden: agent_off, agent_blocked, forbidden |
| 404 | Not found: not_found |
| 409 | Conflict: agent_busy, archived (an archived conversation) |
| 413 | Too large: too_large (the files are over 100 MB together) |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable (Agent cannot be reached right now), agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/conversations/conversation/runs" \
-H "Authorization: Bearer $KEY" \
-d '{"text":"…"}'/v1/projects/{project}/agent/runsAgent's runs#
The project's messages to Agent and their runs, newest first; conversation narrows to one.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyconversationstringکوئریonly this conversation's (
acv_…)anyany
پاسخ
200object
runsAgentRun[]idstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
next_cursorstring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_param, bad_cursor |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/runs" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/runs/{run}One run#
A run as it stands: its status, reply, questions, approvals and cost.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyrunstringمسیرالزامیthe run's id (
arn_…)
پاسخ
200AgentRun
idstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/runs/run" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/runs/{run}/streamFollow a run live#
Server-sent events while the run goes: status {status}, text {text} (each piece Agent writes), activity {what, action?, target?, url?} (what: editing_files, running_command, searching_web, reading_web, working_on_project, thinking; a change to the project adds action and target as in AgentStep), question (an AgentQuestion), approval (an AgentApproval, raised or decided), cost {credits, estimated_credits, settled} (the list price so far, while it runs), then done {status, reply, cost}; or error {code, message}. A comment every 15 seconds keeps it open. A finished run answers done at once.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyrunstringمسیرالزامیthe run's id (
arn_…)
پاسخ
200stringtext/event-stream
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -N "https://api.ibel.ai/v1/projects/my-api/agent/runs/run/stream" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/runs/{run}/stopStop a run#
Stops the run; what it already changed stays (as previews).
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyrunstringمسیرالزامیthe run's id (
arn_…)
پاسخ
200object
idstringstatusstringone of
stopped
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 409 | Conflict: not_running |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable (Agent cannot be reached right now), agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/runs/run/stop" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/runs/{run}/messageSay something to a running Agent#
A few words Agent reads at its next step, without starting a new message.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyrunstringمسیرالزامیthe run's id (
arn_…)
بدنهٔ درخواستapplication/json
textstringالزامی1 to 4,000 characters
languagestringthe language of the screen it is sent from (checked, as on a message); words in another language than the run's turn the language Agent answers in
one of
fa,en
پاسخ
200object
deliveredbooleanmessageobjectthe words as kept in the run's messages
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_text, bad_language |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 409 | Conflict: not_running |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/runs/run/message" \
-H "Authorization: Bearer $KEY" \
-d '{"text":"…"}'/v1/projects/{project}/agent/runs/{run}/answerAnswer Agent's question#
The answer to a question Agent asked in the run; it carries on at once. A question that asks for an approval is answered on the approval.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyrunstringمسیرالزامیthe run's id (
arn_…)
بدنهٔ درخواستapplication/json
questionstringالزامیanswerstringالزامی1 to 4,000 characters
پاسخ
200object
answeredboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_answer |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 409 | Conflict: not_running, already_answered, approval_question |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable (Agent cannot be reached right now), agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/runs/run/answer" \
-H "Authorization: Bearer $KEY" \
-d '{"question":"…","answer":"…"}'/v1/projects/{project}/agent/approvalsAgent's approvals#
What Agent asked the person to approve, newest first: a production deploy, a custom domain, a paid resource or a top-up.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anystatusstringکوئریone of
pending,approved,denied,used,expired
پاسخ
200object
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/approvals" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/approvals/{approval}Approve or deny#
The person's decision. On approve, the platform carries out the action Agent asked for and keeps its answer in result; Agent is told either way. A top-up needs the owner, admin or billing role; the payment link is made for the person who approves.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- owner, admin, developer (a top-up: owner, admin, billing)
پارامترها
anyapprovalstringمسیرالزامیthe approval's id (
aap_…)
بدنهٔ درخواستapplication/json
decisionstringالزامیone of
approve,denynotestringat most 500 characters
پاسخ
200AgentApproval
idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
told_agentboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_decision |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Forbidden: forbidden |
| 404 | Not found: not_found |
| 409 | Conflict: already_decided (decided, or expired after 30 minutes) |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/approvals/approval" \
-H "Authorization: Bearer $KEY" \
-d '{"decision":"approve"}'/v1/projects/{project}/agent/attachmentsAttach a file#
A file of any kind for a message (a picture, a PDF, a document, a sheet, an archive), at most 100 MB. Send the bytes as the body; then name its id in a message's attachments.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anycontent-sha256stringheaderالزامیthe SHA-256 of the bytes, in hex; a different hash is refused and nothing is kept
content-lengthintegerheaderالزامیthe size in bytes
x-file-namestringheaderالزامیthe file's name, UTF-8, percent-encoded
بدنهٔ درخواستapplication/octet-stream
the file's bytes; its content-type is kept
string (binary)
پاسخ
201AgentAttachment
idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_attachment, bad_hash |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Forbidden: agent_off, forbidden |
| 404 | Not found: not_found |
| 411 | Length required: length_required |
| 413 | Too large: too_large |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable (Agent cannot be reached right now), agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/attachments" \
-H "Authorization: Bearer $KEY" \
--data-binary @file/v1/projects/{project}/agent/attachments/{attachment}One attachment#
An attachment's name, type and size.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anyattachmentstringمسیرالزامیthe attachment's id (
aat_…)
پاسخ
200AgentAttachment
idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/attachments/attachment" \
-H "Authorization: Bearer $KEY"- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anyattachmentstringمسیرالزامیthe attachment's id (
aat_…)
پاسخ
200object
idstringdeletedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X DELETE "https://api.ibel.ai/v1/projects/my-api/agent/attachments/attachment" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/voiceA voice message#
A recorded voice message (at most 10 MB), turned into text for the chat box. Nothing is sent to Agent: the person reads the text, fixes it if needed and sends it as a message.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
anycontent-sha256stringheaderالزامیthe SHA-256 of the bytes, in hex; a different hash is refused and nothing is kept
content-lengthintegerheaderالزامیthe size in bytes
asyncstringکوئری1: answer
202at once with the job (AgentVoiceJob) and pollGET …/voice/{voice}for the text; without it the call waits for the text (up to a few minutes).Prefer: respond-asyncdoes the same.one of
1,true
بدنهٔ درخواستaudio/webm
the recording
string (binary)
پاسخ
200object
textstringattachmentAgentAttachmentidstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
202AgentVoiceJobAccepted (with ?async=1): the job, working; Location is its address
idstringavj_…statusstringone of
working,done,failedtextstringwhen done, the text for the box
errorobjectwhen failed:
{code, message}codestringmessagestring
attachmentAgentAttachmentidstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
formatstringthe recording's format (
webm,m4a,ogg, ...)languagestring | nullthe language found in it (
fa,en), once donesecondsnumberseconds since it was sent, or until it finished
accepted_snumber | nullcreated_atstring (date-time)finished_atstring (date-time) | null
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_audio, bad_hash |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 402 | No credit: insufficient_credit |
| 403 | Forbidden: agent_off, forbidden |
| 404 | Not found: not_found |
| 411 | Length required: length_required |
| 413 | Too large: too_large |
| 415 | Unsupported: bad_audio (a recording that cannot be read) |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: voice_failed, agent_unavailable, agent_busy |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/voice" \
-H "Authorization: Bearer $KEY" \
--data-binary @file/v1/projects/{project}/agent/voice/{voice}A voice message's text#
A voice message sent with ?async=1: working until its text is ready (seconds to minutes), then done with text, or failed with error ({code, message}: voice_failed, bad_audio, ...). Ask again every 2 s or so; each ask is answered at once. Only the person who sent it sees it; kept a day.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
projectstringمسیرالزامیthe project's name or id
voicestringمسیرالزامیthe voice message's job id (
avj_…)
پاسخ
200AgentVoiceJob
idstringavj_…statusstringone of
working,done,failedtextstringwhen done, the text for the box
errorobjectwhen failed:
{code, message}codestringmessagestring
attachmentAgentAttachmentidstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
formatstringthe recording's format (
webm,m4a,ogg, ...)languagestring | nullthe language found in it (
fa,en), once donesecondsnumberseconds since it was sent, or until it finished
accepted_snumber | nullcreated_atstring (date-time)finished_atstring (date-time) | null
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/voice/voice" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/previewThe preview pane#
The project's newest preview (the app or function whose preview changed last), the same one's production address, and its newest 20 versions, each marked when it is the preview's or production's.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
any
پاسخ
200object
previewobjectappobjectidstringnamestringkindstringone of
app,function
branchstringurlstringversionintegerupdated_atstring (date-time)
productionobjecturlstringversioninteger
versionsobject[]numberintegercreated_atstring (date-time)previewbooleanproductionboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/preview" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/usageAgent's usage#
Runs, credits and rials per day (Tehran) over the last days (1 to 90, default 30).
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
anydaysintegerکوئری1–90 · default
30
پاسخ
200object
daysobject[]daystringrunsintegercreditsnumberrialsinteger
totalobjectrunsintegercreditsnumberrialsinteger
monthobjectthis billing month against Agent's monthly limits, in credits; once either is reached a new message is refused with
agent_spend_capand a run still working stopsperiodstringthe Jalali billing month, e.g. 1405-08
projectAgentSpendcreditsnumberspent this billing month (a run still working counts its price so far)
capintegerthe monthly limit; null for no limit
teamAgentSpendcreditsnumberspent this billing month (a run still working counts its price so far)
capintegerthe monthly limit; null for no limit
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/usage" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/conversationThe project's conversation#
The project's one conversation with Agent and its runs, oldest first (the last 200), with how many older conversations are archived.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
any
پاسخ
200object
conversationAgentConversationidstringacv_…titlestringarchivedbooleanan older conversation of the project, from before one conversation per project; readable, never continued
created_atstring (date-time)updated_atstring (date-time)created_bystringlast_runobjectidstringstatusstring
runsAgentRun[]idstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
archivedinteger
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/conversation" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/messagesThe project's next message#
The next message of the project's one conversation (made on the first message), which Agent starts working on at once; follow it with the run's stream. Before each message Agent is told the latest commit of each app on main and on its own branch, agent. One message at a time per project. Needs credit.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
any
بدنهٔ درخواستapplication/json
textstringالزامیthe message, 1 to 32,000 characters
attachmentsstring[]attachment ids of this project, or held ones (POST /v1/agent/attachments); at most 100 MB together
0–10 items
linksstring[]web addresses for Agent to read itself, at most 10
0–10 items
languagestringthe language of the screen the message is sent from. Agent answers in the language of the message itself; this one is used when the message has none of its own (a name, code, a link, only files, "ok") and the conversation has none yet (default the person's saved language, else the request's Accept-Language, else fa)
one of
fa,envoicestringthe voice message (
avj_…) the words came from, one of yours; the language it was spoken in counts when the words have none of their ownstand_in_textbooleantrue when text is the client's own stand-in for a message of only files or links; it then gives the message no language
پاسخ
201AgentRun
idstringarn_…conversationstringstatusstringwaiting: for the person (a question or an approval)one of
queued,running,waiting,completed,failed,stoppedtextstringthe person's message
attachmentsAgentAttachment[]idstringaat_…namestringtypestringsizeintegerkindstringone of
file,voicecreated_atstring (date-time)heldbooleanattached at the team level, before its project exists (POST /v1/agent/attachments); held 24 hours
linksstring[]the web addresses the message gave, which Agent read itself
replystringquestionsAgentQuestion[]idstringtextstringoptionsstring[]answeredbooleananswerstring
approvalsAgentApproval[]idstringaap_…runstringkindstringpaid_change: a create or resize that adds a standing monthly charge; destructive: deletes, replaces or rewinds something, free or not; paid_resource: older approvals only
one of
production_deploy,custom_domain,paid_change,destructive,topup,paid_resourcetargetstringwhat it is for: an app or function's name, a resource kind, or the wallet
statusstringone of
pending,approved,denied,used,expiredcreated_atstring (date-time)decided_atstring (date-time)decided_bystringnotestringexpires_atstring (date-time)resultobjectonce approved, the action's own answer
statusintegerbodyany
costobjectpaid_change: the new charge per month
monthly_rialsintegerupper_boundbooleanthe most it can come to (a larger maximum size)
whatstring
wallet_rialsintegerthe team's wallet balance now
actionobjectthe exact call the approval is for, and the only one it is used by: its body with secrets shown as "[hidden]" and long text cut, or an upload's fingerprint
methodstringpathstringthe path with its query
bodyanythe JSON body as sent (a password, token, key or secret value as "[hidden]"; a .env text by its names only; a text over 2,000 characters cut); null for an upload, and once carried out
uploadobjecta build's or a site's upload, which has no JSON body; only the same bytes use the approval
sha256stringbytesintegerfilesintegernamesstring[]the first 50 file names
cutbooleansome text of the body was shortened here (the call itself is kept whole)
costobjectcreditsnumberrialsintegersettledbooleanfalse until the run's cost is known; then its credits are usage of that hour, rated with the rest (the month's credit first, then the wallet), and rials is their price before that credit
estimated_creditsnumberthe credits so far at the list price, while the cost is not known yet (null once it is)
languagestringthe language Agent writes back in for this message: the message's own; else the voice message's it came from; else the conversation's last; else the screen's (
languageon the message). A word to the running run in another language turns it. null on runs from before it was keptone of
fa,en,nullcreated_bystringcreated_atstring (date-time)finished_atstring (date-time)stepsAgentStep[]what the run changed in the project, in order
actionstringcreated,deployed,added,updated,renamed,moved,deleted,removed,published,rolled_back,restored,connected,disconnected,rotated,purged,cancelled,revoked,imported,startedorstoppedtargetobjectkindstringdatabase,database_branch,cache,bucket,queue,function,app,preview,domain,secret,flag,notification_topic,actor_namespace,workflow,version,topup,variable,cron,alert,realtime_channelorresourcenamestringbranchstringa preview's branch
urlstringthe address it made, such as a preview's
atstring
messagesobject[]what the person said to Agent while the run went
textstringatstring (date-time)bystring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_text, bad_attachment, bad_link, bad_language, bad_voice, bad_request, bad_json |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 402 | No credit: insufficient_credit; Agent's monthly limit reached for the team or the project: agent_spend_cap |
| 403 | Forbidden: agent_blocked, forbidden, agent_key |
| 404 | Not found: not_found |
| 409 | Conflict: agent_busy (the project's last message is still being worked on) |
| 413 | Too large: too_large |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: agent_unavailable, agent_not_available (not a retry: contact support), agent_busy (busy; retry_after seconds) |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/messages" \
-H "Authorization: Bearer $KEY" \
-d '{"text":"…"}'/v1/projects/{project}/agent/stopStop Agent on the project#
A running message stops and Agent's key for the project is revoked at once. Agent stays available: the next message makes a new key.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
any
پاسخ
200object
stoppedboolean
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Forbidden: forbidden |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/stop" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/deployWhat deploying Agent's preview carries#
For the deploy dialog: each app's agent preview version against production, file counts, new bindings and variables, the table changes as SQL (schema only), new monthly costs in production and the wallet balance. Rows made while testing stay in the preview; production keeps its own data.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- همهٔ نقشها
پارامترها
any
پاسخ
200AgentDeploy
itemsobject[]appobjectidstringnamestringkindstringone of
app,function
previewobjectthe
agentbranch's previewversionintegerurlstringbranchstring
productionobjectversionintegerurlstring
readybooleanthe preview's version differs from production
diffobjectfile counts and new binding and variable names (the full diff is GET …/versions/{a}/diff/{b})
addedintegerremovedintegerchangedintegerbindings_addedstring[]vars_addedstring[]
sqlobjectthe table changes as SQL statements, schema only
addedstring[]removedstring[]destructivebooleana statement drops or changes data
costsobject[]new standing monthly charges in production
whatstringmonthly_rialsintegernull when billed by use only
notestringappstringthe app or function that starts paying it
bindingstringthe name the code reads it by, when it is a resource the app now uses
typestringthe resource's kind (db, cache, bucket, queue, service, actor)
warmintegerinstances kept running all month, for an app that runs as an instance
sizestringthose instances' size
wallet_rialsintegernotestringrows made while testing stay in the preview; production keeps its own data
خطاها
| وضعیت | توضیح |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
نمونه
curl "https://api.ibel.ai/v1/projects/my-api/agent/deploy" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/agent/deployDeploy Agent's preview to production#
As the person: each app's agent preview version goes to production (apps: only these). Agent's own key is refused.
- دسترسی
- کلید API یا نشست داشبورد
- نقشها
- مالک، ادمین، توسعهدهنده
پارامترها
any
بدنهٔ درخواستapplication/json
appsstring[]app and function names (default every one whose agent preview differs from production)
versionsmap of integerthe preview version the dialog showed for each app ({name: version}); a preview that moved since is refused (preview_changed)
پاسخ
200object
deployedobject[]appstringversionintegerurlstring
خطاها
| وضعیت | توضیح |
|---|---|
| 400 | Bad request: bad_apps, bad_versions |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Forbidden: forbidden, agent_key |
| 404 | Not found: not_found |
| 409 | Conflict: nothing_to_deploy, preview_changed |
| 500 | internal: an unexpected failure |
نمونه
curl -X POST "https://api.ibel.ai/v1/projects/my-api/agent/deploy" \
-H "Authorization: Bearer $KEY" \
-d '{"apps":["…"],"versions":{"KEY":1}}'