Actors
Code with a name, one live copy of each, with its own storage. A namespace holds the actors of one class of one function; a function reaches an actor by name through a binding.
/v1/actors/configWhether actors are served#
available: whether actor namespaces can be made and their actors reached here; meters: the usage meters.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Response
200object
availablebooleanmetersstring[]
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/actors/config" \
-H "Authorization: Bearer $KEY"/v1/actors/namespacesThe team's actor namespaces#
Every project's namespaces by name, or one project's with project.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anyanyany
Response
200object
namespacesActorNamespace[]idstringans_…namestringprojectobject | nullidstringnamestring
labelstringwhat the namespace is known by inside the platform (from its id)
classstringthe class its actors are instances of
functionobject | nullthe function or app whose code holds the class (another project's as
<project>/<name>); null while it is deletedidstringnamestringkindstringone of
function,app
bindingstringthe binding name the defining function gets it by (
env.<binding>)created_atstring (date-time)
next_cursorstring | nulllimitsobjectnamespacesintegerthe namespaces a team may hold
Errors
| Status | Description |
|---|---|
| 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 |
Example
curl "https://api.ibel.ai/v1/actors/namespaces" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/actors/namespacesA project's actor namespaces#
The project's namespaces, by name.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anyanyany
Response
200object
namespacesActorNamespace[]idstringans_…namestringprojectobject | nullidstringnamestring
labelstringwhat the namespace is known by inside the platform (from its id)
classstringthe class its actors are instances of
functionobject | nullthe function or app whose code holds the class (another project's as
<project>/<name>); null while it is deletedidstringnamestringkindstringone of
function,app
bindingstringthe binding name the defining function gets it by (
env.<binding>)created_atstring (date-time)
next_cursorstring | null
Errors
| Status | Description |
|---|---|
| 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 |
Example
curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/actors/namespacesCreate an actor namespace#
A namespace of the project: its actors are instances of class, exported by the code of function (a function or app of the project). That function gets the binding without a line; another function binds it with [[actor]].
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
any
Request bodyapplication/json
namestringrequiredlowercase letters, digits and single hyphens, 1 to 63 characters; unique in the project (any case)
classstringrequiredthe name of the class the function exports
pattern
^[A-Za-z_$][A-Za-z0-9_$]{0,127}$functionstringrequireda function or app of the project, by name (any case) or id
Response
201ActorNamespace
idstringans_…namestringprojectobject | nullidstringnamestring
labelstringwhat the namespace is known by inside the platform (from its id)
classstringthe class its actors are instances of
functionobject | nullthe function or app whose code holds the class (another project's as
<project>/<name>); null while it is deletedidstringnamestringkindstringone of
function,app
bindingstringthe binding name the defining function gets it by (
env.<binding>)created_atstring (date-time)storage_keptbooleantrue when a namespace of this name was deleted in the project within the grace (before its
storage_kept_until); its actors and their storage are this one's
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_json, bad_request, bad_name, bad_class, bad_function |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden, limit |
| 404 | Not found: not_found |
| 409 | Conflict: name_taken |
| 500 | internal: an unexpected failure |
| 503 | Unavailable: actors_unavailable |
Example
curl -X POST "https://api.ibel.ai/v1/projects/my-api/actors/namespaces" \
-H "Authorization: Bearer $KEY" \
-d '{"name":"my-api","class":"…","function":"…"}'/v1/projects/{project}/actors/namespaces/{name}One actor namespace#
The namespace, with the functions and apps whose live version binds it (bound_by).
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anynamestringpathrequiredthe namespace's name in the project (any case) or its id (
ans_…)
Response
200ActorNamespace
idstringans_…namestringprojectobject | nullidstringnamestring
labelstringwhat the namespace is known by inside the platform (from its id)
classstringthe class its actors are instances of
functionobject | nullthe function or app whose code holds the class (another project's as
<project>/<name>); null while it is deletedidstringnamestringkindstringone of
function,app
bindingstringthe binding name the defining function gets it by (
env.<binding>)created_atstring (date-time)bound_byobject[]idstringnamestringkindstringone of
function,app
availableboolean
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/actors/namespaces/{name}Delete an actor namespace#
Its actors stop at once. Their storage is kept until storage_kept_until (about a day): a namespace created by the same name in the project before then gets its actors back with their storage (storage_kept: true); after that it is deleted and a new one starts empty. Refused while a live version binds it (409 bound).
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
- Step-up
- With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.
Parameters
anynamestringpathrequiredthe namespace's name in the project (any case) or its id (
ans_…)
Response
200object
idstringnamestringdeletedbooleanstorage_kept_untilstring (date-time)until when a namespace created by the same name in the project gets this one's actors and storage back
Errors
| Status | Description |
|---|---|
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden, step_up_required |
| 404 | Not found: not_found |
| 409 | Conflict: bound |
| 500 | internal: an unexpected failure |
Example
curl -X DELETE "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/actors/namespaces/{name}Change an actor namespace#
Its class or its function. The actors keep their storage; the next call runs the new class or function.
- Credential
- An API key or a dashboard session
- Roles
- owner, admin, developer
Parameters
anynamestringpathrequiredthe namespace's name in the project (any case) or its id (
ans_…)
Request bodyapplication/json
classstringpattern
^[A-Za-z_$][A-Za-z0-9_$]{0,127}$functionstringa function or app of the project, by name (any case) or id
Response
200ActorNamespace
idstringans_…namestringprojectobject | nullidstringnamestring
labelstringwhat the namespace is known by inside the platform (from its id)
classstringthe class its actors are instances of
functionobject | nullthe function or app whose code holds the class (another project's as
<project>/<name>); null while it is deletedidstringnamestringkindstringone of
function,app
bindingstringthe binding name the defining function gets it by (
env.<binding>)created_atstring (date-time)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_json, bad_class, bad_function, nothing |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 403 | Not allowed: forbidden |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
Example
curl -X PATCH "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
-H "Authorization: Bearer $KEY" \
-d '{"class":"…","function":"…"}'/v1/projects/{project}/actors/namespaces/{name}/usageAn actor namespace's usage#
Calls, run time, storage reads and writes per day (Tehran), and their cost at list price once the meters have prices (priced).
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anynamestringpathrequiredthe namespace's name in the project (any case) or its id (
ans_…)daysintegerquerydays back
1–90 · default
30
Response
200ActorUsage
projectobjectidstringnamestring
namespaceobjectidstringnamestring
daysintegerfromstring (date-time)tostring (date-time)requestsintegercpu_msintegerreadsintegerwritesintegerper_dayobject[]daystringrequestsintegercpu_msintegerreadsintegerwritesinteger
metersobject[]list_rialsintegerpricedbooleanfalse until the meters have prices (to set)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api/usage" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/actors/namespaces/{name}/auditWho changed an actor namespace#
Its audit entries, newest first.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anynamestringpathrequiredthe namespace's name in the project (any case) or its id (
ans_…)beforestringqueryonly entries older than this entry id
anyany
Response
200ResourceAudit
entriesobject[]requiredidstringrequiredatstring (date-time)requiredactorstring | nullactionstringrequiredtargetstringrequireddetailobjectwhat changed; never a value or a credential
nextstring | nullrequiredpass as ?before= for the next page
next_cursorstring | nullsend as
cursorfor the next page; null on the last page
Errors
| Status | Description |
|---|---|
| 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 |
Example
curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api/audit" \
-H "Authorization: Bearer $KEY"/v1/projects/{project}/actors/usageA project's actor usage#
Every namespace of the project together, per day (Tehran).
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anydaysintegerquerydays back
1–90 · default
30
Response
200ActorUsage
projectobjectidstringnamestring
namespaceobjectidstringnamestring
daysintegerfromstring (date-time)tostring (date-time)requestsintegercpu_msintegerreadsintegerwritesintegerper_dayobject[]daystringrequestsintegercpu_msintegerreadsintegerwritesinteger
metersobject[]list_rialsintegerpricedbooleanfalse until the meters have prices (to set)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/projects/my-api/actors/usage" \
-H "Authorization: Bearer $KEY"/v1/actors/usageThe team's actor usage#
Every namespace of every project together (the team view), or one project's with project, per day (Tehran). project in the answer is the project asked for, or null.
- Credential
- An API key or a dashboard session
- Roles
- Any role
Parameters
anydaysintegerqueryhow many days back: 1 to 90 (default 30)
1–90 · default
30
Response
200ActorUsage
projectobjectidstringnamestring
namespaceobjectidstringnamestring
daysintegerfromstring (date-time)tostring (date-time)requestsintegercpu_msintegerreadsintegerwritesintegerper_dayobject[]daystringrequestsintegercpu_msintegerreadsintegerwritesinteger
metersobject[]list_rialsintegerpricedbooleanfalse until the meters have prices (to set)
Errors
| Status | Description |
|---|---|
| 400 | Bad request: bad_param |
| 401 | unauthorized: missing, invalid, expired or revoked credential |
| 404 | Not found: not_found (no such project) |
| 500 | internal: an unexpected failure |
Example
curl "https://api.ibel.ai/v1/actors/usage" \
-H "Authorization: Bearer $KEY"