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

# Attach

> Creates an OAuth attach token that can be used to link an OAuth provider to an existing authenticated session. Calls the `POST /sdk/v1/oauth/attach` endpoint. Pass the returned attach token as `oauthAttachToken` in a subsequent [OAuthType.start] call.

## Parameters

<ParamField body="provider" type="String" required />

## Returns

<ResponseField name="requestId" type="String" required />

<ResponseField name="oauthAttachToken" type="String" required />

<ResponseField name="statusCode" type="Int" required />

<RequestExample>
  ```swift theme={null}
  let params = OAuthAttachParameters(provider: "google")
  let response = try await StytchConsumer.oauth.attach(params)
  ```
</RequestExample>
