On this page
Setting it up in Bricksta
You need: the permission to administer the organization, for the API access. For the template and the webhook you need the permission to manage templates. From the other system you need a publicly reachable address.
- 1Create an access under Organization › Interfaces › API access. Choose a permission profile that may edit and complete tasks.
- 2In the same window, choose a role under Roles, for example Accounting system. If it doesn't exist yet, create it first under Organization › Roles.
- 3Copy the key and hand it to the other system. Bricksta shows it only this once.
- 4Add the task to the template. Make the role its owner and give it fields for the result, for example Invoice number.
- 5Create a webhook under Automation → Outbound: your template, the event Task ready and the system's address.
- 6Expand the webhook. Create a secret with generate and check the connection with Send test.
- 1Event: choose Task ready here
- 2Address of the other system
Result: as soon as a case reaches the task, Bricksta reports the task to the other system. It waits until the system writes the result back and completes it.
Without a secret there is no signature, and the other system can't check where a report comes from. The test from Send test never carries an identifier or signature.
Report, fetch, result, completion
An example: after an order is approved, the accounting system should create an invoice. The case needs the invoice number afterwards. So the task “Create invoice” belongs to the accounting system.
The accounting system gets its own access to Bricksta, an API access. It works like a member: it holds a role, sees the tasks of that role and completes them.
Bricksta other system
1. Task becomes open
POST to the system's address ─────► “Task 123 is ready”
◄───── 2. GET /api/v1/tasks (list, locks every task in it)
◄───── GET /api/v1/tasks/123 (fields of the task)
3. does the work
◄───── 4. PUT /api/v1/tasks/123/values/{field_id}
◄───── 5. POST /api/v1/tasks/123/complete
6. Task done, the flow continues- Bricksta sends only identifiers, no content. Only a caller signed in with the key gets field values.
- The list holds the tasks the API access may work on and that nobody holds right now. It locks each of them and comes in pages: keep paging until
next_cursoris empty. - The task in Bricksta waits, even for days. The system's lock, however, lasts one hour at most and is not extended.
- Only completing the task releases the flow, just like a person ticking it off.
What the other system has to do
This part is built by the vendor or IT provider of the other system. Every call to Bricksta carries the key from the API access.
| Step | Call | What matters |
|---|---|---|
| Accept the report | POST from Bricksta to the system's address | Answer within ten seconds with a status from 200 to 299. Check the signature and process each event_id only once. |
| Fetch the task | GET /api/v1/tasks | Look for the task from the report in the list. If it's missing, it belongs to someone else, is locked, blocked or awaiting approval. lock_duration sets the lock time. |
| Read the fields | GET /api/v1/tasks/{id} | Returns the fields of the task with their IDs and current values. |
| Save the result | PUT /api/v1/tasks/{id}/values/{field_id} | One call per field, with the Idempotency-Key header, plus lock_token and run_no in the body. A retry writes the value again. |
| Complete | POST /api/v1/tasks/{id}/complete | With the Idempotency-Key header. Retrying with the same key is safe. |
{
"event": "task_ready",
"event_id": "8b0e3c1a-…",
"case_id": "5f2d9e70-…",
"task_id": "c41a7b22-…",
"run_no": 1
}If something doesn't work
| What you see | What you do |
|---|---|
| The report gets no answer or status 500 and above, 408, 425, 429 | Bricksta tries up to three times. Look under Recent runs on the webhook, the address must be publicly reachable. |
| The report gets status 400 or 404 | Bricksta doesn't try again. The error is under Recent runs, check the address. |
| The list doesn't contain the task | Check that the API access holds the owning role and nobody has assigned the task to a person. Locked, blocked and tasks awaiting approval are missing too. |
Response 403 not_assigned | The task belongs to a person or a role the API access doesn't hold. |
Response 409 task_blocked or task_in_approval | The task is blocked or waiting for an approval. The API cannot approve, that happens in Bricksta. |
Response 409 task_locked or run_mismatch | Another instance fetched the task after the lock expired, or a step back reopened it. The system fetches it again. |
Response 422 required_fields_missing | Required fields are missing. The response names them, the system fills them and completes again. |
| The task is never completed | It stays open. Give it a deadline, so you see in Bricksta when it is stuck. |
What's next?
- REST API: all calls, examples, lock time and error messages.
- Outbound webhooks: events, signature and retries.
- Deadlines: so a stuck task stands out.