Notify a member from a running automation run
Módulo Platform
POST/automation-runs/{id}/noticesautomationRuns.notify
The notify action (ADR 0047): during a run, the automation's owner notifies a member of the org (automation.notice) about the event's subject, through `app.send_automation_notice`. Only a running run of the caller's own automation (404 otherwise); the recipient must be a member (automation_person_not_member: 422). Needs org.automations.write. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requiere la capacidad org.automations.write.
- Alcances de OAuth: org.
- Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
- Estados de error: 400, 401, 404, 409, 422, 429. Los errores son detalles de problema RFC 9457.
Parámetros de ruta y de consulta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| id | string (uuid) | Sí | Identifier of the automation run. |
Cuerpo de la solicitud: AutomationNoticeRequest
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| recipient_person_id | string (uuid) | Sí | Identifier of the member who receives the notification. |
| title | string | Sí | Notification title.Restricciones: length 1 to 200 |
| body | string | No | Message; the title is repeated when absent.Restricciones: length 1 to 2000 |
{
"recipient_person_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
"title": "New task: Call the venue",
"body": "Call the venue needs a look."
}Respuesta 201: AutomationNoticeResult
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| notification_id | string (uuid) | null | Sí | Identifier of the notification created. |
{
"notification_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}Ejemplos de código
curl -X POST "$XOS_BASE_URL/automation-runs/0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f/notices" \
-H "Authorization: Bearer $XOS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"recipient_person_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f","title":"New task: Call the venue","body":"Call the venue needs a look."}'const { data } = await xos.automationRuns.notify("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {
"recipient_person_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
"title": "New task: Call the venue",
"body": "Call the venue needs a look."
});response = xos.automation_runs.notify("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {"recipient_person_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", "title": "New task: Call the venue", "body": "Call the venue needs a look."})xos automation-runs notify 0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f --data '{"recipient_person_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f","title":"New task: Call the venue","body":"Call the venue needs a look."}'