Skip to content
AI Inbx
Esc
navigateopen⌘Jpreview

Retrieve a thread

Returns a thread with its messages inline, oldest first. Messages paginate independently of the thread list via message_limit and message_cursor, so a long conversation can be walked without loading it whole.

GET/threads/{thread_id}
Authorization
AuthorizationBearer token (API key) · headerrequired
Pass an AI Inbx API key as a Bearer token.
Path parameters
thread_idstringrequired
The prefixed thread ID.
matches ^[a-z]+_[0-9a-f]{32}$
Query parameters
message_limitinteger
Maximum messages to return.
min 1 · max 100 · default: 40
message_cursorstring
Continue after this email from the previous page.
matches ^eml_[0-9a-f]{32}$
Responses
200Success.
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
space_idstring | anyrequired
Which space a resource is in. Null is the workspace itself — what every resource of a workspace that has no spaces says.
Show properties
Any of:
string
string
any
any
subjectstringrequired
mailboxstring<email>required
matches ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
participantsstring<email>[]required
message_countintegerrequired
min 0 · max 9007199254740991
last_message_atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
forward_ofstring | anyrequired
The thread this one was forwarded from, when a forward opened it.
Show properties
Any of:
string
string
any
any
messagesobject[]required
Show properties
Array of object
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
thread_idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
space_idstring | anyrequired
Which space a resource is in. Null is the workspace itself — what every resource of a workspace that has no spaces says.
Show properties
Any of:
string
string
any
any
directionstringrequired
Allowed:inboundoutbound
statusstringrequired
Allowed:scheduledcanceledqueuedsendingsentdeliveredbouncedcomplainedfailedreceived
fromobjectrequired
Show properties
namestring | any
Show properties
Any of:
string
string
any
any
addressstring<email>required
matches ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
tostring<email>[]required
ccstring<email>[]required
bccstring<email>[]required
reply_tostring<email>[]required
subjectstringrequired
snippetstringrequired
htmlstring | anyrequired
Show properties
Any of:
string
string
any
any
textstring | anyrequired
Show properties
Any of:
string
string
any
any
categorystring | anyrequired
Show properties
Any of:
string
string
any
any
suppression_keystring | anyrequired
Show properties
Any of:
string
string
any
any
message_idstringrequired
in_reply_tostring | anyrequired
Show properties
Any of:
string
string
any
any
idempotency_keystring | anyrequired
Show properties
Any of:
string
string
any
any
created_atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
scheduled_atstring<date-time> | anyrequired
Show properties
Any of:
string<date-time>
string<date-time>
any
any
sent_atstring<date-time> | anyrequired
Show properties
Any of:
string<date-time>
string<date-time>
any
any
attachmentsobject[]required
Show properties
Array of object
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
filenamestringrequired
content_typestringrequired
sizeintegerrequired
min 0 · max 9007199254740991
cidstring | anyrequired
Show properties
Any of:
string
string
any
any
download_urlstring<uri>required
preparationobject | anyrequired
Show properties
Any of:
object
statusstringrequired
Allowed:readypartialunsupportedfailed
formatstring | anyrequired
Show properties
Any of:
string
string
any
any
pagesinteger | anyrequired
Show properties
Any of:
integer
integer
any
any
warningsstring[]required
content_urlstring<uri> | anyrequired
Show properties
Any of:
string<uri>
string<uri>
any
any
textstring | any
Show properties
Any of:
string
string
any
any
any
any
stripped_textstring | anyrequired
What this message says: typed text only, quoted conversation and signature removed.
Show properties
Any of:
string
string
any
any
segmentsobject[]required
Show properties
Array of object
kindstringrequired
Allowed:writtenquotedsignature
textstringrequired
referencesstring[]required
headersobject[]required
Show properties
Array of object
namestringrequired
valuestringrequired
eventsobject[]required
Show properties
Array of object
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
typestringrequired
Allowed:scheduledcanceledqueuedreplayedsentdelivereddeferredbouncedcomplainedfailed
atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
recipientstring<email> | anyrequired
Show properties
Any of:
string<email>
string<email>
any
any
detailstring | anyrequired
Show properties
Any of:
string
string
any
any
engagementsobject[]required
Show properties
Array of object
kindstringrequired
Allowed:openclick
atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
urlstring<uri> | anyrequired
Show properties
Any of:
string<uri>
string<uri>
any
any
user_agentstring | anyrequired
Show properties
Any of:
string
string
any
any
messages_next_cursorstring | anyrequired
Show properties
Any of:
string
string
any
any
400The request is invalid.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
401The API key is missing or invalid.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
403The API key does not have the required scope.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
404The requested resource does not exist.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
409The request conflicts with the resource's current state.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
413The request body or attachments are too large.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
415The request body is not JSON.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
422The request body failed validation.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
429The organisation's request budget is spent (`too_many_requests`), or an upstream mail provider is throttling (`rate_limited`).
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
500An internal error occurred.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
502An upstream mail provider failed.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
503The service is temporarily unavailable.
typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
Request
curl -X GET "https://api.aiinbx.com/api/v2/threads/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "id": "string",
  "space_id": "string",
  "subject": "string",
  "mailbox": "user@example.com",
  "participants": [
    "user@example.com"
  ],
  "message_count": 9007199254740991,
  "last_message_at": "2019-08-24T14:15:22Z",
  "forward_of": "string",
  "messages": [
    {
      "id": "string",
      "thread_id": "string",
      "space_id": "string",
      "direction": "inbound",
      "status": "scheduled",
      "from": {
        "name": "string",
        "address": "user@example.com"
      },
      "to": [
        "user@example.com"
      ],
      "cc": [
        "user@example.com"
      ],
      "bcc": [
        "user@example.com"
      ],
      "reply_to": [
        "user@example.com"
      ],
      "subject": "string",
      "snippet": "string",
      "html": "string",
      "text": "string",
      "category": "human",
      "suppression_key": "string",
      "message_id": "string",
      "in_reply_to": "string",
      "idempotency_key": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "scheduled_at": "2019-08-24T14:15:22Z",
      "sent_at": "2019-08-24T14:15:22Z",
      "attachments": [
        {
          "id": "string",
          "filename": "string",
          "content_type": "string",
          "size": 9007199254740991,
          "cid": "string",
          "download_url": "http://example.com",
          "preparation": {
            "status": "ready",
            "format": "markdown",
            "pages": -9007199254740991,
            "warnings": [
              "string"
            ],
            "content_url": "http://example.com",
            "text": "string"
          }
        }
      ],
      "stripped_text": "string",
      "segments": [
        {
          "kind": "written",
          "text": "string"
        }
      ],
      "references": [
        "string"
      ],
      "headers": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "events": [
        {
          "id": "string",
          "type": "scheduled",
          "at": "2019-08-24T14:15:22Z",
          "recipient": "user@example.com",
          "detail": "string"
        }
      ],
      "engagements": [
        {
          "kind": "open",
          "at": "2019-08-24T14:15:22Z",
          "url": "http://example.com",
          "user_agent": "string"
        }
      ]
    }
  ],
  "messages_next_cursor": "string"
}