---
id: post-oidc-token
title: "Token Endpoint"
description: "OpenID Connect token endpoint that exchanges an authorization code for access and ID tokens. Client authentication is required using HTTP Basic Auth with `client_id` as username and `client_secret` as password."
sidebar_label: "Token Endpoint"
hide_title: true
hide_table_of_contents: true
api: eJzlWMtSIzcU/ZVbWkFV22YYsulKpQJmknjyGAqYmgVxgSxduzWopY6ktnFcvcuX5NPyJakrdRvbGIZsMyugpfs893HEikn0wqkqKGtYzj5UaEbnMLTGoAgQ7D0aQCMrq0yAUPAA+CAKbmbogRvgdSisU39ykgdhJcLUOuBCoKcLEkbnSYvvw1ArNCHKoAlKJCHlweEftXIoofbKzOCn6+sLOONeCTitQwELFQq4E1H6Vsk74B5qj87wEqON7syjcBjiecW9X1gn+78blrGKO15iQOdZfrPaifm6QPLSTiEUCNbNuFE++sYypuhGxUPBMkb2WM42b4wky1jnPsuDqzFjXhRYcpavWFhWJOGDU2bGmmacLqMPZ1Yu6caurLAmoAl0xKtKt0kaPPQWi0Vval3Zq51GQ5mWdOmJLTv5jCJQzM5W6IJCT6czx024TXd2/coYmrpk+Q3bgvOWjLBxxiROea0Dy/edZ3uySeopn9EoTJBArT1K1lD8UjkU4bZ2ap8rT7V9vBxBsLAolCgiRA59ZY1HWCitYYLg0YQMytoHKHlY30qGojxZB2XiwelWzV4mPMi1GM+rXNpWMaSydyhQzVHC1NnyJTvNZsHcbAKzk5zWoXHTJJkUdETz+OiIfmw7dpqa7iB13WHbvJ0ce7a2PnsSf30ppea+jepfl673n65bb+IEEdx0qBGw7bConA0oAkpy2dZOoCdQotyzhft87RECyabyvkYJB2fIHbpDUooPlXLob9VmAMoEnKHbq1XWrp1WBjwKa6SPg+6xKNsoOpMw51rFglfyP6cqJsmawJXxoCQNy7AEZaj/kxt8YusQ7dIgZE2qkQK5jDNuxYZcFNgbWhOc1XvRfWz+B15Wmj4Z2/PBOiS3t10bGUnlgj45t9WFvrC1lmAstToIMiz7LDp0cvSGLL668DYbA52zbphGTPz9fMOjcfaFIn2U3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S/mOhjPyFbWjONv8ghtA0/wK0HVcf
sidebar_class_name: "post api-method"
info_path: docs/extensions-api/igrant-io-api-documentation
custom_edit_url: null
---

> **Build this with an AI coding agent.** Install the iGrant.io Agent Skills, then ask your agent to build the integration:
>
> ```bash
> npx skills add L3-iGrant/skills
> ```


import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import Markdown from "@theme/Markdown";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";

<h1 className={"openapi__heading"}>Token Endpoint</h1>

<MethodEndpoint method={"post"} path={"/v3/service/extension/oidc/{organisationId}/token"}></MethodEndpoint>



OpenID Connect token endpoint that exchanges an authorization code for access and ID tokens. Client authentication is required using HTTP Basic Auth with `client_id` as username and `client_secret` as password.


## Request

<details style={{"marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{}}><h3 className={"openapi-markdown__details-summary-header-params"}>Path Parameters</h3></summary><div><ul><ParamsItem className={"paramsItem"} param={{"description":"The ID of the organisation","in":"path","name":"organisationId","required":true,"schema":{"type":"string"}}}></ParamsItem></ul></div></details><MimeTabs className={"openapi-tabs__mime"}><TabItem label={"application/x-www-form-urlencoded"} value={"application/x-www-form-urlencoded-schema"}><details style={{}} className={"openapi-markdown__details mime"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-mime"}><h3 className={"openapi-markdown__details-summary-header-body"}>Body</h3><strong className={"openapi-schema__required"}>required</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"grant_type"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** [`authorization_code`]"} schema={{"type":"string","enum":["authorization_code"],"default":"authorization_code","description":"The type of grant being used"}}></SchemaItem><SchemaItem collapsible={false} name={"redirect_uri"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The URI to which the response will be sent, must match the redirect URI used in the Authorization Request"}}></SchemaItem><SchemaItem collapsible={false} name={"code"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The Authorization Code received from the Authorization Request"}}></SchemaItem></ul></details></TabItem></MimeTabs><div><div><ApiTabs label={undefined} id={undefined}><TabItem label={"200"} value={"200"}><div>

Access (and ID) token response

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}><li className={"schemaItem"}><summary style={{}}><strong>Cache-Control</strong><span style={{"opacity":"0.6"}}> string</span></summary><div><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>

Indicates that the response should not be cached.

</div></div></li></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"access_token"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The JWT token that can be sent to access protected resources"}}></SchemaItem><SchemaItem collapsible={false} name={"token_type"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The type of the token issued (Bearer)"}}></SchemaItem><SchemaItem collapsible={false} name={"expires_in"} required={false} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","description":"The duration in seconds for which the access token is valid"}}></SchemaItem><SchemaItem collapsible={false} name={"id_token"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The JWT that contains identity information about the user"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"access_token\": \"string\",\n  \"token_type\": \"string\",\n  \"expires_in\": 0,\n  \"id_token\": \"string\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"401"} value={"401"}><div>

Unauthorized

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"errorCode"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","example":400}}></SchemaItem><SchemaItem collapsible={false} name={"errorDescription"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Bad input parameter"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"errorCode\": 400,\n  \"errorDescription\": \"Bad input parameter\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"404"} value={"404"}><div>

Resource not found

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"errorCode"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","example":400}}></SchemaItem><SchemaItem collapsible={false} name={"errorDescription"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Bad input parameter"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"errorCode\": 400,\n  \"errorDescription\": \"Bad input parameter\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"500"} value={"500"}><div>

Internal server error

</div><details style={{"textAlign":"left","marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collaposed={true} open={false}><summary style={{}}><strong>Response Headers</strong></summary><ul style={{"marginLeft":"1rem"}}></ul></details><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"errorCode"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"type":"integer","example":400}}></SchemaItem><SchemaItem collapsible={false} name={"errorDescription"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Bad input parameter"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n  \"errorCode\": 400,\n  \"errorDescription\": \"Bad input parameter\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div></div>
      