> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/3d-secure/integrate-d1-api/d1-api-reference/inbound-api-to-d1/oauth2-api.md).

# OAuth2 API

## Get Authorization Token

> This request is used by the Issuer backend to get a Thales authorization token.

```json
{"openapi":"3.0.0","info":{"title":"D1 OAuth API","version":"1.0"},"servers":[{"url":"https://api.d1.thalescloud.io/authz/v1","description":"Production server"},{"url":"https://api.d1-stg.thalescloud.io/authz/v1","description":"Staging server"},{"url":"https://develop-api.d1-dev.thalescloud.io/authz/v1","description":"Develop server"}],"paths":{"/oauth2/token":{"post":{"description":"This request is used by the Issuer backend to get a Thales authorization token.","parameters":[{"$ref":"#/components/parameters/x-correlation-id"}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/auth2Request"}},"application/json":{"schema":{"$ref":"#/components/schemas/auth2Request"}}}},"responses":{"200":{"description":"Default allowed response","content":{"application/json":{"schema":{"properties":{"access_token":{"type":"string","description":"The access_token that will be used to call D1 Banking APIs."},"expires_in":{"type":"number","description":"Remaining time in seconds for the access_token to expire."},"scope":{"type":"string","description":"Scope of the access_token that will be used to call D1 Banking APIs."},"token_type":{"type":"string","description":"Type of the access_token that will be used to call D1 Banking APIs."}}}}}},"400":{"description":"Bad request"}},"summary":"Get Authorization Token","operationId":"getToken"}}},"components":{"parameters":{},"schemas":{"auth2Request":{"type":"object","title":"Authorization request body","properties":{"grant_type":{"description":"Describes the <b>flow</b>.<br/>In our case we have defined the JWT bearer flow, so you will have to set urn:ietf:params:oauth:grant-type:jwt-bearer","type":"string","enum":["urn:ietf:params:oauth:grant-type:jwt-bearer"]},"assertion":{"description":"The assertion is the entire JWT value.<br/>Please refer to [Authorization flow](https://thales-dis-dbp.stoplight.io/docs/d1-developer-portal/ef7b09a03ca9f-backend-authorisation) for more details on how to generate this JWT.<br/>The JWT must contain the following fields: <ul><li><b>iss:</b> Issuer of the JWT. It shall be the issuerId and it will be used to lookup the onboarded public key.</li><li><b>exp:</b> The validity must be the expiration time of the assertion within 15 minutes, expressed as the number of seconds from 1970-01-01T0:0:0Z measured in UTC.</li></ul>Supported alg: ES256.","type":"string"}},"required":["grant_type","assertion"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/3d-secure/integrate-d1-api/d1-api-reference/inbound-api-to-d1/oauth2-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
