Skip to main content
POST
/
api
/
v1
/
skills
/
{id}
/
context
curl --request POST \
  --url https://api.staging.getmodus.com/api/v1/skills/{id}/context \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "Which tables describe customer churn?"
}
'
{
  "context": "## Retrieved Context\n\n### customers\n\n...",
  "contextItems": [],
  "originalCount": 42,
  "sessionId": "api-skill-42-550e8400-e29b-41d4-a716-446655440000"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
number
required

Numeric skill id.

Example:

42

Body

application/json
message
string
required

User message or intent used to compose relevant context (RAG query).

Minimum string length: 1
Example:

"What tables describe customer churn?"

limit
number

Optional cap on context items when the API falls back to structured JSON (no fragment markdown). Ignored when composed markdown is returned.

Required range: 1 <= x <= 200
Example:

25

Response

context
string
required

Composed context for the skill and intent (markdown from the context composer, or structured JSON fallback).

Example:

"## Retrieved Context\n\n### customers\n\n..."

contextItems
object[]
required
deprecated

Deprecated. Always an empty array. Use context for composed text (markdown or JSON fallback).

Example:
[]
originalCount
number
required

Total context items considered before filtering.

Example:

42

sessionId
string
required

Session id used for this composition (for correlation).

Example:

"api-skill-42-550e8400-e29b-41d4-a716-446655440000"