# Start agent registration (auth.md service_auth)

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

`POST /agent/identity`

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

## Request body

- **`type`** _(string)_
  Allowed: `service_auth`
- **`login_hint`** _(string)_
  The person's email. Lowercased.
- **`client_name`** _(string)_
  Elaichi extension to the auth.md identity request. What the agent calls itself, shown on the approve page as unverified. Default `AI agent`.

## Response body

- **`registration_id`** _(string)_
- **`registration_type`** _(string)_
  Allowed: `service_auth`
- **`claim_url`** _(string)_
- **`claim_token`** _(string)_
  Returned once. The credential for the poll.
- **`claim_token_expires`** _(string)_
- **`post_claim_scopes`** _(array<string>)_
- **`claim`** _(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' \
  -H 'Content-Type: application/json' \
  -d '{"type":"service_auth","login_hint":"your_login_hint","client_name":"your_client_name"}'
```

### JavaScript

```javascript
const body = {
  "type": "service_auth",
  "login_hint": "your_login_hint",
  "client_name": "your_client_name"
};

const response = await fetch('https://api.elaichi.ai/agent/identity', {
  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"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "type": "service_auth",
    "login_hint": "your_login_hint",
    "client_name": "your_client_name"
}

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