Discover the same API choices as the Ask page
curl --request POST \
--url https://gateway.apiosk.com/v2/ask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>'})
};
fetch('https://gateway.apiosk.com/v2/ask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "choices",
"question": "<string>",
"parsed_request": {},
"apis": [
{
"origin": "apiosk",
"name": "<string>",
"executable": true,
"api_id": "<string>",
"capability": "<string>",
"source_slug": "<string>",
"url": "<string>",
"availability": "<string>",
"inputs": [
{
"field": "<string>",
"schema": {},
"required": true
}
],
"input_values": {},
"missing_inputs": [
"<string>"
],
"outputs": [
{
"field": "<string>",
"schema": {},
"required": true
}
],
"lookup": {},
"buyer_price": {
"currency": "<string>",
"provider_atomic": "<string>",
"buyer_atomic": "<string>"
}
}
],
"searches": {},
"errors": [
{}
]
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requires_approval",
"question": "<string>",
"capability": "<string>",
"normalized_records": [
{
"entity_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_refs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"facts": [
{
"type": "<string>",
"value": "<unknown>",
"observed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"sources": [
{
"source_id": "<string>",
"result_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_url": "<string>",
"retrieved_at": "2023-11-07T05:31:56Z",
"source_pointer": "<string>"
}
]
}
]
}
],
"plan": {
"quote_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"steps": [
{
"source_id": "kvk-dutch-business-register",
"operation": "company_registry.search",
"name": "<string>",
"conditional": true,
"estimated_cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
}
],
"estimated_total": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
},
"answer": {},
"data": {},
"results": [
{
"result_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"provider": "<string>",
"name": "<string>"
},
"data": {}
}
],
"usage": {
"sources": [
{
"source_id": "<string>",
"operation": "<string>",
"calls": 123,
"cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
}
],
"cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"held": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
},
"balance": {
"remaining": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
],
"retry_after_ms": 123,
"message": "<string>",
"needs_input": [
{
"label": "<string>",
"schema": {}
}
],
"candidates": [
{}
],
"approval_required_reason": {
"code": "<string>",
"message": "<string>"
},
"metadata": {},
"continuation": {
"state": {
"schema_version": "2",
"state_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 1,
"expires_at": "2023-11-07T05:31:56Z",
"focus": {
"entity_refs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"goal_refs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"state_token": "<string>"
},
"actions": [
{
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "select_entity",
"label": "<string>",
"requires_authorization": false,
"input_schema": {}
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}API Reference
Discover the same API choices as the Ask page
Requires ask:create. A question uses the shared App interpreter/search and creates no task, approval or paid provider request. Explicit workflow objects retain their plan/auto behavior.
POST
/
v2
/
ask
Discover the same API choices as the Ask page
curl --request POST \
--url https://gateway.apiosk.com/v2/ask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>'})
};
fetch('https://gateway.apiosk.com/v2/ask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "choices",
"question": "<string>",
"parsed_request": {},
"apis": [
{
"origin": "apiosk",
"name": "<string>",
"executable": true,
"api_id": "<string>",
"capability": "<string>",
"source_slug": "<string>",
"url": "<string>",
"availability": "<string>",
"inputs": [
{
"field": "<string>",
"schema": {},
"required": true
}
],
"input_values": {},
"missing_inputs": [
"<string>"
],
"outputs": [
{
"field": "<string>",
"schema": {},
"required": true
}
],
"lookup": {},
"buyer_price": {
"currency": "<string>",
"provider_atomic": "<string>",
"buyer_atomic": "<string>"
}
}
],
"searches": {},
"errors": [
{}
]
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requires_approval",
"question": "<string>",
"capability": "<string>",
"normalized_records": [
{
"entity_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_refs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"facts": [
{
"type": "<string>",
"value": "<unknown>",
"observed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"sources": [
{
"source_id": "<string>",
"result_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_url": "<string>",
"retrieved_at": "2023-11-07T05:31:56Z",
"source_pointer": "<string>"
}
]
}
]
}
],
"plan": {
"quote_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"steps": [
{
"source_id": "kvk-dutch-business-register",
"operation": "company_registry.search",
"name": "<string>",
"conditional": true,
"estimated_cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
}
],
"estimated_total": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
},
"answer": {},
"data": {},
"results": [
{
"result_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"provider": "<string>",
"name": "<string>"
},
"data": {}
}
],
"usage": {
"sources": [
{
"source_id": "<string>",
"operation": "<string>",
"calls": 123,
"cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
}
],
"cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"held": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
},
"balance": {
"remaining": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
],
"retry_after_ms": 123,
"message": "<string>",
"needs_input": [
{
"label": "<string>",
"schema": {}
}
],
"candidates": [
{}
],
"approval_required_reason": {
"code": "<string>",
"message": "<string>"
},
"metadata": {},
"continuation": {
"state": {
"schema_version": "2",
"state_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 1,
"expires_at": "2023-11-07T05:31:56Z",
"focus": {
"entity_refs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"goal_refs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"state_token": "<string>"
},
"actions": [
{
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "select_entity",
"label": "<string>",
"requires_authorization": false,
"input_schema": {}
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
An organisation API key: Authorization: Bearer apk_org_live_…
Headers
Retry-safe key: the same key with the same body pays once.
Maximum string length:
255Body
application/json
- Option 1
- Option 2
Limit counted in UTF-16 code units.
Required string length:
1 - 16000
