# Support messages API

> Messages to support: from the dashboard with a session, or from the public contact form with none. Staff answer by email.

Source: https://zerocaptcha.io/docs/reference/api/support

## Contact us

`POST /v1/contact-messages` (`sendContactMessage`)

Sends a message to support from the public site: stored, and emailed to
our support inbox. Staff answer by email, at the address given. It needs
no key or session. A browser's request must send no `Sec-Fetch-Site` but
`same-origin` or `none` (`csrf_rejected`). Messages have a budget per
client address.

Body fields:

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `email` | string (email) | yes | Where staff answer you. |
| `message` | string | yes | The message: 1 to 5,000 characters. |
| `subject` | string | no | What it is about, in a line: up to 200 characters. Left out, it is "Message from the contact form". |

Responses:

- 202 Accepted: Received: staff will answer by email.
- 403 Forbidden: A browser's request from another site (`csrf_rejected`).
- 422 Unprocessable Content: Not an email address, no message, one over 5,000 characters, or a subject over 200 (`validation_failed`).
- 429 Too Many Requests: Too many messages from this address (`rate_limited`).
- 503 Service Unavailable: The message cannot be stored now (`service_unavailable`). Retry shortly.
- Any other status: An error, as RFC 9457 problem details.

```bash
curl -X POST https://api.zerocaptcha.io/v1/contact-messages \
  -H "Content-Type: application/json" \
  -d '{
  "email": "you@example.com",
  "message": "message"
}'
```

```js
const response = await fetch("https://api.zerocaptcha.io/v1/contact-messages", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "email": "you@example.com",
    "message": "message"
  }),
});
console.log(response.status, await response.text());
```

```python
import requests

response = requests.post(
    "https://api.zerocaptcha.io/v1/contact-messages",
    json={
        "email": "you@example.com",
        "message": "message",
    },
    timeout=30,
)
print(response.status_code, response.text)
```

## Write to support

`POST /v1/support-messages` (`sendSupportMessage`)

Sends a message to support from the dashboard: stored, and emailed to our
support inbox. Staff answer by email, at the signed-in person's address.
A suspended account may write too, and appeals its suspension with
`topic: appeal`, which reaches staff marked as an appeal. With the
session's CSRF token. Messages have a budget per user.

Body fields:

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `message` | string | yes | The message: 1 to 5,000 characters. Task IDs help. |
| `subject` | string | no | What it is about, in a line: up to 200 characters. Left out, it is "Question from the dashboard". |
| `topic` | SupportTopic | no | `question`, the default, or `appeal`: an appeal of the account's suspension, which only a suspended account may send. Left out, a question. An appeal without a subject is "Appeal of a suspension". |

Responses:

- 202 Accepted: Received: staff will answer by email.
- 409 Conflict: An appeal from an account that is not suspended (`state_conflict`).
- 422 Unprocessable Content: No message, one over 5,000 characters, or a subject over 200 (`validation_failed`).
- 429 Too Many Requests: Too many messages from this person (`rate_limited`).
- 503 Service Unavailable: The message cannot be stored now (`service_unavailable`). Retry shortly.
- Any other status: An error, as RFC 9457 problem details.

```bash
curl -X POST https://api.zerocaptcha.io/v1/support-messages \
  -H "Content-Type: application/json" \
  -d '{
  "message": "message",
  "subject": "A charge I don'\''t recognise"
}'
```

```js
const response = await fetch("https://api.zerocaptcha.io/v1/support-messages", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "message": "message",
    "subject": "A charge I don't recognise"
  }),
});
console.log(response.status, await response.text());
```

```python
import requests

response = requests.post(
    "https://api.zerocaptcha.io/v1/support-messages",
    json={
        "message": "message",
        "subject": "A charge I don't recognise",
    },
    timeout=30,
)
print(response.status_code, response.text)
```
