palbaseDocs

Palbase Messaging · API

PATCH/messaging/admin/conversations/{conversation_id}

Change a conversation, or make it read-only

The project's server changes a conversation as its admins may — a group's title, description, picture, timer and policies; a direct conversation's timer and vanish mode — and makes it read-only, or writable again: its people read what was said in it, nobody writes in it (no message, reaction, edit, file, or change to its details), while the server still may (POST …/messages). Each change is told in the conversation, as a message of the platform's.

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

Path

conversation_idstring (uuid) · requiredThe conversation.

Request body

add_policy"all" | "admins" · optionalWho adds people.
descriptionstring · optionalA group's description; null clears it.
edit_policy"all" | "admins" · optionalWho changes details and timer.
history_for_new_membersboolean · optionalWhether someone added reads what was said before them.
photostring · optionalWhere the app reads a group's picture; null clears it.
read_onlyboolean · optionalRead-only: its people read what was said in it, nobody writes in it (no message, reaction, edit, file, or change to its details); false makes it writable again. Told in it as read_only_on / read_only_off.
send_policy"all" | "admins" · optionalWho writes: all or admins.
timer_secondsinteger · optionalHow long a new message lives; null: for good.
titlestring · optionalA group's title.
vanishboolean · optionalA direct conversation's vanish mode.
visibility"open" | "closed" · optionalA group's: open (found in its space's open groups and joined by whom the project's hook lets; the group has a space — 400 space_required otherwise) or closed. Its admins' (or the project's server's); a person opening one is asked of the hook first (open_group): refused, 403 not_allowed. Opened, whoever joins reads what its history shows newcomers (history_for_new_members).
curl
curl -X PATCH "https://<your-ref>.palbase.studio/messaging/admin/conversations/<conversation_id>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"add_policy":"all","description":"string","edit_policy":"all","history_for_new_members":false,"photo":"string","read_only":false,"send_policy":"all","timer_seconds":5,"title":"string","vanish":false,"visibility":"open"}'

Responses

200The conversation

400A change the conversation does not take (`not_a_group`, `not_direct`, `invalid_<field>`)

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

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 AdminUpdateConversation of messaging's contract.