Skip to content
cloudhostDocs
API reference

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.

GET/v1/actors/config

Whether 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

  • availableboolean
  • metersstring[]

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/actors/config" \
  -H "Authorization: Bearer $KEY"
GET/v1/actors/namespaces

The 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

  • any
  • any
  • any

Response

200object

  • namespacesActorNamespace[]
  • next_cursorstring | null
  • limitsobject

Errors

StatusDescription
400Bad request: bad_param, bad_cursor
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/actors/namespaces" \
  -H "Authorization: Bearer $KEY"
GET/v1/projects/{project}/actors/namespaces

A project's actor namespaces#

The project's namespaces, by name.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • any
  • any
  • any

Response

200object

  • namespacesActorNamespace[]
    • idstring

      ans_…

    • namestring
    • projectobject | null
    • labelstring

      what the namespace is known by inside the platform (from its id)

    • classstring

      the class its actors are instances of

    • functionobject | null

      the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

    • bindingstring

      the binding name the defining function gets it by (env.<binding>)

    • created_atstring (date-time)
  • next_cursorstring | null

Errors

StatusDescription
400Bad request: bad_param, bad_cursor
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces" \
  -H "Authorization: Bearer $KEY"
POST/v1/projects/{project}/actors/namespaces

Create 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

  • namestringrequired

    lowercase letters, digits and single hyphens, 1 to 63 characters; unique in the project (any case)

  • classstringrequired

    the name of the class the function exports

    pattern ^[A-Za-z_$][A-Za-z0-9_$]{0,127}$

  • functionstringrequired

    a function or app of the project, by name (any case) or id

Response

201ActorNamespace

  • idstring

    ans_…

  • namestring
  • projectobject | null
  • labelstring

    what the namespace is known by inside the platform (from its id)

  • classstring

    the class its actors are instances of

  • functionobject | null

    the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

  • bindingstring

    the binding name the defining function gets it by (env.<binding>)

  • created_atstring (date-time)
  • storage_keptboolean

    true 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

StatusDescription
400Bad request: bad_json, bad_request, bad_name, bad_class, bad_function
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, limit
404Not found: not_found
409Conflict: name_taken
500internal: an unexpected failure
503Unavailable: 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":"…"}'
GET/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

  • any
  • namestringpathrequired

    the namespace's name in the project (any case) or its id (ans_…)

Response

200ActorNamespace

  • idstring

    ans_…

  • namestring
  • projectobject | null
  • labelstring

    what the namespace is known by inside the platform (from its id)

  • classstring

    the class its actors are instances of

  • functionobject | null

    the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

  • bindingstring

    the binding name the defining function gets it by (env.<binding>)

  • created_atstring (date-time)
  • bound_byobject[]
  • availableboolean

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
  -H "Authorization: Bearer $KEY"
DELETE/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

  • any
  • namestringpathrequired

    the namespace's name in the project (any case) or its id (ans_…)

Response

200object

  • idstring
  • namestring
  • deletedboolean
  • storage_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

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
409Conflict: bound
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
  -H "Authorization: Bearer $KEY"
PATCH/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

  • any
  • namestringpathrequired

    the namespace's name in the project (any case) or its id (ans_…)

Request bodyapplication/json

  • classstring

    pattern ^[A-Za-z_$][A-Za-z0-9_$]{0,127}$

  • functionstring

    a function or app of the project, by name (any case) or id

Response

200ActorNamespace

  • idstring

    ans_…

  • namestring
  • projectobject | null
  • labelstring

    what the namespace is known by inside the platform (from its id)

  • classstring

    the class its actors are instances of

  • functionobject | null

    the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

  • bindingstring

    the binding name the defining function gets it by (env.<binding>)

  • created_atstring (date-time)

Errors

StatusDescription
400Bad request: bad_json, bad_class, bad_function, nothing
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: 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":"…"}'
GET/v1/projects/{project}/actors/namespaces/{name}/usage

An 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

  • any
  • namestringpathrequired

    the namespace's name in the project (any case) or its id (ans_…)

  • daysintegerquery

    days back

    1–90 · default 30

Response

200ActorUsage

  • projectobject
  • namespaceobject
  • daysinteger
  • fromstring (date-time)
  • tostring (date-time)
  • requestsinteger
  • cpu_msinteger
  • readsinteger
  • writesinteger
  • per_dayobject[]
  • metersobject[]
  • list_rialsinteger
  • pricedboolean

    false until the meters have prices (to set)

Errors

StatusDescription
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/projects/{project}/actors/namespaces/{name}/audit

Who changed an actor namespace#

Its audit entries, newest first.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • any
  • namestringpathrequired

    the namespace's name in the project (any case) or its id (ans_…)

  • beforestringquery

    only entries older than this entry id

  • any
  • any

Response

200ResourceAudit

  • entriesobject[]required
  • nextstring | nullrequired

    pass as ?before= for the next page

  • next_cursorstring | null

    send as cursor for the next page; null on the last page

Errors

StatusDescription
400Bad request: bad_param, bad_cursor
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api/audit" \
  -H "Authorization: Bearer $KEY"
GET/v1/projects/{project}/actors/usage

A 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

  • any
  • daysintegerquery

    days back

    1–90 · default 30

Response

200ActorUsage

  • projectobject
  • namespaceobject
  • daysinteger
  • fromstring (date-time)
  • tostring (date-time)
  • requestsinteger
  • cpu_msinteger
  • readsinteger
  • writesinteger
  • per_dayobject[]
  • metersobject[]
  • list_rialsinteger
  • pricedboolean

    false until the meters have prices (to set)

Errors

StatusDescription
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/projects/my-api/actors/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/actors/usage

The 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

  • any
  • daysintegerquery

    how many days back: 1 to 90 (default 30)

    1–90 · default 30

Response

200ActorUsage

  • projectobject
  • namespaceobject
  • daysinteger
  • fromstring (date-time)
  • tostring (date-time)
  • requestsinteger
  • cpu_msinteger
  • readsinteger
  • writesinteger
  • per_dayobject[]
  • metersobject[]
  • list_rialsinteger
  • pricedboolean

    false until the meters have prices (to set)

Errors

StatusDescription
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found (no such project)
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/actors/usage" \
  -H "Authorization: Bearer $KEY"