Palbase Messaging · API
/messaging/settingsChange how the project runs its conversations
What it names changes: how long messages are kept (null: for good), whether pushes say what a message says, what becomes of a deleted user's messages, the hook asked whom one may reach (null: none), and whether messaging.message.created says what a message says (event_text). The hook is POSTed {event: "messaging.can_message", action: "direct" | "group_add" | "open_group" | "list_open" | "join", from_user_id, to_user_ids, conversation_id, space} — whom of to_user_ids from_user_id may reach (a direct conversation, a group they are added to), or, to_user_ids being [from_user_id], whether they may have an open group in a space (open_group: making one, or opening theirs), find a space's open groups (list_open) or join one (join); space is the conversation's (absent: none), signed as Standard Webhooks sign (webhook-id, webhook-timestamp, webhook-signature), and answers 200 {allowed_user_ids: [...]}. A hook set for the first time is given its signing secret, here, once.
Called by your server, with the project's secret key.
Request body
deleted_user_messages"keep" | "delete" · optionalkeep or delete.event_textboolean · optionalWhether messaging.message.created says what the message says (text).hookobject · optionalThe hook; null removes it.push_previewboolean · optionalPushes say what a message says.retention_daysinteger · optional1 to 36,500; null: for good.search_by_meaningboolean · optionalTurned on, the messages written before are embedded too (a walk, in the background), and each one written from then on; turned off, nothing more is embedded and the vectors are removed.curl -X PUT "https://<your-ref>.palbase.studio/messaging/settings" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"deleted_user_messages":"keep","event_text":false,"hook":{"url":"string"},"push_preview":false,"retention_days":1,"search_by_meaning":false}'Responses
200The settings
400A field out of bounds (`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`)
409search_by_meaning turned on where no embedding model is reached (`search_by_meaning_unavailable`)
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 PutSettings of messaging's contract.