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

# Verify OTP - Complete Authentication and Get API Key

> Verify a one-time password to complete authentication. Returns your user profile, team details, and API key for use with all OutX API endpoints.

The Verify OTP endpoint completes the authentication flow started by [Send OTP](/docs/linkedin-api/auth-send-otp). Submit the 6-digit code from your email to receive your user profile, team details, and API key.

For new users, this automatically creates a team and generates an API key.

This endpoint requires no authentication -- use the OTP from your email.

## Endpoint

```
POST https://api.outx.ai/linkedin-agent/auth-verify-otp
```

## Request Body

<ParamField body="email" type="string" required>
  The email address the OTP was sent to
</ParamField>

<ParamField body="otp" type="string" required>
  The 6-digit OTP from your email
</ParamField>

## Response

<ResponseField name="user.id" type="string">
  Your unique user ID
</ResponseField>

<ResponseField name="user.full_name" type="string">
  Your name (from signup or account)
</ResponseField>

<ResponseField name="user.email" type="string">
  Your email address
</ResponseField>

<ResponseField name="team.id" type="string">
  Your team ID
</ResponseField>

<ResponseField name="team.name" type="string">
  Your team name
</ResponseField>

<ResponseField name="team.api_key" type="string">
  Your API key -- use this in the `x-api-key` header for all OutX API and LinkedIn API requests
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "user": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "full_name": "John Doe",
      "email": "john@example.com"
    },
    "team": {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "name": "John Doe's Team",
      "api_key": "outx_a1b2c3d4e5f6g7h8i9j0k1l2"
    }
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.outx.ai/linkedin-agent/auth-verify-otp" \
    -H "Content-Type: application/json" \
    -d '{
      "email": "john@example.com",
      "otp": "123456"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.outx.ai/linkedin-agent/auth-verify-otp",
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        email: "john@example.com",
        otp: "123456",
      }),
    }
  );

  const data = await response.json();
  console.log(data.team.api_key); // Your API key
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.outx.ai/linkedin-agent/auth-verify-otp",
      json={
          "email": "john@example.com",
          "otp": "123456",
      },
  )

  data = response.json()
  print(data["team"]["api_key"])  # Your API key
  ```
</RequestExample>

## Errors

| Status | Error                        | Description                                                    |
| ------ | ---------------------------- | -------------------------------------------------------------- |
| `400`  | `Missing or invalid 'email'` | The `email` field is missing or not a valid string             |
| `400`  | `Missing or invalid 'otp'`   | The `otp` field is missing or not a valid string               |
| `401`  | `Invalid or expired OTP`     | The OTP is incorrect or has expired (OTPs expire after 1 hour) |

<Tip>
  If the OTP has expired, call [Send OTP](/docs/linkedin-api/auth-send-otp) again to receive a new code.
</Tip>

## Full Authentication Flow

Here is the complete two-step flow to get your API key programmatically:

```python Python theme={null}
import requests

# Step 1: Send OTP
requests.post(
    "https://api.outx.ai/linkedin-agent/auth-send-otp",
    json={"email": "john@example.com", "full_name": "John Doe"},
)
print("Check your email for the OTP...")

# Step 2: Verify OTP (enter the code from your email)
otp = input("Enter the 6-digit OTP: ")
response = requests.post(
    "https://api.outx.ai/linkedin-agent/auth-verify-otp",
    json={"email": "john@example.com", "otp": otp},
)

api_key = response.json()["team"]["api_key"]
print(f"Your API key: {api_key}")
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/docs/linkedin-api/quickstart">
    Make your first LinkedIn API request with your new API key
  </Card>

  <Card title="Install Chrome Extension" icon="puzzle-piece" href="/docs/resources/chrome-extension">
    Required for API calls to work -- install and keep active
  </Card>
</CardGroup>
