Saltar al contenido

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

automationRuns.notify: Parámetros de ruta y de consulta
CampoTipoObligatorioDescripción
idstring (uuid)SíIdentifier of the automation run.

Cuerpo de la solicitud: AutomationNoticeRequest

automationRuns.notify: AutomationNoticeRequest
CampoTipoObligatorioDescripción
recipient_person_idstring (uuid)SíIdentifier of the member who receives the notification.
titlestringSíNotification title.Restricciones: length 1 to 200
bodystringNoMessage; 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

automationRuns.notify: AutomationNoticeResult
CampoTipoObligatorioDescripción
notification_idstring (uuid) | nullSí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."}'