PKCE code verifier (required if code challenge was sent)
Response (ExchangeTokenResponse)
Field
Type
Description
GrantToken
string
JWT grant token
ExpiresAt
string
ISO 8601 grant expiry
Scopes
[]string
Granted scopes
RefreshToken
string
Refresh token for active-grant rotation
GrantID
string
Grant record ID
Refresh
Exchange a refresh token for a new grant token while the underlying grant remains active. Refresh tokens are single-use, and each successful rotation returns a new refresh token without extending ExpiresAt.
tokenResp, err := client.Tokens.Refresh(ctx, grantex.RefreshTokenParams{ RefreshToken: "current-refresh-token", AgentID: "agent-id", // Persist this with the old token until the response is durable. IdempotencyKey: refreshAttemptID,})// tokenResp.RefreshToken is a NEW refresh token — store it// tokenResp.ExpiresAt is the same grant expiration
Always store and use the newest RefreshToken. Retry a lost response with the same previous token and IdempotencyKey. The SDK retains an omitted key for five minutes in the current process, but a restarted caller must restore an explicit persisted key. After the window, once the rotated child token has been used, or after grant expiration, the previous refresh token is rejected.
Parameters
Parameter
Type
Required
Description
RefreshToken
string
Yes
Current refresh token
AgentID
string
Yes
Agent ID
IdempotencyKey
string
No
Stable 16-256 character logical-refresh identifier. Generated and cached in-process when omitted; persist it for restart/failover recovery.
Response
Same ExchangeTokenResponse as Exchange — includes a new GrantToken and RefreshToken with the same GrantID and ExpiresAt.
Verify
Perform online token verification against the Grantex API.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Grantex","description":"Documentation and API reference for Grantex AI agent authorization, delegated OAuth grants, agent identity, scoped permissions, MCP authorization, verification, and audit. Grantex is owned by Orchestrum Technologies LLP; inventor and owner: Sanjeev Kumar.","colors":{"primary":"#3fb950","light":"#58a6ff","dark":"#2ea043"},"logo":{"light":"https://mintcdn.com/grantex/fh2nVWzV0WTpAhmk/logo/light.svg?fit=max\u0026auto=format\u0026n=fh2nVWzV0WTpAhmk\u0026q=85\u0026s=45b5032cb19c05941960c4bb4239c8cd","dark":"https://mintcdn.com/grantex/fh2nVWzV0WTpAhmk/logo/dark.svg?fit=max\u0026auto=format\u0026n=fh2nVWzV0WTpAhmk\u0026q=85\u0026s=4f8e48fcb123c40e9a32121a5b6e542a"},"favicon":"https://mintcdn.com/grantex/fjShexQIs6R8ZYjW/favicon.svg?fit=max\u0026auto=format\u0026n=fjShexQIs6R8ZYjW\u0026q=85\u0026s=7d1fea44a19ae98fb8b6d9c6732dd38a","navbar":{"links":[{"href":"https://github.com/mishrasanjeev/grantex","type":"github"}]},"search":{"prompt":"Search Grantex docs..."},"seo":{"metatags":{"robots":"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1","og:site_name":"Grantex Documentation","twitter:card":"summary_large_image","twitter:site":"@grantex_dev"},"indexing":"navigable"},"metadata":{"timestamp":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"grantex","hasAudioNarration":false,"actualSubdomain":"grantex","customDomains":["docs.grantex.dev"],"gitSource":{"type":"github","owner":"mishrasanjeev","repo":"grantex","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b057012b4d87969a79267f5","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"API Reference","count":155},{"language":"default","tag":"Documentation","count":141},{"language":"default","tag":"Resources","count":60},{"language":"default","tag":"Guides","count":41},{"language":"default","tag":"Integrations","count":31},{"language":"default","tag":"Python SDK","count":27},{"language":"default","tag":"TypeScript SDK","count":27},{"language":"default","tag":"Go SDK","count":26},{"language":"default","tag":"Blog","count":25},{"language":"default","tag":"Posts","count":25}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"sdks/go/tokens","slug":"/sdks/go/tokens","pageMetadata":{"title":"Tokens","description":"Exchange, refresh, verify, and revoke grant tokens","href":"/sdks/go/tokens"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Exchange, refresh, verify, and revoke grant tokens\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Tokens`}),` service handles the complete token lifecycle: exchanging authorization codes, refreshing tokens, online verification, and revocation.`]}),`\n`,_jsx(Heading,{level:`2`,id:`exchange`,children:`Exchange`}),`\n`,_jsx(_components.p,{children:`Exchange an authorization code for a grant token after the user consents.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tokenResp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Tokens`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Exchange`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`grantex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ExchangeTokenParams`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"authorization-code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` AgentID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Code`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Authorization code from callback`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`AgentID`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Agent that requested authorization`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CodeVerifier`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`PKCE code verifier (required if code challenge was sent)`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`response-exchangetokenresponse`,children:[`Response (`,_jsx(_components.code,{children:`ExchangeTokenResponse`}),`)`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GrantToken`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`JWT grant token`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ExpiresAt`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`ISO 8601 grant expiry`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Scopes`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[]string`})}),_jsx(_components.td,{children:`Granted scopes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RefreshToken`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Refresh token for active-grant rotation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GrantID`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Grant record ID`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`refresh`,children:`Refresh`}),`\n`,_jsxs(_components.p,{children:[`Exchange a refresh token for a new grant token while the underlying grant remains active. Refresh tokens are single-use, and each successful rotation returns a new refresh token without extending `,_jsx(_components.code,{children:`ExpiresAt`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tokenResp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Tokens`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Refresh`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`grantex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`RefreshTokenParams`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` RefreshToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"current-refresh-token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` AgentID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Persist this with the old token until the response is durable.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` IdempotencyKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`refreshAttemptID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// tokenResp.RefreshToken is a NEW refresh token — store it`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// tokenResp.ExpiresAt is the same grant expiration`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Always store and use the newest `,_jsx(_components.code,{children:`RefreshToken`}),`. Retry a lost response with the same previous token and `,_jsx(_components.code,{children:`IdempotencyKey`}),`. The SDK retains an omitted key for five minutes in the current process, but a restarted caller must restore an explicit persisted key. After the window, once the rotated child token has been used, or after grant expiration, the previous refresh token is rejected.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`parameters-2`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RefreshToken`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Current refresh token`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`AgentID`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Agent ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`IdempotencyKey`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Stable 16-256 character logical-refresh identifier. Generated and cached in-process when omitted; persist it for restart/failover recovery.`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Same `,_jsx(_components.code,{children:`ExchangeTokenResponse`}),` as Exchange — includes a new `,_jsx(_components.code,{children:`GrantToken`}),` and `,_jsx(_components.code,{children:`RefreshToken`}),` with the same `,_jsx(_components.code,{children:`GrantID`}),` and `,_jsx(_components.code,{children:`ExpiresAt`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`verify`,children:`Verify`}),`\n`,_jsx(_components.p,{children:`Perform online token verification against the Grantex API.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Tokens`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Verify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"grant-token-jwt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` err`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` nil`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Fatal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Valid`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fmt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Printf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Grant ID: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#9CDCFE`},children:`%s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, Scopes: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#9CDCFE`},children:`%v`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`GrantID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Scopes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`3`,id:`response-verifytokenresponse`,children:[`Response (`,_jsx(_components.code,{children:`VerifyTokenResponse`}),`)`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Valid`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`bool`})}),_jsx(_components.td,{children:`Whether the token is valid`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GrantID`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`*string`})}),_jsx(_components.td,{children:`Grant ID (if valid)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Scopes`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`[]string`})}),_jsx(_components.td,{children:`Token scopes (if valid)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Principal`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`*string`})}),_jsx(_components.td,{children:`Principal ID (if valid)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Agent`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`*string`})}),_jsx(_components.td,{children:`Agent DID (if valid)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ExpiresAt`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`*string`})}),_jsx(_components.td,{children:`Token expiry (if valid)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`revoke`,children:`Revoke`}),`\n`,_jsx(_components.p,{children:`Revoke a token by its JTI (token ID).`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`go`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`go`,children:_jsxs(_components.code,{language:`go`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Tokens`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Revoke`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"token-jti\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Returns `,_jsx(_components.code,{children:`nil`}),` on success (HTTP 204).`]}),`\n`,_jsx(Heading,{level:`2`,id:`ownership`,children:`Ownership`}),`\n`,_jsxs(_components.p,{children:[`Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: `,_jsx(_components.a,{href:`mailto:sanjeev@orchestrum.in`,children:`sanjeev@orchestrum.in`}),` or `,_jsx(_components.a,{href:`mailto:mishra.sanjeev@gmail.com`,children:`mishra.sanjeev@gmail.com`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Tokens","description":"Exchange, refresh, verify, and revoke grant tokens","href":"/sdks/go/tokens"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Exchange","slug":"exchange","depth":2,"children":[{"title":"Parameters","slug":"parameters","depth":3,"children":[]},{"title":"Response (ExchangeTokenResponse)","slug":"response-exchangetokenresponse","depth":3,"children":[]}]},{"title":"Refresh","slug":"refresh","depth":2,"children":[{"title":"Parameters","slug":"parameters-2","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]}]},{"title":"Verify","slug":"verify","depth":2,"children":[{"title":"Response (VerifyTokenResponse)","slug":"response-verifytokenresponse","depth":3,"children":[]}]},{"title":"Revoke","slug":"revoke","depth":2,"children":[]},{"title":"Ownership","slug":"ownership","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"grantex","siteName":"Grantex","title":"Tokens - Grantex","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-24T11:08:14.946Z","gitLastModified":"2026-08-31T21:25:17.000Z","originalFileLocation":"sdks/go/tokens.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Exchange, refresh, verify, and revoke grant tokens\">\u003cmeta data-mint-head name=\"application-name\" content=\"Grantex\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Tokens - Grantex\">\u003cmeta data-mint-head property=\"og:description\" content=\"Exchange, refresh, verify, and revoke grant tokens\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Grantex Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.grantex.dev/sdks/go/tokens\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://grantex.mintlify.site/_mintlify/api/og/v2?division=Authorization\u0026amp;title=Tokens\u0026amp;description=Exchange%2C+refresh%2C+verify%2C+and+revoke+grant+tokens\u0026amp;theme=615165a2998a6d8eb9253191\u0026amp;signature=4b1c9a1c51b92a3eb695015e52959f121205daddb292db5e2f9da6932cc61c1a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Tokens - Grantex\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Exchange, refresh, verify, and revoke grant tokens\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://grantex.mintlify.site/_mintlify/api/og/v2?division=Authorization\u0026amp;title=Tokens\u0026amp;description=Exchange%2C+refresh%2C+verify%2C+and+revoke+grant+tokens\u0026amp;theme=615165a2998a6d8eb9253191\u0026amp;signature=4b1c9a1c51b92a3eb695015e52959f121205daddb292db5e2f9da6932cc61c1a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/grantex/8bJAlEutDRbcOOje/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Grantex\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3fb950\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.grantex.dev/sdks/go/tokens\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdks/go/tokens.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.grantex.dev/#organization\",\"name\":\"Grantex\",\"url\":\"https://docs.grantex.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/grantex/fh2nVWzV0WTpAhmk/logo/light.svg?fit=max\u0026auto=format\u0026n=fh2nVWzV0WTpAhmk\u0026q=85\u0026s=45b5032cb19c05941960c4bb4239c8cd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.grantex.dev#website\",\"name\":\"Grantex\",\"url\":\"https://docs.grantex.dev\",\"publisher\":{\"@id\":\"https://docs.grantex.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.grantex.dev/sdks/go/tokens#webpage\",\"url\":\"https://docs.grantex.dev/sdks/go/tokens\",\"name\":\"Tokens\",\"description\":\"Exchange, refresh, verify, and revoke grant tokens\",\"dateModified\":\"2026-08-31T21:25:17.000Z\",\"isPartOf\":{\"@id\":\"https://docs.grantex.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.grantex.dev/sdks/go/tokens#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.grantex.dev/sdks/go/tokens#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Authorization\",\"item\":\"https://docs.grantex.dev/sdks/go/authorization\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tokens\",\"item\":\"https://docs.grantex.dev/sdks/go/tokens\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.grantex.dev/sdks/go/tokens#article\",\"headline\":\"Tokens\",\"name\":\"Tokens\",\"description\":\"Exchange, refresh, verify, and revoke grant tokens\",\"url\":\"https://docs.grantex.dev/sdks/go/tokens\",\"mainEntityOfPage\":{\"@id\":\"https://docs.grantex.dev/sdks/go/tokens#webpage\"},\"dateModified\":\"2026-08-31T21:25:17.000Z\",\"publisher\":{\"@id\":\"https://docs.grantex.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.grantex.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Grantex\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Grantex\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdks/go/tokens.md","siteName":"Grantex","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"TypeScript SDK","pages":[{"title":"TypeScript SDK","href":"/sdks/typescript/overview"}]},{"tab":"Python SDK","pages":[{"title":"Python SDK","href":"/sdks/python/overview"}]},{"tab":"Go SDK","groups":[{"group":"Overview","pages":[{"title":"Go SDK","href":"/sdks/go/overview"}]},{"group":"Authorization","pages":[{"title":"Authorization","description":"Create authorization requests and manage the consent flow","href":"/sdks/go/authorization"},{"title":"Tokens","href":"/sdks/go/tokens"},{"title":"Offline Verification","description":"Verify signatures and claims locally with a remote JWKS request per standalone call","href":"/sdks/go/offline-verification"},{"title":"PKCE","href":"/sdks/go/pkce"}]},{"group":"Resources","pages":[{"title":"Agents","href":"/sdks/go/agents"},{"title":"Grants","href":"/sdks/go/grants"},{"title":"Audit","href":"/sdks/go/audit"},{"title":"Webhooks","href":"/sdks/go/webhooks"},{"title":"Policies","href":"/sdks/go/policies"},{"title":"Compliance","href":"/sdks/go/compliance"},{"title":"Anomalies","href":"/sdks/go/anomalies"},{"title":"Billing","href":"/sdks/go/billing"},{"title":"SCIM","href":"/sdks/go/scim"},{"title":"SSO (OIDC + SAML + LDAP)","href":"/sdks/go/sso"},{"title":"Principal Sessions","href":"/sdks/go/principal-sessions"},{"title":"WebAuthn","href":"/sdks/go/webauthn"},{"title":"Credentials","href":"/sdks/go/credentials"},{"title":"Budgets","href":"/sdks/go/budgets"},{"title":"Events","href":"/sdks/go/events"},{"title":"Usage","href":"/sdks/go/usage"},{"title":"Domains","href":"/sdks/go/domains"},{"title":"Passports","href":"/sdks/go/passports"},{"title":"Commerce V1","sidebarTitle":"Commerce V1","href":"/sdks/go/commerce"},{"title":"Vault","href":"/sdks/go/vault"}]},{"group":"Reference","pages":[{"title":"Error Handling","href":"/sdks/go/errors"}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"Protocol","pages":[{"title":"Protocol","href":"/protocol/specification"}]},{"tab":"Blog","pages":[{"title":"Blog","href":"/blog/oacp-one-trust-layer-under-ucp-acp-ap2"}]}]},"basePath":"","title":"Tokens - Grantex","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}