/v1/agentTokens/encodeToken
—
post

Encode an agent token into JWT format for use in API requests. This converts the raw token into a signed JWT that can be used for authentication.

Path Parameters
Not Applicable
Request Headers
HttpEndpointRequestHeaders_AuthRequired_JsonContentType

FieldTypeRequiredDescription
AuthorizationstringYes

Access token

Example: Bearer <token>

Content-TypestringYes

HTTP JSON request content type

Example: application/json

Request Query
Not Applicable
Request Body
EncodeAgentTokenEndpointParams

Parameters for encoding an agent token into JWT format

{
workspaceId?: string
providedResourceId?: string
tokenId?: string
onReferenced?: boolean
}
200 — Response Headers
HttpEndpointResponseHeaders_ContentType_ContentLength

FieldTypeRequiredDescription
Content-TypestringYes

HTTP JSON response content type

Example: application/json

Content-LengthstringYes

HTTP response content length in bytes

Example: 1024

200 — Response Body
EncodeAgentTokenEndpointResult

Response containing the encoded JWT token

{
jwtToken: string
refreshToken?: string
jwtTokenExpiresAt?: number
}
4XX or 5XX — Response Headers
HttpEndpointResponseHeaders_ContentType_ContentLength

FieldTypeRequiredDescription
Content-TypestringYes

HTTP JSON response content type

Example: application/json

Content-LengthstringYes

HTTP response content length in bytes

4XX or 5XX — Response Body
EndpointErrorResult

Endpoint error result

{
errors?: Array<ExternalError>
}
ExternalError

{
message: string
}