Actions in the API
When the API is enabled for a resource with the actions
operation, every record action with a handler is also available to API
clients:
protected array $api = ['list', 'show', 'actions'];POST /api/v1/orders/0192b3c4-.../actions/approve HTTP/1.1Authorization: Bearer …Content-Type: application/json
{"reason": "Budget confirmed"}- The path segment is the name in kebab-case (
markDone→mark-done). - The JSON body holds the fields of the action’s form, validated and converted like in the dialog.
- The same permission (of the API client’s roles), policies and
visible()checks apply; the record is loaded through the resource. - The answer contains the message of the handler.
- Link actions and bulk actions are not exposed.
Details: Resource endpoints.