Palbase Messaging · API
/messaging/conversations/directThe direct conversation with a person
The one conversation between the reader and another person, with its two members: made the first time — when the project's hook lets them reach them — and the same one every time after (200). The other sees it once something is said in it.
Called by a signed-in user of your app, with their token and the publishable key.
Request body
spacestring · optionalThe space it is in (org:<id>): the pair has one direct conversation in each space, and one with none. 1 to 128 letters, digits and : _ . / @ -; absent: none.user_idstring · requiredThe other person.curl -X POST "https://<your-ref>.palbase.studio/messaging/conversations/direct" \
-H "apikey: $PALBASE_PUBLISHABLE_KEY" \
-H "authorization: Bearer $USER_ACCESS_TOKEN" \
-H "content-type: application/json" \
-d '{"user_id":"string"}'Responses
200The conversation there was
201The conversation made
400`user_id` is not another person's id (`invalid_user_id`)
401No key, a key of no project, a token not valid (the edge's answer), or no person's session (`user_required`)
403The project does not let the reader write to this person (`not_allowed`)
409The person's account was deleted (`user_deleted`)
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 OpenDirectConversation of messaging's contract.