Skip to main content
POST
/
get_context
Search semantic model context
curl --request POST \
  --url https://{organization}.retrieval.credibledata.com/api/v1/get_context \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "search_targets": [
    {
      "search_text": "<string>"
    }
  ],
  "scopes": [
    {
      "environment": "<string>",
      "package": "<string>",
      "version": "<string>",
      "model_path": "<string>",
      "source": "<string>",
      "entity_name": "<string>"
    }
  ],
  "filter_params": {},
  "user_prompt": "<string>"
}
'
{
  "sources": [
    {
      "source_info": {
        "resource_id": {
          "environment": "<string>",
          "package": "<string>",
          "version": "<string>",
          "model_path": "<string>",
          "source": "<string>",
          "entity_name": "<string>"
        },
        "docs": "<string>",
        "summary": "<string>",
        "filter_params": [
          {
            "name": "<string>",
            "dimension": "<string>",
            "required": true
          }
        ]
      },
      "relevance": 123,
      "prominence": 123,
      "matched_targets": [
        {
          "search_text": "<string>",
          "relevance": 123,
          "match_reason": "<string>"
        }
      ],
      "entities": [
        {
          "name": "<string>",
          "relevance": 123,
          "prominence": 123,
          "data_type": "<string>",
          "description": "<string>",
          "values": [
            {
              "value": "<string>",
              "relevance": 123,
              "prominence": 123,
              "search_text": "<string>"
            }
          ],
          "values_indexed": true,
          "code": "<string>",
          "matched_targets": [
            {
              "search_text": "<string>",
              "relevance": 123,
              "match_reason": "<string>"
            }
          ]
        }
      ]
    }
  ],
  "warnings": [
    "<string>"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.credibledata.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Auth0-issued user JWT. Provide as Authorization: Bearer <token>.

Body

application/json

Request body for the get_context endpoint

search_targets
object[]
required

Typed search targets describing what to find. Each target specifies a target type and optional search text for semantic matching.

scopes
object[] | null

Optional list of scopes to narrow the search. Results will be scoped to the union of these.

filter_params
object

Filter parameter values keyed by filter name. Used with sources that declare #(filter) annotations. Each value is either a single string or an array of strings (matches the dataplane API's filterParams shape). When the new dimensional-index path is enabled and active for a package whose target dimension declares #(filter, required), the corresponding filter values MUST be supplied here — the request will return 400 otherwise. Ignored on the legacy path.

user_prompt
string | null

Optional. The user's prompt that triggered this call, used for observability and downstream ranking. On the first turn this is the user's message verbatim. On follow-up turns where the user's message doesn't convey intent (e.g. "yes" to an agent suggestion), synthesize a short prompt that captures the intent of the turn. Use the same value for every get_context call within a single turn.

Response

OK

Response from the get_context endpoint

sources
object[]
required

Matched sources sorted by relevance then prominence (empty when no good matches)

warnings
string[] | null

Optional warnings about the result set (e.g. when results were truncated or capped). Omitted when empty.