Make an automation
const url = 'http://localhost:3000/api/v1/automations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","trigger":"brand.released","brand":"example","days":1,"actions":["example"],"times":1,"kind":"stale","action":"email","format":"json","emails":["hello@example.com"],"url":"https://example.com","enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/automations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "trigger": "brand.released", "brand": "example", "days": 1, "actions": [ "example" ], "times": 1, "kind": "stale", "action": "email", "format": "json", "emails": [ "hello@example.com" ], "url": "https://example.com", "enabled": true }'Brand.released fires when a brand (brand, or any) is released; asset.expiring once per approved asset, days before its last day of use, and again for a new date. governance fires on each entry of the project’s audit log and each asset decision (asset.approved, asset.rejected, asset.archived…) that actions names, exact or by prefix (share.*), every one when empty; never on entries outside a project or a private asset’s. check.refused fires once per asset and window when the use check refused it times times within days (7 unless said). fix.opened fires once for each new thing Fixes lists, of kind (stale or gap, or both), first seen since the automation was made. review.waiting fires once for each proposal in review days or more. email sends to emails; webhook POSTs to url the run’s payload (format json), a Slack incoming webhook’s message (slack) or a Teams workflow’s Adaptive Card (teams), signed as Artbucket-Signature: t={unix seconds},v1={hex HMAC-SHA256 of "{t}.{body}"} with secret, which is in this answer only. A delivery that fails is tried again 5 minutes, then an hour later: 3 attempts in all.
Scope: write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Brand.released: a brand’s guidelines are released. asset.expiring: an asset’s license ends within days days. governance: an entry of the audit log, or an asset decision (asset.approved, asset.rejected, asset.archived…), named in actions. check.refused: an asset refused by the use check times times within days days. fix.opened: something new in Fixes, of kind. review.waiting: a proposal in review for days days
Asset.expiring: how many days before its last day of use; 0 is the day itself. check.refused: the window counted, 7 when left out. review.waiting: how long a proposal waits
Governance: the actions it fires on, exact (grant.set) or by prefix (share.*); empty or left out: every one
Check.refused: refusals of one asset within days before it fires; 1 when left out
Email: to emails. webhook: a signed POST to url
Webhook: json (the run, signed), slack (a Slack incoming webhook’s message) or teams (a Teams workflow’s Adaptive Card); json when left out
Email: who it goes to
Webhook: where it is posted. Kept sealed, never shown again: the answer gives its host
Off: nothing fires, and what waits to be retried waits. On when left out
Responses
Section titled “Responses”Created, with the webhook’s secret
object
object
Brand.released: the brand it is for, by slug; null: any
Governance: the actions it fires on; empty: every one
Webhook: the URL’s host; the URL itself is never shown
Webhook: what each POST is signed with (Artbucket-Signature). Given once, when made
Example
{ "data": { "trigger": "brand.released", "kind": "stale", "action": "email", "format": "json", "last": { "status": "pending" } }}default
Section titled “default”An error
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}