These endpoints search and read Your Next Store's own documentation: the [Help Center](/help), with how-to guides for merchants, and these developer docs. Agents use them to check how the platform works, and whether it can do something, before they guess. Known limits and their workarounds are documented there.

The documentation is public and the same for every store. Any credential may read it, a storefront key included, and so may every team member connected over OAuth. On the MCP server the two endpoints are also the `search_docs` and `read_docs` tools.

## Search the docs

```
GET /api/v1/knowledge/search?query=local%20pickup
```

Matches words in each page's title and summary, so short topic words work best: `refunds`, `local pickup`, `variants`.

| Parameter | Type | Description |
|-----------|------|-------------|
| `query` | `string` | What to look up, in plain words. 2–200 characters. Required |
| `source` | `"help" \| "docs" \| "all"` | `help` (the Help Center), `docs` (the developer docs) or `all`. Default `all` |
| `limit` | `integer` | Results to return, 1–10. Default 6 |

```bash
curl -H "Authorization: Bearer sk_your_api_key" \
  "https://your-store.yns.store/api/v1/knowledge/search?query=local%20pickup&source=help"
```

### Response (200)

Best match first:

```json
{
  "data": [
    {
      "source": "help",
      "title": "Add pickup locations",
      "url": "https://yournextstore.com/help/shipping/pickup-locations",
      "summary": "Let local customers collect their orders in person instead of paying for delivery, perfect for shops, studios, and markets."
    }
  ]
}
```

| Status | Description |
|--------|-------------|
| `503` | The documentation site can't be reached |

## Read docs pages

```
GET /api/v1/knowledge/pages?urls=<url>,<url>
```

Returns the full markdown of up to five pages, by the `url`s the search returned.

| Parameter | Type | Description |
|-----------|------|-------------|
| `urls` | `string` | Page URLs, separated by commas, at most 5. Only Help Center (`/help/…`) and developer docs (`/docs/…`) pages of yournextstore.com. Required |

### Response (200)

```json
{
  "data": [
    { "url": "https://yournextstore.com/help/shipping/pickup-locations", "markdown": "# Add pickup locations\n\n…" },
    { "url": "https://yournextstore.com/help/shipping/nope", "error": "Could not read this page: …" }
  ]
}
```

Each entry has `markdown`, or `error` saying why that page could not be read. Cite the page URL when you answer from it.

| Status | Description |
|--------|-------------|
| `400` | A URL is not a Your Next Store documentation page |

## Related

- [Support Cases](/docs/api-reference/support-cases) – open a case when the docs don't answer it
- [Public Content API](/docs/api-reference/overview#public-content-api) – the same pages without a store credential