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

# Terms of service

> Have a user accept Bridge's terms of service before verification

Bridge requires a signed terms of service agreement before it will create or verify a customer. Privy creates the [Bridge customer](https://apidocs.bridge.xyz/platform/customers/customers/api) on the first request and links it to the Privy user, so your app only ever references the Privy user ID.

Before this step, [register a Bridge API key with Privy](/kyc-kyb/setup).

<View title="NodeJS" icon="node-js">
  Use the `initiateTos` method from the `kyc` resource on `users()`.

  ```ts theme={"system"}
  import {PrivyClient} from '@privy-io/node';

  const privy = new PrivyClient({
    appId: process.env.PRIVY_APP_ID!,
    appSecret: process.env.PRIVY_APP_SECRET!
  });

  const tos = await privy.users().kyc.initiateTos('did:privy:xxxxx', {
    provider: 'bridge',
    environment: 'sandbox',
    email: 'user@example.com'
  });

  // tos.link is the terms of service link to pass to your frontend
  ```
</View>

<View title="Python" icon="python">
  Use `initiate_tos` on the user's KYC service.

  ```python theme={"system"}
  tos = client.users.kyc.initiate_tos(
      "did:privy:xxxxx",
      provider="bridge",
      environment="sandbox",
      email="user@example.com",
  )

  # Pass tos.link to your frontend.
  ```
</View>

<View title="REST API" icon="terminal">
  To generate a [terms of service](https://apidocs.bridge.xyz/platform/customers/customers/tos) link
  for a user, make a `POST` request to:

  ```bash theme={"system"}
  https://api.privy.io/v1/users/{user_id}/kyc/tos
  ```

  See the [API reference](/api-reference/fiat/kyc-server/tos) for the full request and response schema.

  In the body of the request, include the following fields:

  <ParamField body="provider" type="'bridge'" required>
    Provider to verify the user with.
  </ParamField>

  <ParamField body="environment" type="'production' | 'sandbox'">
    Bridge environment to use. Defaults to `production`.
  </ParamField>

  <ParamField body="email" type="string">
    Email address for the Bridge customer. Falls back to the user's linked email account. Required if
    the user has no linked email.
  </ParamField>

  Below is a sample cURL command for this request:

  ```bash theme={"system"}
  curl --request POST https://api.privy.io/v1/users/did:privy:xxxxx/kyc/tos \
    -u "<your-privy-app-id>:<your-privy-app-secret>" \
    -H "privy-app-id: <your-privy-app-id>" \
    -H 'Content-Type: application/json' \
    -d '{
      "provider": "bridge",
      "environment": "sandbox",
      "email": "user@example.com"
    }'
  ```

  A successful response includes the following fields:

  <ResponseField name="provider" type="'bridge'">
    Provider the user is being verified with.
  </ResponseField>

  <ResponseField name="environment" type="'production' | 'sandbox'">
    Bridge environment used for the request.
  </ResponseField>

  <ResponseField name="status" type="string">
    Status of terms of service acceptance, as reported by Bridge.
  </ResponseField>

  <ResponseField name="link" type="string">
    URL the user opens to accept Bridge's terms of service.
  </ResponseField>

  ```json theme={"system"}
  {
    "provider": "bridge",
    "environment": "sandbox",
    "status": "pending",
    "link": "https://compliance.sandbox.bridge.xyz/accept-tos?customer_id=..."
  }
  ```
</View>

Pass the `link` to your app's frontend so the user can accept the terms of service. The request is idempotent: calling it again for the same user returns a link for the existing Bridge customer.

## Next steps

<CardGroup cols={2}>
  <Card title="Hosted KYC" icon="link" href="/kyc-kyb/kyc">
    Send the user through Bridge's hosted verification flow
  </Card>

  <Card title="Headless KYC" icon="code" href="/kyc-kyb/kyc-headless">
    Submit verification data from your server
  </Card>
</CardGroup>
