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

# Get Challenge

> Request a one-time challenge for device attestation

<Note>This endpoint is called automatically by the SDK. You typically don't need to call it directly.</Note>

## Request

```
GET /api/v1/attestation/challenge
```

### Headers

| Header        | Required | Description             |
| ------------- | -------- | ----------------------- |
| `X-Bundle-ID` | Yes      | App bundle identifier   |
| `X-Team-ID`   | Yes      | Apple Developer Team ID |

### Query parameters

| Parameter   | Type     | Description                |
| ----------- | -------- | -------------------------- |
| `device_id` | `string` | Optional device identifier |

## Response

```json theme={null}
{
  "challenge": "a1b2c3d4e5f6...",
  "expiresAt": "2025-03-10T12:05:00Z"
}
```

| Field       | Type     | Description                   |
| ----------- | -------- | ----------------------------- |
| `challenge` | `string` | Cryptographic challenge token |
| `expiresAt` | `string` | ISO 8601 expiration timestamp |

Challenges expire after a short window. The SDK handles expiration and retries automatically.
