# GET /api/v1/search?q=

Auth: Bearer

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

## Summary

Full-text search across stored mail for the account. Optional inbox_id (id, username, or email) limits it to one inbox. before and after are exclusive ISO-8601 bounds on created_at (400 invalid_date). limit is at most 100. Each result includes highlights, with matched words wrapped in ** and about 80 characters of context. Empty q is 400 missing_query. An unknown inbox_id is 404 inbox_not_found. Matches subject, extracted_text, and addresses.

## Query

```json
?q=invoice&inbox_id=inb_…
```

## Response

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

## Errors

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

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

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

## Idempotency

This route does not document Idempotency-Key or client_id.
