# Check a contact before sending

`POST https://api.parasend.com/v1/deliveries/contact_check`

Source: https://parasend.com/docs/api/deliveries/check-contact

Authentication: `Authorization: Bearer <API key>` (a `ps_test_` key in test mode, `ps_live_` in live mode).
Send an `Idempotency-Key` header: a retry with the same key returns the first answer.

Whether the last message from this organisation (in this mode) to the e-mail address or phone number failed — an e-mail that bounced, an SMS that never reported delivery to the phone (after 15 minutes) or failed, or a contact on the block list. Null warning for a contact never tried, or whose last attempt succeeded. A POST so the contact stays out of URLs and logs; the answer names no delivery or recipient.

## Body (application/json)

- `email` (string, optional)
- `phone` (string, optional): E.164

## Example: Check an e-mail address

```bash
curl -X POST "https://api.parasend.com/v1/deliveries/contact_check" \
  -H "Authorization: Bearer $PARASEND_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "anna.bjork@example.com"
  }'
```

```js
const res = await fetch('https://api.parasend.com/v1/deliveries/contact_check', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PARASEND_KEY}`,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'anna.bjork@example.com',
  }),
});
const data = await res.json();
```

## Response 200

One answer per contact given; null for a contact not given (or a phone not in E.164).

```json
{
  "object": "contact_check",
  "email": {
    "warning": null
  },
  "phone": null
}
```

Errors: one shape, `{"error": {type, code, message, param, request_id}}`; every code is listed at https://parasend.com/docs/errors.
