Documentation

SDK platic.docs.search()
SDK platic.docs.get()

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.

Example

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

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

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.


Parameters

ParameterTypeDefaultDescription
qstring, 1-200—Text to search for. Required.
limitinteger 1-85How many results to return.

Response

{
  "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.

FieldTypeDescription
data[].idstringIdentifier of the fragment.
data[].namestringName of the document.
data[].topicstringTopic.
data[].snippetstringExcerpt, 240 characters at most. It does not include the whole document.

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


Read a whole document

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

ParameterTypeDescriptionRequired
idstring (path)id of a search result.Yes
offsetinteger (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:

{
  "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 tool makes the same query.

Errors

Statusdetails.codeWhen
400INVALID_REQUESTq 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
401UNAUTHENTICATEDThe Bearer is missing, or the token/key is not valid
404NOT_FOUNDThere is no document with that id
502UPSTREAM_ERRORThe search or the read could not be completed
503TEMPORARILY_UNAVAILABLEThe documentation search is not available

See Errors for the full shape of an error.