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": [
    {
      "target_type": "source",
      "search_text": "<string>"
    }
  ],
  "scopes": [
    {
      "environment": "<string>",
      "package": "<string>",
      "version": "<string>",
      "model_path": "<string>",
      "source": "<string>",
      "entity_name": "<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>",
            "type": "equal",
            "dimension": "<string>",
            "required": true
          }
        ]
      },
      "relevance": 123,
      "prominence": 123,
      "matched_targets": [
        {
          "search_text": "<string>",
          "relevance": 123,
          "match_reason": "<string>"
        }
      ],
      "entities": [
        {
          "name": "<string>",
          "entity_type": "view",
          "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>"
            }
          ]
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth 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.

Response

OK

Response from the get_context endpoint

sources
object[]
required

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