{"openapi":"3.1.0","info":{"title":"Aduki Automations API","version":"1.2.0","summary":"A person's automations in Aduki, and the events their webhooks get.","description":"Automations run in Aduki as the person: a trigger (an email, a calendar or contact change, a booking, a call, a call centre wrap-up, a file in Aduki Store, an Aduki ID event, a schedule, a secret URL, a run by hand), conditions, and up to five actions. Every answer is in the envelope {success, data} or {success: false, error}. Keys: an API key with automations:read / automations:write (mail:read / mail:write keep working for one release), or an OAuth token of an app the person allowed.","contact":{"name":"Aduki","url":"https://docs.aduki.pro/dev/api/automations/"}},"servers":[{"url":"https://mail.aduki.pro/v1"}],"tags":[{"name":"Automations","description":"Make, change, run, pause and read the history of automations"},{"name":"Webhooks","description":"The account's own webhooks: subscribe an app to events"},{"name":"Events","description":"What a webhook gets, signed"}],"paths":{"/user/automations":{"get":{"operationId":"listAutomations","summary":"The person's automations, the catalogue, and whether all are paused","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"The automations","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}},"catalogue":{"type":"object"},"paused":{"type":"boolean"},"paused_since":{"type":["string","null"]}}}}}}}}}},"post":{"operationId":"createAutomation","summary":"Set up an automation (a webhook trigger's URL and the signing secret are shown once)","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationInput"}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"201":{"description":"Made","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Created"}}}}}}}}},"/user/automations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The automation's id"}],"get":{"operationId":"getAutomation","summary":"One automation","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"It","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Automation"}}}}}}}},"patch":{"operationId":"updateAutomation","summary":"Change what the body names (active false pauses it); the trigger stays","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationInput"}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Changed","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Created"}}}}}}}},"delete":{"operationId":"deleteAutomation","summary":"Delete it and its history","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"204":{"description":"Gone"}}}},"/user/automations/{id}/runs":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The automation's id"}],"get":{"operationId":"listAutomationRuns","summary":"Its runs, newest first, a page at a time","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"before","in":"query","schema":{"$ref":"#/components/schemas/Id"},"description":"The next of the page before"}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"A page of runs","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Runs"}}}}}}}},"post":{"operationId":"runAutomation","summary":"Run a manual, schedule or webhook automation now, with an optional JSON object as what triggered it","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","maxProperties":50}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"queued":{"type":"boolean"}}}}}}}}}}},"/user/automations/{id}/test":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The automation's id"}],"post":{"operationId":"testAutomation","summary":"A dry run on the newest matching item: whether it matches and what it would do","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"What it would do","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object"}}}}}}}}},"/user/automations/{id}/secret":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The automation's id"}],"post":{"operationId":"newAutomationSecret","summary":"A new signing secret, shown once; the old one stops at once","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"The new secret","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"secret":{"type":"string"}}}}}}}}}}},"/user/automations/templates":{"get":{"operationId":"listAutomationTemplates","summary":"Ready-made automations","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}}}}}}}}},"/user/automations/tasks":{"get":{"operationId":"listAutomationTasks","summary":"Tasks automations handed to the person's AI assistants","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"parameters":[{"name":"state","in":"query","schema":{"type":"string","enum":["open","all"],"default":"open"}},{"name":"client","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":200}}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Tasks","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}}}}}}}}}},"/user/automations/tasks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"}}],"delete":{"operationId":"dropAutomationTask","summary":"Drop an open task","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"204":{"description":"Dropped"}}}},"/user/automations/keys":{"get":{"operationId":"listAiKeys","summary":"Your AI vendor keys for the AI step (vendor, last 4, model; never the key)","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}}}}}}}}}}}},"/user/automations/keys/{vendor}":{"parameters":[{"name":"vendor","in":"path","required":true,"schema":{"type":"string","enum":["anthropic","openai"]}}],"put":{"operationId":"putAiKey","summary":"Keep your key of an AI vendor (sealed; replaces the one before)","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string","writeOnly":true},"model":{"type":"string"}}}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Kept","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object"}}}}}}}},"delete":{"operationId":"deleteAiKey","summary":"Forget your key of an AI vendor","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"204":{"description":"Gone"}}}},"/user/automations/pause":{"get":{"operationId":"getAutomationsPaused","summary":"Whether all the person's automations are paused","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"The switch","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Paused"}}}}}}}},"put":{"operationId":"pauseAllAutomations","summary":"Pause all the person's automations at once, or let them run again","tags":["Automations"],"security":[{"apiKey":[]},{"oauth2":["automations.write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paused"],"properties":{"paused":{"type":"boolean"}}}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"The switch","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Paused"}}}}}}}}},"/hooks/automations/{token}":{"post":{"operationId":"callAutomationWebhook","summary":"Start a webhook automation (its secret URL)","tags":["Automations"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{48}$"}},{"name":"X-Aduki-Signature","in":"header","schema":{"type":"string"},"description":"t=…,v1=… with the automation's secret; required when it is strict"},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":200},"description":"The same key queues one run"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"At most 16 KB; its top-level fields are the automation's facts"}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"queued":{"type":"boolean","description":"false: a key seen before"}}}}}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}},"/user/webhooks":{"get":{"operationId":"listWebhooks","summary":"The account's own webhooks","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}}}},"post":{"operationId":"createWebhook","summary":"Subscribe an https endpoint to events (the secret is shown once): an app's trigger","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"201":{"description":"Subscribed","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Webhook"}}}}}}}}},"/user/webhooks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Id"}}],"get":{"operationId":"getWebhook","summary":"One webhook","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"It","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Webhook"}}}}}}}},"patch":{"operationId":"updateWebhook","summary":"Change its address, events, filter or state","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"200":{"description":"Changed","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"$ref":"#/components/schemas/Webhook"}}}}}}}},"delete":{"operationId":"deleteWebhook","summary":"Unsubscribe","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["automations.read"]}],"responses":{"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"204":{"description":"Gone"}}}}},"webhooks":{"mail.received":{"post":{"operationId":"on_mail_received","summary":"mail.received (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"mail.received"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"mail.unsnoozed":{"post":{"operationId":"on_mail_unsnoozed","summary":"mail.unsnoozed (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"mail.unsnoozed"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"calendar.event.created":{"post":{"operationId":"on_calendar_event_created","summary":"calendar.event.created (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"calendar.event.created"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"calendar.event.updated":{"post":{"operationId":"on_calendar_event_updated","summary":"calendar.event.updated (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"calendar.event.updated"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"calendar.event.deleted":{"post":{"operationId":"on_calendar_event_deleted","summary":"calendar.event.deleted (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"calendar.event.deleted"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"contacts.card.created":{"post":{"operationId":"on_contacts_card_created","summary":"contacts.card.created (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"contacts.card.created"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"contacts.card.updated":{"post":{"operationId":"on_contacts_card_updated","summary":"contacts.card.updated (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"contacts.card.updated"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"contacts.card.deleted":{"post":{"operationId":"on_contacts_card_deleted","summary":"contacts.card.deleted (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"contacts.card.deleted"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"booking.created":{"post":{"operationId":"on_booking_created","summary":"booking.created (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"booking.created"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"booking.confirmed":{"post":{"operationId":"on_booking_confirmed","summary":"booking.confirmed (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"booking.confirmed"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"booking.cancelled":{"post":{"operationId":"on_booking_cancelled","summary":"booking.cancelled (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"booking.cancelled"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"booking.rescheduled":{"post":{"operationId":"on_booking_rescheduled","summary":"booking.rescheduled (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"booking.rescheduled"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"automation.run.done":{"post":{"operationId":"on_automation_run_done","summary":"automation.run.done (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"automation.run.done"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEvent"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}},"automation.run.failed":{"post":{"operationId":"on_automation_run_failed","summary":"automation.run.failed (to your webhook)","tags":["Events"],"parameters":[{"name":"X-Aduki-Event","in":"header","required":true,"schema":{"const":"automation.run.failed"}},{"name":"X-Aduki-Delivery","in":"header","required":true,"schema":{"$ref":"#/components/schemas/Id"},"description":"The same on every retry: drop what you have seen"},{"name":"X-Aduki-Timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Aduki-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>: recompute, compare in constant time, refuse a t older than five minutes"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEvent"}}}},"responses":{"2XX":{"description":"Taken. Anything else, or no answer in ten seconds, is retried (1 minute up to 24 hours)"}}}}},"components":{"schemas":{"Id":{"type":"string","pattern":"^[0-9a-f]{16}$","description":"A public id: 16 lowercase hex digits"},"Error":{"type":"object","required":["success","error"],"properties":{"success":{"const":false},"error":{"type":"object","required":["status","kind","message"],"properties":{"status":{"type":"integer"},"kind":{"type":"string","examples":["input.invalid","entity.missing","auth.forbidden"]},"message":{"type":"string","description":"What went wrong, in plain words"}}}}},"Trigger":{"type":"string","enum":["mail.received","mail.unsnoozed","calendar.event.created","calendar.event.updated","calendar.event.deleted","contacts.card.created","contacts.card.updated","contacts.card.deleted","calls.missed","calls.voicemail","calls.recording","calls.meeting.ended","calls.summary.ready","calls.assistant.message","security.alert","apikey.changed","consent.granted","consent.revoked","usage.high","ai.low","booking.created","booking.confirmed","booking.cancelled","booking.rescheduled","calendar.event.starting","booking.starting","contacts.birthday","chats.message","workspace.member.joined","workspace.member.left","center.call.abandoned","center.callback.requested","center.voicemail","center.call.missed","center.call.wrapped","store.file.created","store.file.shared","store.folder.shared","store.file.commented","manual","schedule","webhook"],"x-catalogue":[{"trigger":"mail.received","when":"An email arrives","fields":["from","to","cc","subject","body","has_attachment","folder"]},{"trigger":"mail.unsnoozed","when":"A snoozed email comes back","fields":["from","to","subject","body"]},{"trigger":"calendar.event.created","when":"An event is added to the calendar (also invitations and bookings)","fields":["title","location","organizer","attendee"]},{"trigger":"calendar.event.updated","when":"An event changes","fields":["title","location","organizer","attendee"]},{"trigger":"calendar.event.deleted","when":"An event is removed","fields":[]},{"trigger":"contacts.card.created","when":"A contact is added","fields":["name","email","company"]},{"trigger":"contacts.card.updated","when":"A contact changes","fields":["name","email","company"]},{"trigger":"contacts.card.deleted","when":"A contact is removed","fields":[]},{"trigger":"calls.missed","when":"A call to the person is missed","fields":["from_name","from","reason"]},{"trigger":"calls.voicemail","when":"Someone leaves the person a voicemail","fields":["from_name","from"]},{"trigger":"calls.recording","when":"A recording of the person's call is ready","fields":["call"]},{"trigger":"calls.meeting.ended","when":"A meeting the person hosts ends","fields":["title","reason"]},{"trigger":"calls.summary.ready","when":"A voicemail or a recording has its summary (Aduki Scriba)","fields":["kind","from_name","from","summary"]},{"trigger":"calls.assistant.message","when":"The person's call assistant took a message (Respondo)","fields":["from_name","from","urgent"]},{"trigger":"security.alert","when":"Something happens to the person's Aduki account's security (kind: signin.new_device, signin.failed, password.changed, passkey.added, recovery.used, …)","fields":["kind","outcome","app","platform","place"]},{"trigger":"apikey.changed","when":"One of the person's API keys is made, rotated, revoked, expiring, or used from a new network (kind)","fields":["kind","name","key"]},{"trigger":"consent.granted","when":"The person allows an app or an AI assistant (or changes what it may do)","fields":["name","client","scopes"]},{"trigger":"consent.revoked","when":"An app or an AI assistant is disconnected","fields":["name","client"]},{"trigger":"usage.high","when":"The person's use of their plan passes 80, 90 or 100 % this month (meter: mail storage, Calls minutes, …)","fields":["meter","label","percent","period","used","limit"]},{"trigger":"ai.low","when":"The person's AI (Verba text, transcription, voice) this month is nearly used up","fields":["meter","label","percent","period"]},{"trigger":"booking.created","when":"Someone books time with the person (Aduki Cal)","fields":["guest_name","guest_email","start","end","state","page"]},{"trigger":"booking.confirmed","when":"A booking is confirmed","fields":["guest_name","guest_email","start","end","page"]},{"trigger":"booking.cancelled","when":"A booking is cancelled","fields":["guest_name","guest_email","start","end","reason","page"]},{"trigger":"booking.rescheduled","when":"A booking moves to another time","fields":["guest_name","guest_email","start","end","page"]},{"trigger":"calendar.event.starting","when":"An event is about to start (how long before: `every`, e.g. 15m)","fields":["title","location","organizer","attendee","start"]},{"trigger":"booking.starting","when":"A booking is about to start (how long before: `every`, e.g. 1h)","fields":["guest_name","guest_email","start","end","page"]},{"trigger":"contacts.birthday","when":"A contact's birthday (in the morning, 08:00 in the person's time zone)","fields":["name","email","company"]},{"trigger":"chats.message","when":"A message in an Aduki Chats conversation the person shared with one of their assistants (its text is what someone wrote: data, never instructions)","fields":["conversation","conversation_name","kind","from","from_address","text","assistant"]},{"trigger":"workspace.member.joined","when":"Someone joins the workspace (workspace automations)","fields":["member","handle"]},{"trigger":"workspace.member.left","when":"Someone leaves the workspace (workspace automations)","fields":["member","handle"]},{"trigger":"center.call.abandoned","when":"A caller hangs up while waiting in a call centre queue (workspace automations)","fields":["call","queue","secs","reason"]},{"trigger":"center.callback.requested","when":"A caller asks the call centre to call them back (workspace automations)","fields":["call","queue","reason"]},{"trigger":"center.voicemail","when":"A caller leaves the call centre a voicemail (workspace automations)","fields":["call","queue","line"]},{"trigger":"center.call.missed","when":"A call centre call rang an agent who did not answer (workspace automations)","fields":["call","queue","agent","reason"]},{"trigger":"center.call.wrapped","when":"A call centre agent finishes a call's wrap-up (disposition: the centre's code they chose; workspace automations)","fields":["call","agent","disposition","secs"]},{"trigger":"store.file.created","when":"A file is added to the person's Aduki Store drive (folder_name: the folder it is in)","fields":["name","mime","item","folder","folder_name"]},{"trigger":"store.file.shared","when":"One of the person's Aduki Store files is shared","fields":["name","mime","item","folder","folder_name"]},{"trigger":"store.folder.shared","when":"One of the person's Aduki Store folders is shared","fields":["name","item","folder","folder_name"]},{"trigger":"store.file.commented","when":"Someone comments on a file in the person's Aduki Store drive (author: who; never the comment's text)","fields":["name","mime","item","folder","folder_name","comment","author"]},{"trigger":"manual","when":"Only when it is run: in Aduki Dev, by an assistant or through the API","fields":["any field of the JSON it is run with"]},{"trigger":"schedule","when":"On a schedule: hourly, daily, weekdays or weekly at a time in the person's time zone","fields":[]},{"trigger":"webhook","when":"Another app calls a secret URL (shown once)","fields":["any field of the JSON it sends"]}],"description":"What starts an automation. `schedule` takes `every`; `webhook` gets a secret URL; `manual` runs only when run."},"ActionType":{"type":"string","enum":["move_to","mark_read","star","forward","reply","send_email","notify_me","notify_app","start_meeting","post_chat","dnd","forwarding","calls_seen","add_contact","call_webhook","ai","ask_assistant","save_attachments","archive","trash","mark_junk","mark_unread","unstar","label","snooze","save_draft","create_event","add_to_group","cancel_booking","wait","stop"],"x-catalogue":[{"type":"move_to","does":"Move the email to a folder","needs":["folder"],"reaches_others":false},{"type":"mark_read","does":"Mark the email read","needs":[],"reaches_others":false},{"type":"star","does":"Star the email","needs":[],"reaches_others":false},{"type":"forward","does":"Forward the email","needs":["to"],"reaches_others":true},{"type":"reply","does":"Reply to the sender with a text","needs":["text"],"reaches_others":true},{"type":"send_email","does":"Send an email","needs":["to","subject","text"],"reaches_others":true},{"type":"notify_me","does":"Email the person a note","needs":["subject","text"],"reaches_others":false},{"type":"notify_app","does":"Notify the person inside Aduki (the bell in every app), not by email","needs":["subject","text"],"reaches_others":false},{"type":"start_meeting","does":"Start an Aduki Calls meeting now ({{meeting_link}} for the actions after it); with to, email those people its link","needs":["subject"],"reaches_others":false},{"type":"post_chat","does":"Post a message in a shared Aduki Chats conversation, as the person's assistant (conversation and client: the one that triggered it when left out)","needs":["text"],"reaches_others":true},{"type":"dnd","does":"Turn do-not-disturb in Aduki Calls on for a while (wait, e.g. 1h; on: false turns it off)","needs":[],"reaches_others":false},{"type":"forwarding","does":"Turn the person's call forwarding in Aduki Calls off (on: false) or back on; their forwarding rules stay as they are","needs":[],"reaches_others":false},{"type":"calls_seen","does":"Mark the person's missed calls seen","needs":[],"reaches_others":false},{"type":"add_contact","does":"Add the sender to the contacts (when not there)","needs":[],"reaches_others":false},{"type":"call_webhook","does":"POST what happened to an https URL","needs":["url"],"reaches_others":true},{"type":"ai","does":"Ask AI: summarise, choose a label, pick out details or draft a reply. engine aduki (Aduki AI, paid in AI text) or your own anthropic / openai key (it may read your Aduki for that run, read-only)","needs":["task"],"reaches_others":false},{"type":"ask_assistant","does":"Hand it to an AI assistant you connected: it gets a task to do with its own tools, the next time you use it","needs":["client","text"],"reaches_others":false},{"type":"save_attachments","does":"Save the email's attachments in Aduki Store (dest: a folder's id; your drive's top when empty)","needs":[],"reaches_others":false},{"type":"archive","does":"Archive the email","needs":[],"reaches_others":false},{"type":"trash","does":"Move the email to the trash","needs":[],"reaches_others":false},{"type":"mark_junk","does":"Move the email to junk","needs":[],"reaches_others":false},{"type":"mark_unread","does":"Mark the email unread","needs":[],"reaches_others":false},{"type":"unstar","does":"Remove the star","needs":[],"reaches_others":false},{"type":"label","does":"Label the email","needs":["label"],"reaches_others":false},{"type":"snooze","does":"Snooze the email for a while (e.g. 2h, 1d)","needs":["wait"],"reaches_others":false},{"type":"save_draft","does":"Save a reply to the sender as a draft (not sent)","needs":["text"],"reaches_others":false},{"type":"create_event","does":"Add an event to the calendar (starts after `wait`, e.g. 1d)","needs":["subject","wait"],"reaches_others":false},{"type":"add_to_group","does":"Put the sender (or the contact) in a contact group","needs":["group"],"reaches_others":false},{"type":"cancel_booking","does":"Cancel the booking (the guest is told)","needs":[],"reaches_others":true},{"type":"wait","does":"Wait, then do the actions after this (e.g. 30m, 2h, 1d; at most 7 days)","needs":["wait"],"reaches_others":false},{"type":"stop","does":"Stop: no further actions","needs":[],"reaches_others":false}]},"Condition":{"type":"object","required":["field"],"properties":{"field":{"type":"string","description":"A field of the trigger (see Trigger x-catalogue), or weekday, time (HH:MM), date (in the person's time zone); mail: from_known"},"match":{"type":"string","enum":["contains","is","starts","ends","exists","before","after"],"default":"contains"},"value":{"type":"string","maxLength":500},"not":{"type":"boolean","default":false}}},"Conditions":{"type":"object","properties":{"any":{"type":"boolean","default":false,"description":"Any condition instead of all"},"list":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/Condition"}},"throttle":{"type":"integer","minimum":1,"maximum":43200,"description":"At most once in this many minutes"}}},"Action":{"type":"object","required":["type"],"properties":{"type":{"$ref":"#/components/schemas/ActionType"},"folder":{"type":"string"},"to":{"type":"string","description":"Addresses, comma separated (at most 10); never {{ai_…}}"},"subject":{"type":"string","maxLength":8000},"text":{"type":"string","maxLength":8000,"description":"May use {{field}} of what triggered it"},"url":{"type":"string","format":"uri","description":"call_webhook: a public https address"},"client":{"type":"string","description":"ask_assistant: the connected assistant's Aduki ID client"},"task":{"type":"string","enum":["summarise","classify","extract","draft","instruct"]},"engine":{"type":"string","enum":["aduki","anthropic","openai"],"description":"ai: Aduki AI, or your own vendor key (AI keys)"},"labels":{"type":"string","description":"ai classify: labels; ai extract: details (comma separated)"},"wait":{"type":"string","examples":["30m","2h","1d"]},"label":{"type":"string","maxLength":40},"group":{"type":"string","maxLength":60},"minutes":{"type":"integer","minimum":1,"maximum":1440},"on":{"type":"boolean","description":"dnd, forwarding: on (default) or off"},"dest":{"type":"string","pattern":"^[0-9a-f]{16}$","description":"save_attachments: an Aduki Store folder's id"},"conversation":{"type":"string","description":"post_chat: a shared Aduki Chats conversation (ct_…)"}}},"AutomationInput":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"trigger":{"$ref":"#/components/schemas/Trigger"},"conditions":{"$ref":"#/components/schemas/Conditions"},"actions":{"type":"array","minItems":1,"maxItems":5,"items":{"$ref":"#/components/schemas/Action"}},"every":{"type":"string","description":"schedule: hourly, daily HH:MM, weekdays HH:MM, weekly <day> HH:MM; *.starting: how long before (15m, 1h)"},"active":{"type":"boolean"},"strict":{"type":"boolean","description":"webhook: take signed calls only"}}},"Automation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"trigger":{"$ref":"#/components/schemas/Trigger"},"conditions":{"$ref":"#/components/schemas/Conditions"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}},"every":{"type":["string","null"]},"next_run":{"type":["string","null"],"format":"date-time"},"active":{"type":"boolean"},"made_by":{"type":"string","enum":["person","assistant"]},"runs":{"type":"integer"},"last_run":{"type":["string","null"],"format":"date-time"},"webhook":{"type":"boolean"},"signed":{"type":"boolean"},"strict":{"type":"boolean"}}},"Created":{"allOf":[{"$ref":"#/components/schemas/Automation"},{"type":"object","properties":{"webhook_path":{"type":["string","null"],"description":"A webhook trigger's secret path, shown once"},"secret":{"type":["string","null"],"description":"The signing secret (whsec_…), shown once"}}}]},"Run":{"type":"object","properties":{"hex":{"$ref":"#/components/schemas/Id"},"event":{"type":"string"},"state":{"type":"string","enum":["queued","done","skipped","failed"]},"result":{"type":["object","null"],"description":"What each action did; `why` for a skipped run"},"error":{"type":["string","null"]},"created":{"type":"string","format":"date-time"},"finished":{"type":["string","null"],"format":"date-time"}}},"Runs":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"next":{"type":["string","null"],"description":"Pass as `before` for the older page; null at the end"}}},"Paused":{"type":"object","properties":{"paused":{"type":"boolean"},"since":{"type":["string","null"],"format":"date-time"}}},"Template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"about":{"type":"string"},"asks":{"type":"array","items":{"type":"string"}},"rule":{"$ref":"#/components/schemas/AutomationInput"}}},"Task":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Id"},"automation":{"type":["string","null"]},"automation_name":{"type":["string","null"]},"client":{"type":"string"},"text":{"type":"string"},"facts":{"type":"object"},"state":{"type":"string","enum":["open","done","dropped","expired"]},"note":{"type":["string","null"]},"created":{"type":"string","format":"date-time"},"expires":{"type":"string","format":"date-time"},"finished":{"type":["string","null"],"format":"date-time"}}},"WebhookInput":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","description":"A public https address"},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["mail.received","mail.unsnoozed","calendar.event.created","calendar.event.updated","calendar.event.deleted","contacts.card.created","contacts.card.updated","contacts.card.deleted","booking.created","booking.confirmed","booking.cancelled","booking.rescheduled","automation.run.done","automation.run.failed"]}},"content":{"type":"boolean","description":"mail.*: put the message's content in the body"},"filter":{"type":["object","null"],"description":"{field: pattern | [patterns]} on the events' data: \"x\" equal, \"@acme.com\" ends with, \"crm-*\" starts with"}}},"Webhook":{"type":"object","properties":{"hex":{"$ref":"#/components/schemas/Id"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"failures":{"type":"integer"},"secret":{"type":"string","description":"Shown once, at creation and rotation"}}},"Event":{"type":"object","required":["id","event","created","data"],"properties":{"id":{"$ref":"#/components/schemas/Id"},"event":{"type":"string"},"created":{"type":"string","format":"date-time"},"tenant":{"type":"string","description":"The workspace (members' accounts only)"},"account":{"type":"string","description":"The account the event is about"},"data":{"type":"object"}}},"RunEvent":{"allOf":[{"$ref":"#/components/schemas/Event"},{"type":"object","properties":{"data":{"type":"object","properties":{"automation":{"$ref":"#/components/schemas/Id"},"name":{"type":"string"},"trigger":{"$ref":"#/components/schemas/Trigger"},"run":{"$ref":"#/components/schemas/Id"},"event":{"type":"string"},"state":{"type":"string","enum":["done","failed"]},"error":{"type":"string"},"outward":{"type":"integer"},"finished":{"type":"string","format":"date-time"}}}}}]}},"responses":{"Error":{"description":"Refused, in plain words","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A personal API key from Aduki Dev with automations:read or automations:write"},"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://id.aduki.pro/oauth/authorize","tokenUrl":"https://id.aduki.pro/oauth/token","scopes":{"automations.read":"See the person's automations","automations.write":"Set up, change and run the person's automations"}}}}}}}