API Reference

Messages

Pin / unpin message

Pins or unpins a single message inside a conversation. Identifiers come from the message.received webhook event: conversation_id = data.conversation.id, message_id = data.message.id, sender_id = data.sender.id. sender_id is optional and defaults to the account itself. pinned=true pins (optionally for duration_seconds), pinned=false unpins.

POSThttps://api.unifyport.ai/v1/messages/pin

Before you call

Use a server-side X-Api-Key for the workspace that owns the resource. Replace every placeholder before running a sample.

Request parameters

Headers

X-Api-Key
stringrequired

Workspace API key. The workspace is resolved from this header.

Content-Type
stringrequired

Use application/json when sending a JSON request body.

Request body

account_id
stringrequired

Account that performs the action.

conversation_id
stringrequired

Target conversation identifier.

message_id
stringrequired

Target message identifier.

sender_id
string

Original sender identifier; omit only when the action targets the account's own message.

pinned
booleanrequired

true pins the message; false unpins it.

duration_seconds
integer

Optional pin duration in seconds.

format: uint32

Understand the result

Use the documented response fields and HTTP status. Successful 204 responses have no body; use X-Request-Id for diagnosis. Follow the related operations for the next step.

Response 200 OK

{
  "request_id": "<REQUEST_ID>",
  "data": {
    "ok": true
  }
}

Response body

ok
boolean

Always true when the operation succeeded; failures return a non-2xx status instead.

Responses

200

200 OK

Request succeeded. See the example response body.

400

Bad Request

The request body, path, or parameters are invalid.

401

Unauthorized

The X-Api-Key header is missing or invalid.

409

Conflict

The requested operation conflicts with an existing provider account or resource.

500

Internal Server Error

The service encountered an unexpected error.

501

Not Implemented

The selected provider does not implement this operation.

502

Bad Gateway

The provider adapter or upstream provider could not complete the operation.

If the request fails

Inspect HTTP status and error.code/numeric_code, and keep request_id for diagnosis. Correct invalid parameters, complete required authorization or check runtime state as appropriate. Confirm the outcome before retrying a send or another write. Error reference

invalid_request · 10000 · 400
Check required fields, formats and channel conditions, then correct the request.
invalid_api_key · 11001 · 401
Check X-Api-Key and whether the workspace is active.