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)
| Name | Description | Type | Default |
|---|---|---|---|
| project_id (required) | The app's project id. | str | |
| action (required) | The action name. | str | |
| parameters | The 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
| Attribute | Description |
|---|---|
status | The HTTP status: Abstra's, when the call was refused, or the hook's own. |
code | Why Abstra refused the call (see below), or None for the hook's own errors. |
details | The validation errors, the limit that was hit, or the hook's response body. |
Errors
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_parameters | The parameters don't match the action's input schema. details["errors"] lists each error with its path and message. The hook didn't run. |
| 403 | missing_role | This project holds a role on the app, but not one this action requires. |
| 404 | The app or the action doesn't exist, isn't available, or this project can't reach it. | |
| 429 | rate_limited | Too 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. |
| 508 | call_depth_exceeded | The chain of calls between projects reached 8. |
| 400–599 | None | The hook answered with this status. details is its response body. |