curl --request POST \
--url https://api.snowleopard.ai/datafiles/{datafile_id}/retrieve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userQuery": "How many superheroes are there?",
"knownData": {
"user_id": "12345",
"company_name": "Acme Corp"
}
}
'{
"__type__": "retrieveResponse",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": [
{
"__type__": "schemaData",
"schemaId": "<string>",
"schemaType": "SQLite",
"query": "<string>",
"rows": [
{}
],
"querySummary": {
"technical_details": "<string>",
"non_technical_explanation": "<string>"
},
"rowMax": 123,
"isTrimmed": true,
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"responseStatus": "SUCCESS"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 400,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 401,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 404,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"responseStatus": "UNABLE_TO_UNDERSTAND_QUESTION",
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 500,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 503,
"description": "<string>"
}Endpoints
Retrieve
Execute a natural language query against a Playground datafile and return the retrieved data.
POST
/
datafiles
/
{datafile_id}
/
retrieve
curl --request POST \
--url https://api.snowleopard.ai/datafiles/{datafile_id}/retrieve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userQuery": "How many superheroes are there?",
"knownData": {
"user_id": "12345",
"company_name": "Acme Corp"
}
}
'{
"__type__": "retrieveResponse",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": [
{
"__type__": "schemaData",
"schemaId": "<string>",
"schemaType": "SQLite",
"query": "<string>",
"rows": [
{}
],
"querySummary": {
"technical_details": "<string>",
"non_technical_explanation": "<string>"
},
"rowMax": 123,
"isTrimmed": true,
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"responseStatus": "SUCCESS"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 400,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 401,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 404,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"responseStatus": "UNABLE_TO_UNDERSTAND_QUESTION",
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 500,
"description": "<string>"
}{
"__type__": "apiError",
"callId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 503,
"description": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your auth API key. Create an api_key
Path Parameters
Unique identifier for the datafile to query
Body
application/json
Natural language query to execute against the Playground datafile
Example:
"How many superheroes are there?"
Optional key-value pairs to provide additional context for Snow Leopard to use when answering the question.
Example:
{
"user_id": "12345",
"company_name": "Acme Corp"
}
Response
Successful query execution
Type discriminator
Available options:
retrieveResponse Unique identifier for this API call
Array of query results or errors
- schemaData
- errorSchemaData
Show child attributes
Show child attributes
Status of the API response
Available options:
SUCCESS