# Dry-run a caller identity before creating it

Dry-runs a caller identity before creating it without changing anything.

```http
POST https://api.pozy.ai/v1/branded-calling/identities/preflight
```

- Area: Phone & voice / Branded Calling
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `enterpriseId`, string, required
- `displayName`, string, required: 1 to 35 characters
- `callReasons`, array of string, required: At least 1 item. Up to 10 items. Each item: up to 64 characters
- `logoUrl`, string
- `authorizer`, object, required
  - `name`, string, required: Up to 255 characters
  - `email`, string (email), required
- `references`, object, required
  - `business`, array of object, required: At least 2 items. Up to 2 items
    - `fullName`, string, required: Up to 255 characters
    - `jobTitle`, string: Up to 255 characters
    - `organization`, string: Up to 255 characters
    - `relationshipToRegistrant`, string: Up to 255 characters
    - `phoneNumber`, string, required
    - `email`, string (email), required
    - `timezone`, string, required
  - `financial`, object, required
    - `fullName`, string, required: Up to 255 characters
    - `jobTitle`, string: Up to 255 characters
    - `organization`, string: Up to 255 characters
    - `relationshipToRegistrant`, string: Up to 255 characters
    - `phoneNumber`, string, required
    - `email`, string (email), required
    - `timezone`, string, required

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/branded-calling/identities/preflight" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enterpriseId": "66496a86752378ad82057ff6",
  "displayName": "Acme",
  "callReasons": [
    "string"
  ],
  "authorizer": {
    "name": "Acme",
    "email": "alex@example.com"
  },
  "references": {
    "business": [
      {
        "fullName": "Acme",
        "phoneNumber": "+14155550123",
        "email": "alex@example.com",
        "timezone": "America/New_York"
      }
    ],
    "financial": {
      "fullName": "Acme",
      "phoneNumber": "+14155550123",
      "email": "alex@example.com",
      "timezone": "America/New_York"
    }
  }
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/branded-calling/identities/preflight", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    enterpriseId: "66496a86752378ad82057ff6",
    displayName: "Acme",
    callReasons: [
      "string"
    ],
    authorizer: {
      name: "Acme",
      email: "alex@example.com"
    },
    references: {
      business: [
        {
          fullName: "Acme",
          phoneNumber: "+14155550123",
          email: "alex@example.com",
          timezone: "America/New_York"
        }
      ],
      financial: {
        fullName: "Acme",
        phoneNumber: "+14155550123",
        email: "alex@example.com",
        timezone: "America/New_York"
      }
    }
  }),
});
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/branded-calling/identities/preflight",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "enterpriseId": "66496a86752378ad82057ff6",
        "displayName": "Acme",
        "callReasons": [
            "string",
        ],
        "authorizer": {
            "name": "Acme",
            "email": "alex@example.com",
        },
        "references": {
            "business": [
                {
                    "fullName": "Acme",
                    "phoneNumber": "+14155550123",
                    "email": "alex@example.com",
                    "timezone": "America/New_York",
                },
            ],
            "financial": {
                "fullName": "Acme",
                "phoneNumber": "+14155550123",
                "email": "alex@example.com",
                "timezone": "America/New_York",
            },
        },
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `ok`, boolean
- `findings`, array of object
  - `code`, string: One of `display-name-mismatch`, `call-reasons-manual`, `authorizer-free-mail`, `authorizer-domain-mismatch`, `reference-phone-duplicate`, `reference-internal`, `reference-financial-free-mail`, `reference-timezone-invalid`, `logo-unreachable`
  - `severity`, string: One of `block`, `warn`
  - `field`, string
  - `message`, string

```json
{
  "ok": true,
  "findings": [
    {
      "code": "display-name-mismatch",
      "severity": "block",
      "field": "string",
      "message": "Hello from Pozy"
    }
  ]
}
```
