curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/handoffs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"subject": {
"value": "<string>",
"scope": "<string>"
},
"target": "<string>",
"agent": "<string>",
"conversation_id": "<string>",
"expected_by": "2023-11-07T05:31:56Z",
"level": "V0",
"reason": "<string>"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/handoffs"
payload = {
"subject": {
"value": "<string>",
"scope": "<string>"
},
"target": "<string>",
"agent": "<string>",
"conversation_id": "<string>",
"expected_by": "2023-11-07T05:31:56Z",
"level": "V0",
"reason": "<string>"
}
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({
subject: {value: '<string>', scope: '<string>'},
target: '<string>',
agent: '<string>',
conversation_id: '<string>',
expected_by: '2023-11-07T05:31:56Z',
level: 'V0',
reason: '<string>'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/handoffs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{space}.{region}.api.niadra.com/v1/handoffs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => [
'value' => '<string>',
'scope' => '<string>'
],
'target' => '<string>',
'agent' => '<string>',
'conversation_id' => '<string>',
'expected_by' => '2023-11-07T05:31:56Z',
'level' => 'V0',
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/handoffs"
payload := strings.NewReader("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"target\": \"<string>\",\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"expected_by\": \"2023-11-07T05:31:56Z\",\n \"level\": \"V0\",\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{space}.{region}.api.niadra.com/v1/handoffs")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"target\": \"<string>\",\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"expected_by\": \"2023-11-07T05:31:56Z\",\n \"level\": \"V0\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/handoffs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"target\": \"<string>\",\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"expected_by\": \"2023-11-07T05:31:56Z\",\n \"level\": \"V0\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"handoff_id": "<string>",
"status": "created",
"expected_by": "2023-11-07T05:31:56Z",
"outcome": "<string>",
"package": {
"context": {
"text": "<string>",
"etag": "<string>",
"policy_version": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"from_agent": "<string>",
"handoff_id": "<string>",
"level": "V0",
"target": "<string>",
"commitments_active": [
{
"id": "<string>",
"type": "<string>",
"valid_until": "2023-11-07T05:31:56Z"
}
],
"effects": [
{
"effect_id": "<string>",
"kind": "delivery",
"state": "reserved"
}
],
"open_objects": [
{
"ref": {
"id": "<string>",
"namespace": "<string>",
"type": "<string>"
},
"since": "2023-11-07T05:31:56Z",
"state": "<string>"
}
],
"outcome": {
"expected_by": "2023-11-07T05:31:56Z",
"vocabulary": [
"<string>"
]
},
"owner": {
"epoch": 123,
"holder": "<string>",
"kind": "owner",
"level": "<string>",
"since": "2023-11-07T05:31:56Z",
"source": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"via": "declaration"
},
"promises_open": [
{
"id": "<string>",
"owner": "<string>",
"due": "2023-11-07T05:31:56Z"
}
],
"reason": "<string>",
"spec": "handoff-package.v0",
"subject": {
"type": "phone_e164",
"value": "<string>",
"scope": "<string>",
"subject_kind": "person"
},
"suppressions": [
"<string>"
]
}
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Create a handoff
Hands the customer to another holder with a package compiled at the receiving side’s verification level and policy; the customer is held until the outcome.
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/handoffs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"subject": {
"value": "<string>",
"scope": "<string>"
},
"target": "<string>",
"agent": "<string>",
"conversation_id": "<string>",
"expected_by": "2023-11-07T05:31:56Z",
"level": "V0",
"reason": "<string>"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/handoffs"
payload = {
"subject": {
"value": "<string>",
"scope": "<string>"
},
"target": "<string>",
"agent": "<string>",
"conversation_id": "<string>",
"expected_by": "2023-11-07T05:31:56Z",
"level": "V0",
"reason": "<string>"
}
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({
subject: {value: '<string>', scope: '<string>'},
target: '<string>',
agent: '<string>',
conversation_id: '<string>',
expected_by: '2023-11-07T05:31:56Z',
level: 'V0',
reason: '<string>'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/handoffs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{space}.{region}.api.niadra.com/v1/handoffs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => [
'value' => '<string>',
'scope' => '<string>'
],
'target' => '<string>',
'agent' => '<string>',
'conversation_id' => '<string>',
'expected_by' => '2023-11-07T05:31:56Z',
'level' => 'V0',
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{space}.{region}.api.niadra.com/v1/handoffs"
payload := strings.NewReader("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"target\": \"<string>\",\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"expected_by\": \"2023-11-07T05:31:56Z\",\n \"level\": \"V0\",\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{space}.{region}.api.niadra.com/v1/handoffs")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"target\": \"<string>\",\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"expected_by\": \"2023-11-07T05:31:56Z\",\n \"level\": \"V0\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/handoffs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": {\n \"value\": \"<string>\",\n \"scope\": \"<string>\"\n },\n \"target\": \"<string>\",\n \"agent\": \"<string>\",\n \"conversation_id\": \"<string>\",\n \"expected_by\": \"2023-11-07T05:31:56Z\",\n \"level\": \"V0\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"handoff_id": "<string>",
"status": "created",
"expected_by": "2023-11-07T05:31:56Z",
"outcome": "<string>",
"package": {
"context": {
"text": "<string>",
"etag": "<string>",
"policy_version": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"from_agent": "<string>",
"handoff_id": "<string>",
"level": "V0",
"target": "<string>",
"commitments_active": [
{
"id": "<string>",
"type": "<string>",
"valid_until": "2023-11-07T05:31:56Z"
}
],
"effects": [
{
"effect_id": "<string>",
"kind": "delivery",
"state": "reserved"
}
],
"open_objects": [
{
"ref": {
"id": "<string>",
"namespace": "<string>",
"type": "<string>"
},
"since": "2023-11-07T05:31:56Z",
"state": "<string>"
}
],
"outcome": {
"expected_by": "2023-11-07T05:31:56Z",
"vocabulary": [
"<string>"
]
},
"owner": {
"epoch": 123,
"holder": "<string>",
"kind": "owner",
"level": "<string>",
"since": "2023-11-07T05:31:56Z",
"source": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"via": "declaration"
},
"promises_open": [
{
"id": "<string>",
"owner": "<string>",
"due": "2023-11-07T05:31:56Z"
}
],
"reason": "<string>",
"spec": "handoff-package.v0",
"subject": {
"type": "phone_e164",
"value": "<string>",
"scope": "<string>",
"subject_kind": "person"
},
"suppressions": [
"<string>"
]
}
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
nia_sk_...
Headers
Required. Kept 24 hours with the hash of the body: a retry with the same key returns the first answer, and the same key with a different body returns 409 conflict.
1 - 256Body
Hands the subject to target. The package is compiled at level, the verification the receiving
side has of the subject, so it never carries what that side could not read.
An identifier of a subject in some channel or system: a phone, an e-mail, a CRM id.
Show child attributes
Show child attributes
1 - 256The agent handing off; the calling key's name when absent.
1 - 2561 - 512When the outcome is due; the space's default wait when absent.
Session verification levels. no_customer sits outside the V0-V4 scale.
V0, V1, V2, V3, V4, no_customer 1 - 500Response
The handoff, with its package.
1 - 512created, accepted, closed, expired 1 - 256What a handoff carries to whoever receives it (the coordination spec, 7).
Show child attributes
Show child attributes

