Mutation
mutation MintEmbedToken($input: MintEmbedTokenInput!) {
mintEmbedToken(input: $input) {
token {
token
expiresAt {
unixTimestamp
iso8601
}
jwksUrl
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"embedId": "string",
"threadId": "id"
}
}Response
{
"data": {
"mintEmbedToken": {
"token": {
"token": "string",
"expiresAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"jwksUrl": "string"
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
mintEmbedToken
Issues a short-lived RS256-signed JWT (60-second TTL) that a Plain embed iframe passes to your
backend so you can verify the calling user’s identity and context. Verify the token by fetching
the public keys from the JWKS endpoint returned in EmbedToken.jwksUrl. The token carries
claims identifying the Plain user, the thread, and the customer, plus the plain_embed_id you
supplied for audit logging. Each call produces a unique token; call this mutation immediately
before your embed needs to make an authenticated request to your backend.
MUTATION
mintEmbedToken(input: MintEmbedTokenInput!): MintEmbedTokenOutput!Arguments
input
required
Returns
token
error
Mutation
mutation MintEmbedToken($input: MintEmbedTokenInput!) {
mintEmbedToken(input: $input) {
token {
token
expiresAt {
unixTimestamp
iso8601
}
jwksUrl
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"embedId": "string",
"threadId": "id"
}
}Response
{
"data": {
"mintEmbedToken": {
"token": {
"token": "string",
"expiresAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"jwksUrl": "string"
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

