Skip to main content
GET
Read Segment Context
Use this endpoint when a search result looks relevant and you need more of the surrounding text. Pass the pointer from a search result passage. Use direction to choose which side to read: around (default), before, or after. Use maxTokens to limit the size of the response. It defaults to 2000 and cannot exceed 32000. At least one chunk is always returned, even if that chunk alone is larger than maxTokens. The response includes prev and next pointers for the neighboring chunks, or null at the start or end of the document. Pass either one back to this endpoint to keep reading in that direction. If the pointer doesn’t exist or the user doesn’t have access to it, the request returns a 404 with the error code RESOURCE_NOT_FOUND. Run a new search to get a fresh pointer.

Authorizations

Authorization
string
header
required

Your Paragon User Token (JWT), which you can generate using your project's signing keys.

Path Parameters

projectId
string<uuid>
required

Your Paragon Project ID. Must match the Project ID in your Paragon User Token.

pointer
string
required

The pointer from a passage in a search result.

Query Parameters

direction
enum<string>
default:around

Which side of the pointer to read: around it, before it, or after it.

Available options:
around,
before,
after
maxTokens
integer
default:2000

The maximum number of tokens to return. At least one chunk is always returned, even if it is larger than this limit.

Required range: 1 <= x <= 32000
identity
string

The account whose access applies, used on every source. Unlike search, this endpoint accepts a single string only.

Maximum string length: 1024
email
string
deprecated

Deprecated. Use identity instead.

Maximum string length: 1024

Response

The text around the pointer.

id
string
required

Unique ID for the record, in the format {syncId}.{recordId}.

text
string
required

The text around the pointer.

prev
string | null
required

Pointer to the chunk before this text, or null if this is the start of the record.

next
string | null
required

Pointer to the chunk after this text, or null if this is the end of the record.

tokenBudget
object
required

How much text was returned.

tokenizer
enum<string>
required

The tokenizer used to count tokens.

Available options:
o200k_base