# Invite an RCS test phone

Invites an RCS test phone.

```http
POST https://api.pozy.ai/v1/rcs/agents/{agentId}/test-devices
```

- Area: Messaging / RCS
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `agentId` (string, required)

## Request body

Content type: `application/json`

- `phoneNumber`, string, required

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/rcs/agents/6b99fbd950277956c14bd44d/test-devices" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "phoneNumber": "+14155550123"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/rcs/agents/6b99fbd950277956c14bd44d/test-devices", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    phoneNumber: "+14155550123"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/rcs/agents/6b99fbd950277956c14bd44d/test-devices",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "phoneNumber": "+14155550123",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 201

- `testDevice`, object
  - `testDeviceId`, string
  - `phoneNumber`, string
  - `inviteStatus`, string: One of `PENDING`, `ACCEPTED`, `DECLINED`

```json
{
  "testDevice": {
    "testDeviceId": "653426651346b544a97028d1",
    "phoneNumber": "+14155550123",
    "inviteStatus": "PENDING"
  }
}
```
