---
title: "Exchange OAuth2 Code"
method: POST
path: "/consent-auth-code"
tags: ["Consents"]
---

# Exchange OAuth2 Code

`POST /consent-auth-code`

Used to obtain a Yapily Consent object containing the `consentToken` once the user has authenticated and you have an OAuth2 authorisation code `auth-code` and state `auth-state`.

## Request body

- ConsentAuthCodeRequest — The request body containing the `ConsentAuthCodeRequest` json payload
  - `authCode` string, required — __Mandatory__. The authorisation code
  - `authState` string, required — __Mandatory__. The authorisation state

## Response `200`

Ok

## Other responses

- `default` — Error Response

---

[API](https://skmtc.net/yapily/apis/yapily-api.md) · [All operations](https://skmtc.net/yapily/apis/yapily-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/yapily/yapily-api/versions/a8ca54f9eb9f/schema)
