curl --request POST \
--url https://gateway.apiosk.com/v2/asks/{id}/continue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"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>"
},
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {
"entity_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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>'
},
action_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
input: {entity_ref: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}
})
};
fetch('https://gateway.apiosk.com/v2/asks/{id}/continue', 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-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": {}
}
]
}
}{
"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-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>"
}
}{
"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-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>"
}
}Continue a saved run
Requires ask:execute and the same key that created the task. Submit a returned select_entity or supply_input action with its signed state. Resumes existing approved work without buying the search twice. Never approves a new quote. Idempotency-Key is required; retry the same state, action and input unchanged.
curl --request POST \
--url https://gateway.apiosk.com/v2/asks/{id}/continue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"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>"
},
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": {
"entity_ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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>'
},
action_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
input: {entity_ref: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}
})
};
fetch('https://gateway.apiosk.com/v2/asks/{id}/continue', 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-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": {}
}
]
}
}{
"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-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>"
}
}{
"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-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>"
}
}Authorizations
An organisation API key: Authorization: Bearer apk_org_live_…
Headers
Unique per task continuation. Reuse for retries of the same state/action/input.
1 - 255^[!-~]+$Path Parameters
Body
Response
Success
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
Natural-language clarification for needs_input.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Attribution for a single result, when present.
Show child attributes
Show child attributes

