curl --request POST \
--url http://localhost:3333/v1/context \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "How do we handle user authentication in our application?",
"answer": "We use a hybrid authentication system supporting both API keys and session-based authentication. API keys are used for programmatic access while sessions are used for web interface interactions.",
"tags": [
"authentication",
"security",
"api",
"sessions"
]
}
'{
"id": "ctx_abc123def456",
"organizationId": "org_xyz789uvw012",
"question": "How do we handle user authentication in our application?",
"answer": "We use a hybrid authentication system supporting both API keys and session-based authentication.",
"tags": [
"authentication",
"security",
"api",
"sessions"
],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"authType": "apikey"
}Creates a new context entry for the authenticated organization. All required fields must be provided. Supports both API key authentication (X-API-Key header) and session authentication (Bearer token or cookies).
curl --request POST \
--url http://localhost:3333/v1/context \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "How do we handle user authentication in our application?",
"answer": "We use a hybrid authentication system supporting both API keys and session-based authentication. API keys are used for programmatic access while sessions are used for web interface interactions.",
"tags": [
"authentication",
"security",
"api",
"sessions"
]
}
'{
"id": "ctx_abc123def456",
"organizationId": "org_xyz789uvw012",
"question": "How do we handle user authentication in our application?",
"answer": "We use a hybrid authentication system supporting both API keys and session-based authentication.",
"tags": [
"authentication",
"security",
"api",
"sessions"
],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"authType": "apikey"
}API key for authentication
Context entry data
The question or topic this context entry addresses
"How do we handle user authentication in our application?"
The answer or detailed explanation for the question
"We use a hybrid authentication system supporting both API keys and session-based authentication. API keys are used for programmatic access while sessions are used for web interface interactions."
Tags to categorize and help search this context entry
[
"authentication",
"security",
"api",
"sessions"
]Was this page helpful?