---
docId: doc_51f513dc7fae4212ae2707e3388dbed0
title: Documentation
description: Search and read the official Platica documentation. The same calls as the search_product_docs and get_product_doc MCP tools.
api:
  group: documentacion
  auth: bearer
  operations:
    - operationId: searchProductDocs
      method: GET
      path: /v1/docs/search
      postmanName: Search the documentation
    - operationId: getProductDoc
      method: GET
      path: '/v1/docs/{id}'
      postmanName: Read a document
---

<script>
  import { Note, Ways } from '$lib/components';
</script>

# Documentation

Search for an answer about Platica with `q`. To read the full article, take the result’s `id` and use it in the read call. With your assistant, search using [`search_product_docs`](/mcp/tools#docs).

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
# Search
curl https://api.platic.ai/v1/docs/search?q=connect%20WhatsApp \
  -H "Authorization: Bearer $PLATIC_API_KEY"

# Read one document
curl https://api.platic.ai/v1/docs/$DOC_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
// Search
await platic.docs.search("connect WhatsApp");

// Read one document
await platic.docs.get("doc_123");
```

</Ways.Way>
</Ways>

It does not require module permissions or accept `workspace`. The credential authorizes the query; all users search the same documentation.

It accepts both Bearer credentials: an OAuth access token (`pl_at_…`) or an API key (`pl_key_…`). See [Authentication](/authentication).

---

## Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `q` | string, 1-200 | — | Text to search for. Required. |
| `limit` | integer 1-8 | `5` | How many results to return. |

---

## Response

```json
{
  "status": "success",
  "data": [
    {
      "id": "get_obtener_webhook1aade1",
      "name": "get_obtener_webhook1aade1",
      "topic": "Get a webhook",
      "snippet": "GET https://api.platic.ai/v1/webhooks/{webhookId} returns a webhook of the workspace."
    }
  ]
}
```

`data` contains the matches, from most to least relevant, up to `limit`. It is not paginated, so it has no `nextPageToken`.

| Field | Type | Description |
|-------|------|-------------|
| `data[].id` | string | Identifier of the fragment. |
| `data[].name` | string | Name of the document. |
| `data[].topic` | string | Topic. |
| `data[].snippet` | string | Excerpt, 240 characters at most. It does not include the whole document. |

A search without matches answers `200` with `data: []`.

<Note type="note">

This route answers questions about how Platica works. To operate a workspace — messages, contacts, campaigns — use that resource's endpoint.

</Note>

---

## Read a whole document

The search returns excerpts. To read a whole document, ask for its `id`:

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `id` | `string` (path) | `id` of a search result. | Yes |
| `offset` | `integer` (query) | Where to continue from, `0` to `1000000`. Use the `nextOffset` from the previous response. Default `0`. | No |

The response returns the document in `data`, with `title`, `url`, `content`, and `nextOffset`:

```json
{
  "status": "success",
  "data": {
    "id": "get_obtener_webhook1aade1",
    "title": "Get a webhook",
    "url": "https://docs.platica.mx/api/webhooks/get-webhook",
    "content": "# Get a webhook\n\n…",
    "offset": 0,
    "nextOffset": null,
    "totalCharacters": 2480
  }
}
```

`nextOffset` marks where to continue reading the document. If it is `null`, you have received the full text; if it is a number, repeat the call with `?offset=` and that value. The [`get_product_doc`](/mcp/tools#docs) MCP tool makes the same query.

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `q` is missing, `q` is over 200 characters, `limit` is not an integer between 1 and 8, or the `id` or `offset` of a document is not in a valid format |
| `401` | `UNAUTHENTICATED` | The Bearer is missing, or the token/key is not valid |
| `404` | `NOT_FOUND` | There is no document with that `id` |
| `502` | `UPSTREAM_ERROR` | The search or the read could not be completed |
| `503` | `TEMPORARILY_UNAVAILABLE` | The documentation search is not available |

See [Errors](/api-reference/errors) for the full shape of an error.
