Create a session
curl --request POST \
--url https://api.zelinqa.ai/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"client_reference": "<string>",
"max_turns": 50,
"initial_history": [
{
"text": "<string>",
"message_id": "<string>",
"question_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://api.zelinqa.ai/v1/sessions"
payload = {
"client_reference": "<string>",
"max_turns": 50,
"initial_history": [
{
"text": "<string>",
"message_id": "<string>",
"question_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_reference: '<string>',
max_turns: 50,
initial_history: [
{
text: '<string>',
message_id: '<string>',
question_id: '<string>',
occurred_at: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://api.zelinqa.ai/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "<string>",
"session_id": "<string>",
"client_reference": "<string>",
"status": "active",
"turn_count": 1,
"max_turns": 2,
"turns_remaining": 1,
"question_state": {
"outcomes": [
{
"question_id": "<string>",
"decision_id": "<string>",
"outcome": "asked_answered",
"source": "client",
"message_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
},
"targets": {},
"progress": {
"objective": {
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
},
"sub_objectives": [
{
"id": "<string>",
"order_position": 1,
"completion_role": "blocking",
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
}
]
},
"pending_decision": {
"decision_id": "<string>",
"candidates": [
{
"rank": 5,
"question_id": "<string>",
"text": "<string>",
"type": "open",
"choices": [
{
"choice_id": "<string>",
"label": "<string>"
}
],
"target_ids": [
"<string>"
]
}
]
},
"degraded": true,
"versions": {
"state_version": 1,
"engine_version": "<string>",
"api_version": "1.0"
}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}Sessions
Create a session
Create a server-side conversation session pinned to the active published configuration.
POST
/
v1
/
sessions
Create a session
curl --request POST \
--url https://api.zelinqa.ai/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"client_reference": "<string>",
"max_turns": 50,
"initial_history": [
{
"text": "<string>",
"message_id": "<string>",
"question_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://api.zelinqa.ai/v1/sessions"
payload = {
"client_reference": "<string>",
"max_turns": 50,
"initial_history": [
{
"text": "<string>",
"message_id": "<string>",
"question_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_reference: '<string>',
max_turns: 50,
initial_history: [
{
text: '<string>',
message_id: '<string>',
question_id: '<string>',
occurred_at: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://api.zelinqa.ai/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "<string>",
"session_id": "<string>",
"client_reference": "<string>",
"status": "active",
"turn_count": 1,
"max_turns": 2,
"turns_remaining": 1,
"question_state": {
"outcomes": [
{
"question_id": "<string>",
"decision_id": "<string>",
"outcome": "asked_answered",
"source": "client",
"message_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
},
"targets": {},
"progress": {
"objective": {
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
},
"sub_objectives": [
{
"id": "<string>",
"order_position": 1,
"completion_role": "blocking",
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
}
]
},
"pending_decision": {
"decision_id": "<string>",
"candidates": [
{
"rank": 5,
"question_id": "<string>",
"text": "<string>",
"type": "open",
"choices": [
{
"choice_id": "<string>",
"label": "<string>"
}
],
"target_ids": [
"<string>"
]
}
]
},
"degraded": true,
"versions": {
"state_version": 1,
"engine_version": "<string>",
"api_version": "1.0"
}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
8 - 128Body
application/json
Response
Successful response.
Available options:
active, completed, stopped Required range:
x >= 0Required range:
x >= 1Required range:
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes