Authentication
All action endpoints live under/api/v1/. The API accepts both authentication methods on the same routes — the middleware detects the token type automatically:
| Token type | Grant | Identity |
|---|---|---|
| Client credentials | client_credentials | App client permissions |
| User access token | authorization_code | Authenticated user permissions |
Execute an Action
There are two URL forms depending on whether the action operates on a specific resource.Without a subject
Use this for actions that don’t target a specific model (e.g. create actions, report triggers):With a subject
Use this for actions that operate on a specific resource. Place the subject’s ID in the URL — integers, UUIDs, and any other ID format are supported:The subject’s primary key. The server automatically resolves which parameter the ID maps to based on the action’s declared subject class.
Response
Response mapping
The API controller maps the action’s return value to JSON:handle() returns | HTTP status | Response body |
|---|---|---|
string (message) | 200 | { success: true, message } |
ObjectContract | 200 | { success: true, message, data: {object} } |
StoredWorkflow | 200 | { success: true, workflow_id } |
void / null | 200 | { success: true } |
CoreActionException | 422 | { success: false, message } |
redirectTo() hints are ignored by the API — they only affect web responses. The API always returns JSON.Action Schema Discovery
Retrieve an action’s parameter schema and subject metadata. Use this to understand the expected URL pattern and required parameters before executing:Subject block
When an action has a declared$subjectClass, the response includes a subject object:
| Field | Description |
|---|---|
required | Always true — subject-scoped actions require a subject ID in the URL |
param | The internal parameter name the ID is bound to |
class | The fully-qualified model class the subject must be an instance of |
url_pattern | Ready-to-use URL — replace {id} with the actual subject ID |
Bulk Execute
Execute an action on multiple items. The subject ID is resolved per item from theids array:
Array of subject IDs to process.
Additional parameters applied to every execution (e.g. a shared reason string).
Error Handling
| Status | Meaning | When |
|---|---|---|
| 200 | Success | Action completed |
| 403 | Forbidden | authorize() returned false |
| 404 | Not Found | Unknown action key |
| 422 | Unprocessable | Validation failed or CoreActionException thrown |
| 500 | Server Error | Unhandled exception |
Next Steps
Client Credentials
Set up app-to-app authentication for your API integration.
User Authentication
OAuth authorization code flow for user-scoped API access.