---
title: "POST /v2/{+name}:exchangeAuthCode"
method: POST
path: "/v2/{+name}:exchangeAuthCode"
tags: ["projects"]
---

# POST /v2/{+name}:exchangeAuthCode

`POST /v2/{+name}:exchangeAuthCode`

ExchangeAuthCode exchanges the OAuth authorization code (and other necessary data) for an access token (and associated credentials).

## Path parameters

- `name` string, required

## Request body

- ExchangeAuthCodeRequest — ExchangeAuthCodeRequest currently includes the auth code data.
  - `authCodeData` AuthCodeData — AuthCodeData contains the data the runtime plane will give the connector backend in exchange for access and refresh tokens.
    - `authCode` string — OAuth authorization code.
    - `pkceVerifier` string — OAuth PKCE verifier, needed if PKCE is enabled for this particular connection.
    - `redirectUri` string — OAuth redirect URI passed in during the auth code flow, required by some OAuth backends.
    - `scopes` string[] — Scopes the connection will request when the user performs the auth code flow.
  - `executionConfig` ExecutionConfig
    - `headers` string — headers to be used for the request. For example: headers:'{"x-integration-connectors-managed-connection-id":"conn-id","x-integration-connectors-runtime-config":"runtime-cfg"}'
  - `oauth2Config` OAuth2Config
    - `clientId` string — Client ID for the OAuth2 flow.
    - `authUri` string — Authorization Server URL/Token Endpoint for Authorization Code Flow
    - `clientSecret` string — Client secret for the OAuth2 flow.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/connectors.md) · [All operations](https://skmtc.dev/google/apis/connectors/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/connectors/revisions/1153921b6f7b/schema)
