Send a targeted message

Send a targeted message to everyone matching a name, location, or role — no confirmation step.

POST /messages sends a message to everyone matching a filter, right now. There's no confirmation step — the request sends as written.

curl -X POST "https://mcp.onkey.chat/functions/v1/rest-api/messages" \
  -H "Authorization: Bearer okm_<your-token-here>" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Please submit your hours by Friday.",
    "filter": { "location": "Glendale" }
  }'

The filter must set at least one of name, location, or role. If it matches nobody, you still get a 200 with "sent_to": 0 — not an error.

📘

Messages vs. alerts

Targeted messages are not rate-limited. Broadcast alerts (POST /alerts) share a cap across every channel — see Rate limits.

For the full request and response schema, see the API Reference.

Next steps


Did this page help you?