# GET /api/v1/inboxes/:id/messages/search?q=invoice

Auth: Bearer

HTML: https://cooperemail.com/docs/reference/search-messages

## Summary

Full-text search in one inbox. q is required (400 missing_query when empty). limit is 1–100 (default 25). before and after are exclusive ISO-8601 bounds on created_at (400 invalid_date). Each result is a message plus highlights. highlights.subject and highlights.text wrap matched words in ** with about 80 characters of context. :id accepts inbox id, username, or email. Another account's inbox is 404 inbox_not_found.

## Query

```json
?q=invoice&limit=25
```

## Response

The OpenAPI document does not declare a JSON response schema for this call. The summary is the contract.

## Errors

- HTTP 400 missing_query
- HTTP 400 invalid_date
- HTTP 404 inbox_not_found

The live `message` is the sentence for that code. Branch on `code`.

```json
{
  "error": {
    "type": "invalid_request",
    "code": "missing_query",
    "docs_url": "https://cooperemail.com/docs#missing_query"
  }
}
```

## Idempotency

This route does not document Idempotency-Key or client_id.
