Skip to main content

abstra.apps

Call actions of other projects (apps) this project has access to. See Connected Apps.

from abstra.apps import (
AppActionError,
describe_app_action,
list_app_actions,
list_connected_apps,
run_app_action,
)

run_app_action​

Runs an action of an app as this project and returns the hook's response body.

result = run_app_action(project_id, action, parameters)
NameDescriptionTypeDefault
project_id (required)The app's project id.str
action (required)The action name.str
parametersThe action's parameters, matching its input schema.dict{}

Returns the hook's response body, parsed as JSON when it is JSON, otherwise the raw text.

Raises AppActionError when the call is refused or the hook answers with status 400 or above.

list_connected_apps​

apps = list_connected_apps()

Returns the apps this project holds a role on, each with id and name.

list_app_actions​

actions = list_app_actions(project_id)

Returns the app's actions this project may run, each with name and, when set, title and description.

describe_app_action​

action = describe_app_action(project_id, action)

Returns the action's name, title, description, input (JSON Schema of the parameters) and output (JSON Schema of the answer, when declared).

AppActionError​

AttributeDescription
statusThe HTTP status: Abstra's, when the call was refused, or the hook's own.
codeWhy Abstra refused the call (see below), or None for the hook's own errors.
detailsThe validation errors, the limit that was hit, or the hook's response body.

Errors​

StatuscodeMeaning
400invalid_parametersThe parameters don't match the action's input schema. details["errors"] lists each error with its path and message. The hook didn't run.
403missing_roleThis project holds a role on the app, but not one this action requires.
404The app or the action doesn't exist, isn't available, or this project can't reach it.
429rate_limitedToo many calls from this project to this app: 120 a minute, or 10 at the same time. details has the limit and, for the per-minute limit, retryAfterSeconds.
508call_depth_exceededThe chain of calls between projects reached 8.
400–599NoneThe hook answered with this status. details is its response body.