# Replies

Answers to your emails, received for you and tied to the email they answer.

## List replies

`GET /projects/{project_id}/replies`

Newest first. Filter by one of campaign_id, contact_id, broadcast_id or is_unread=true at a time. Mail sent straight to the project’s inbound address has no send, campaign or broadcast.

### Parameters

| Name | In | Type | Notes |
| --- | --- | --- | --- |
| `project_id` | path | string | Required |
| `campaign_id` | query | string \| null | Optional |
| `contact_id` | query | string \| null | Optional |
| `broadcast_id` | query | string \| null | Optional |
| `is_unread` | query | "true" \| null | Optional |
| `cursor` | query | string \| null | Optional |
| `limit` | query | integer | Optional, default 50 |

```sh Request
curl "https://sendocado.com/api/v1/projects/$PROJECT_ID/replies?is_unread=true" \
  -H "Authorization: Bearer $SENDOCADO_API_KEY"
```

### Response

```json 200
{
  "replies": [
    {
      "id": "kdfy6spsc3lkr2aqxv9upctnwlavyf4r",
      "project_id": "ujzde8gxd6ncf10epf91dhodzdoc9is0",
      "send_id": "thjxjqi3ogz5kok16zv0mwufxbv932by",
      "contact_id": "j8ht9lgmxg9edn581u33xtplpft75v2s",
      "campaign_id": "h5dnsipzz5fk2z9ri19r0wyojfljooa5",
      "broadcast_id": null,
      "from_email": "maya@example.com",
      "from_name": "Maya Patel",
      "subject": "Re: Welcome to Acme, Maya",
      "preview": "Thanks! Quick question: can I import from a CSV?",
      "is_auto_reply": false,
      "is_unread": true,
      "created_at": 1790010800000
    }
  ],
  "next_cursor": null
}
```

### Errors

| Status | Type | Example message |
| --- | --- | --- |
| 400 | `invalid_data` | limit: Too big: expected number to be <=200 |
| 401 | `unauthorized` | Send a valid API key as "Authorization: Bearer sc_…", or sign in. |
| 404 | `project_not_found` | Project not found. |
| 422 | `invalid_reference` | No template with that id in this project. |
| 429 | `rate_limited` | Too many requests. Try again in 12 seconds. |

## Get a reply

`GET /replies/{reply_id}`

The full text and attachments. html_url serves the reply’s HTML as plain text so it never runs in a browser; show it in a sandbox.

### Parameters

| Name | In | Type | Notes |
| --- | --- | --- | --- |
| `reply_id` | path | string | Required |

```sh Request
curl "https://sendocado.com/api/v1/replies/$REPLY_ID" \
  -H "Authorization: Bearer $SENDOCADO_API_KEY"
```

### Response

```json 200
{
  "id": "kdfy6spsc3lkr2aqxv9upctnwlavyf4r",
  "project_id": "ujzde8gxd6ncf10epf91dhodzdoc9is0",
  "send_id": "thjxjqi3ogz5kok16zv0mwufxbv932by",
  "contact_id": "j8ht9lgmxg9edn581u33xtplpft75v2s",
  "campaign_id": "h5dnsipzz5fk2z9ri19r0wyojfljooa5",
  "broadcast_id": null,
  "from_email": "maya@example.com",
  "from_name": "Maya Patel",
  "subject": "Re: Welcome to Acme, Maya",
  "preview": "Thanks! Quick question: can I import from a CSV?",
  "is_auto_reply": false,
  "is_unread": true,
  "created_at": 1790010800000,
  "text": "Thanks! Quick question: can I import from a CSV?\n\nMaya",
  "html_url": null,
  "attachments": []
}
```

### Errors

| Status | Type | Example message |
| --- | --- | --- |
| 401 | `unauthorized` | Send a valid API key as "Authorization: Bearer sc_…", or sign in. |
| 404 | `reply_not_found` | Reply not found. |
| 429 | `rate_limited` | Too many requests. Try again in 12 seconds. |

## Mark a reply read or unread

`PUT /replies/{reply_id}`

is_unread false marks it read.

### Parameters

| Name | In | Type | Notes |
| --- | --- | --- | --- |
| `reply_id` | path | string | Required |

### Body

Send JSON with every field.

| Field | Type | Notes |
| --- | --- | --- |
| `is_unread` | boolean | Required |

```sh Request
curl -X PUT "https://sendocado.com/api/v1/replies/$REPLY_ID" \
  -H "Authorization: Bearer $SENDOCADO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "is_unread": false
}'
```

### Response

```json 200
{
  "id": "kdfy6spsc3lkr2aqxv9upctnwlavyf4r",
  "project_id": "ujzde8gxd6ncf10epf91dhodzdoc9is0",
  "send_id": "thjxjqi3ogz5kok16zv0mwufxbv932by",
  "contact_id": "j8ht9lgmxg9edn581u33xtplpft75v2s",
  "campaign_id": "h5dnsipzz5fk2z9ri19r0wyojfljooa5",
  "broadcast_id": null,
  "from_email": "maya@example.com",
  "from_name": "Maya Patel",
  "subject": "Re: Welcome to Acme, Maya",
  "preview": "Thanks! Quick question: can I import from a CSV?",
  "is_auto_reply": false,
  "is_unread": false,
  "created_at": 1790010800000
}
```

### Errors

| Status | Type | Example message |
| --- | --- | --- |
| 400 | `invalid_data` | Send a JSON request body. |
| 401 | `unauthorized` | Send a valid API key as "Authorization: Bearer sc_…", or sign in. |
| 404 | `reply_not_found` | Reply not found. |
| 429 | `rate_limited` | Too many requests. Try again in 12 seconds. |
