> 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/pin-management/es/integrar-la-api-d1/referencia-de-la-api-d1/api-entrante-a-d1/api-oauth2.md).

# API OAuth2

## 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 [Get OAuth 2.0 Access token](../../../integrate-the-d1-api/get-oauth-2.0-access-token#generate-the-jwt) 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/pin-management/es/integrar-la-api-d1/referencia-de-la-api-d1/api-entrante-a-d1/api-oauth2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
