Knowledge

Search knowledge base

Semantic (embedding cosine-similarity) search over the org's knowledge base chunks. Only chunks scoring above a 0.3 similarity threshold are returned.

GET/api/public/knowledge/search
cURLGET /api/public/knowledge/search
curl "https://postiv.ai/api/public/knowledge/search?query=launch%20week&limit=10" \
  -H "Authorization: Bearer pk_postiv_..."
200Response
{
  "success": true,
  "hits": [
    {
      "assetId": "b1c2...",
      "title": "Q3 Positioning Notes",
      "kind": "document",
      "content": "Postiv is an inbound LinkedIn content tool for agencies...",
      "score": 0.81
    }
  ]
}

Authorization

Requires an organization API key with the knowledge:read scope, sent as Authorization: Bearer or x-api-key.

Query parameters

querystringrequired

Search text, 1-2000 chars (trimmed).

limitintdefault: 5

Max results, 1-20.

Response

Ranked list of matching chunks.

hits[].assetIduuid

Source asset id.

hits[].titlestring

Source asset title.

hits[].kindstring

Normalized asset kind.

hits[].contentstring

Chunk text, truncated to 500 chars with a trailing ellipsis if longer.

hits[].scorefloat

Cosine similarity score (>0.3).

Errors

400validation_error: missing/empty query

Good to know

  • Scoped strictly by the API key's org_id (not the app's getUserOrganization 'most recent org' pattern), so it's correct for multi-org/agency callers.