palbaseDocs

Palbase Messaging · API

POST/messaging/admin/conversations/{conversation_id}/messages

Say something in a conversation

The project's server says something in a conversation — as the app (sender_id null), or as one of its people (as_user_id, with via): the message is theirs, as if they sent it (what they may send there, their read of it, the others' unread counts and pushes, from them), and says what wrote it (Message.via). In a thread too (thread_id). Sent again with the same client_message_id, it is the same message (200).

Called by your server, with the project's secret key.

Path

conversation_idstring (uuid) · requiredThe conversation.

Request body

as_user_idstring · optionalThe person it is written as: one of the conversation's people now. The message is theirs, as if they sent it — what they may send there, their read of it, the others' unread counts and pushes, from them — and says via what wrote it. Each is in the access log, the person named.
client_message_idstring · requiredThe server's own id of it: sent again with it, it is the same message.
mentionsobject[] · optionalWhom its words name.
textstring · requiredWhat it says.
thread_idstring (uuid) · optionalThe message whose thread it answers.
viastring · optionalWhat wrote it (as pal), shown with the message (Message.via): 1 to 32 letters, digits and _ . -. Required with as_user_id — the others always know it was not the person's own hand.
curl
curl -X POST "https://<your-ref>.palbase.studio/messaging/admin/conversations/<conversation_id>/messages" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"client_message_id":"string","text":"string"}'

Responses

200The message sent before

201The message sent

400The request is malformed, or a field breaks a rule (the error names which)

401No key, a key of no project, a token not valid (the edge's answer), or no person's session (`user_required`)

403Not the project's secret key (`secret_key_required`)

404No such conversation

409as_user_id blocks the other in this direct conversation (`blocked`)

413The request body is too large (`request_too_large`)

429Over the project's request limit; Retry-After says when to try again

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation AdminSendMessage of messaging's contract.