Mark all messages as read
- Path
/inbox/messages/read-all- Auth
- Access token · browser or app
const url = 'https://releva.ai/api/v0/inbox/messages/read-all';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"userId":"DEMO-CUSTOMER-1001"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://releva.ai/api/v0/inbox/messages/read-all \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "userId": "DEMO-CUSTOMER-1001" }'Marks every unread message of the shopper as read and records one inboxMessageRead event per message. Answers 202 also when nothing was unread.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send as application/json. Without that content type the body is not read and the call answers 400.
object
Example
{ "userId": "DEMO-CUSTOMER-1001"}Responses
Section titled “Responses”Accepted for asynchronous processing.
object
Example
{}Authentication error, or userId missing or longer than 96 characters.
object
Human-readable error. Several validation errors are joined with a space.
Examples
{ "message": "Authorization header is missing", "and accessToken url parameters is also missing. At least one of them is required.": null}{ "message": "Authorization header is malformed. It should look like `Bearer <string>`."}{ "message": "The access token you provided is invalid."}{ "message": "Domain with the provided access token cannot be found."}{ "message": "A valid userId is required."}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}Unexpected error. Currently also returned for malformed input: a messageId that is not a UUID, a userId
that is not a string, userId only in the query string of a POST or DELETE, or a negative limit.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "An internal error occurred."}