Change an automation
const url = 'http://localhost:3000/api/v1/automations/example';const options = { method: 'PATCH', 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 PATCH \ --url http://localhost:3000/api/v1/automations/example \ --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 }'What is left out stays. Made a webhook, it gets a secret, in this answer only.
Scope: write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Automation id
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”Changed
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" }}