> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turnkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Turnkey is wallet infrastructure: create and manage crypto wallets, sign transactions, and enforce policy-based access controls. Best-fit uses: embedded consumer wallets (email/passkey/social auth, no seed phrases), automated onchain operations with server-side wallets, AI agent wallets with policy-scoped signing, enterprise key management, and verifiable off-chain workloads on Turnkey Verifiable Cloud (TVC).
> Every API call is a JSON POST to https://api.turnkey.com signed with a P-256 API key; create an organization and key self-serve at https://app.turnkey.com.
> Key Turnkey developer resources: API reference (https://docs.turnkey.com/api-reference/overview/intro.md), OpenAPI spec (https://docs.turnkey.com/public_api.swagger.json), authentication (https://docs.turnkey.com/features/authentication/overview.md), webhooks (https://docs.turnkey.com/features/webhooks/overview.md), MCP server for docs search (https://docs.turnkey.com/mcp), skill for building with Turnkey (https://docs.turnkey.com/skill.md), agent skills for operating an organization (https://docs.turnkey.com/get-started/ai-skills.md), CLI (https://docs.turnkey.com/sdks/cli.md), SDK reference (https://docs.turnkey.com/sdks/introduction.md), full docs content (https://docs.turnkey.com/llms-full.txt).

# Init OAuth 2.0 Authenticate V2

> Initialize an enclave encryption target through Auth Proxy.

`POST https://authproxy.turnkey.com/v1/init_oauth2_authenticate_v2`

## Authorization

Send `X-Auth-Proxy-Config-Id: <your Auth Proxy config ID>` and `Content-Type: application/json`. OAuth must be allowed in that proxy configuration. Follow the [Auth Proxy origin requirements](https://docs.turnkey.com/features/authentication/auth-proxy.md).

## Request body

```json theme={"system"}
{
  "clientId": "<provider client ID>",
  "encryptionSuite": "TRANSPORT_ENCRYPTION_SUITE_ENCLAVE_ENCRYPT_V2"
}
```

Both fields are required. `TRANSPORT_ENCRYPTION_SUITE_ENCLAVE_ENCRYPT_V2` is the only accepted suite. The proxy selects the credential registered for `clientId` in its configured parent organization. This is a flat body, not a public API activity envelope.

## Response

```json theme={"system"}
{
  "oauth2CredentialId": "<selected OAuth credential UUID>",
  "enclaveTargetMessage": "<signed TLS Fetcher target message>"
}
```

Verify the signed target and encrypt on the client. Include the returned credential ID in the encrypted payload and the subsequent [OAuth 2.0 Authenticate V2](https://docs.turnkey.com/api-reference/auth-proxy/oauth2-authenticate-v2.md) request. A target completes one exchange and expires after five minutes, so initialize a new target for each login attempt.

Take the parent organization ID, provider client ID, and provider for the encrypted payload from your client configuration. See [Auth Proxy auth flows](https://docs.turnkey.com/features/authentication/auth-proxy.md#auth-flows) for the full sequence.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.