# Get a new code for an agent registration

> Source: https://elaichi.ai/docs/api-reference/mcp-oauth/agent/createagentclaimattempt/

`POST /agent/identity/claim`

Resource: **Agent** · API: **MCP OAuth**

## Request body

- **`claim_token`** _(string)_
- **`email`** _(string)_

## Response body

- **`registration_id`** _(string)_
- **`claim_attempt_id`** _(string)_
- **`status`** _(string)_
  Allowed: `initiated`
- **`expires_at`** _(string)_
- **`claim_attempt`** _(object, required)_
  - **`user_code`** _(string)_
    6 digits.
  - **`verification_uri`** _(string)_
    The page the person opens to approve.
  - **`expires_in`** _(integer)_
    Seconds the code is good for (600).
  - **`interval`** _(integer)_
    Seconds to wait between polls.

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/agent/identity/claim' \
  -H 'Content-Type: application/json' \
  -d '{"claim_token":"your_claim_token","email":"your_email"}'
```

### JavaScript

```javascript
const body = {
  "claim_token": "your_claim_token",
  "email": "your_email"
};

const response = await fetch('https://api.elaichi.ai/agent/identity/claim', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/agent/identity/claim"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "claim_token": "your_claim_token",
    "email": "your_email"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```
