Ask a question
curl --request POST \
--url https://gateway.apiosk.com/v2/ask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "Registered address and latest filed accounts for Mollie B.V."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: 'Registered address and latest filed accounts for Mollie B.V.'})
};
fetch('https://gateway.apiosk.com/v2/ask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requires_approval",
"question": "<string>",
"plan": {
"quote_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"steps": [
{
"source_id": "kvk",
"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
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requires_approval",
"question": "<string>",
"plan": {
"quote_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"steps": [
{
"source_id": "kvk",
"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
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}API Reference
Ask a question
Plan across sources. Free in plan mode. Requires ask:create, and ask:execute for auto mode.
POST
/
v2
/
ask
Ask a question
curl --request POST \
--url https://gateway.apiosk.com/v2/ask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "Registered address and latest filed accounts for Mollie B.V."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: 'Registered address and latest filed accounts for Mollie B.V.'})
};
fetch('https://gateway.apiosk.com/v2/ask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requires_approval",
"question": "<string>",
"plan": {
"quote_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"steps": [
{
"source_id": "kvk",
"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
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requires_approval",
"question": "<string>",
"plan": {
"quote_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "2023-11-07T05:31:56Z",
"steps": [
{
"source_id": "kvk",
"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
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}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
Maximum string length:
4000Example:
"Registered address and latest filed accounts for Mollie B.V."
Available options:
plan, auto Required with auto.
Example:
1
Required range:
1 <= x <= 50Required range:
0 <= x <= 55Response
Success
Available options:
requires_approval, running, completed, partial, needs_input, needs_selection, unsupported, cancelled, failed Show child attributes
Show child attributes
Apiosk's reading of the results, with evidence pointers. Null for a direct call.
The source document, when the run produced exactly one.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes