> 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-saliente-desde-d1/api-oauth2.md).

# API OAuth2

[Descargar D1-Public-OUT-v1-Auth2.yaml](https://openapi.gitbook.com/o/fwy1mtbRONGA2YDKDBr0/spec/D1-Public-OUT-v1-Auth2.yaml)

## Get Authorization Token

> This request is used by Thales to retrieve an OAUTH 2.0 access authorization token to be used for outgoing issuer API requests.

```json
{"openapi":"3.0.0","info":{"title":"D1 OAuth API","version":"1.0"},"servers":[{"url":"https://YOUR_DOMAIN/authz/d1/v1"}],"paths":{"/oauth2/token":{"post":{"description":"This request is used by Thales to retrieve an OAUTH 2.0 access authorization token to be used for outgoing issuer API requests.","parameters":[{"schema":{"type":"string"},"in":"header","name":"authorization","description":"The authorization header includes a client secret in base64URL encoded format following this syntax: Basic \"[clientId:client secret]\" as per https://www.rfc-editor.org/rfc/rfc2617","required":true}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/auth2Request"}}}},"responses":{"200":{"description":"Default allowed response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","description":"The access token issued by the authorization server","readOnly":true},"expires_in":{"type":"string","description":"Remaining time in seconds for the access_token to expire.","readOnly":true},"scope":{"type":"string","description":"Scope of the access_token.","readOnly":true},"token_type":{"description":"Type of the access_token that will be used to call Issuer APIs.","enum":["Bearer"]},"expires_at":{"type":"string","description":"Access token expiration timestamp","readOnly":true}},"required":["access_token","token_type"]}}}},"400":{"description":"Bad request"}},"summary":"Get Authorization Token","operationId":"getAccessToken"}}},"components":{"schemas":{"auth2Request":{"type":"object","title":"Authorization request body","properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"scope":{"description":"Access request scope as optionally defined by the issuer ","type":"string"}},"required":["grant_type"]}}}}
```


---

# 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/pin-management/es/integrar-la-api-d1/referencia-de-la-api-d1/api-saliente-desde-d1/api-oauth2.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.
