REST API Reference

Use REST API v1 from your server only. Long-lived Sela API keys are not supported for direct browser or mobile use in this version.

Authentication

Send the key in the Authorization header as a Bearer token. Use separate test and production keys when possible.

bash
curl https://your-convex-site.convex.site/api/v1/conversations \
  -H "Authorization: Bearer sk_live_..."

Supported Endpoints

GET

/api/v1/conversations

Lists organization conversations. Requires the conversations:read permission.

bash
curl "https://your-convex-site.convex.site/api/v1/conversations?limit=25&status=open" \
  -H "Authorization: Bearer sk_live_..."
GET

/api/v1/messages

Lists messages for a single conversation. Requires the messages:read permission and the conversation_id query parameter.

bash
curl "https://your-convex-site.convex.site/api/v1/messages?conversation_id=jt7..." \
  -H "Authorization: Bearer sk_live_..."

Pagination

Read endpoints support limit and cursor and return next_cursor and is_done inside meta.

json
{
  "data": [],
  "meta": {
    "request_id": "c6f1...",
    "next_cursor": "eyJ...",
    "is_done": false,
    "limit": 25
  }
}

Errors

Every response includes a request ID in X-Sela-Request-Id and in the response body for tracing.

json
{
  "error": {
    "code": "rate_limited",
    "message": "API key rate limit exceeded.",
    "request_id": "c6f1..."
  }
}