Create a workflow
curl --request POST \
--url https://api.sakari.io/v1/accounts/{accountId}/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"templateId": "<string>",
"parameters": [
{
"id": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.sakari.io/v1/accounts/{accountId}/workflows"
payload = {
"name": "<string>",
"templateId": "<string>",
"parameters": [
{
"id": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
templateId: '<string>',
parameters: [{id: '<string>', value: '<string>'}]
})
};
fetch('https://api.sakari.io/v1/accounts/{accountId}/workflows', 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://api.sakari.io/v1/accounts/{accountId}/workflows",
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([
'name' => '<string>',
'templateId' => '<string>',
'parameters' => [
[
'id' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.sakari.io/v1/accounts/{accountId}/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"templateId\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.sakari.io/v1/accounts/{accountId}/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"templateId\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sakari.io/v1/accounts/{accountId}/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"templateId\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"versions": [
{
"id": "<string>",
"definition": {
"nodes": [
{
"id": "<string>",
"type": {
"id": "<string>",
"type": "<string>",
"name": "<string>",
"group": "<string>",
"label": "<string>",
"description": "<string>",
"icon": "<string>",
"properties": [
{
"name": "<string>",
"label": "<string>",
"helperText": "<string>",
"link": "<string>",
"mandatory": true,
"args": [
"<string>"
],
"options": [
{
"value": "<string>",
"label": "<string>"
}
],
"min": 123,
"max": 123,
"defaultValue": "<string>",
"conditions": [
{
"property": "<string>",
"comparator": "<string>",
"value": "<string>"
}
]
}
],
"outputs": [
{
"path": "<string>",
"name": "<string>",
"default": true
}
],
"validation": {
"numEdges": 123,
"edges": [
{
"value": {
"mandatory": true,
"editable": true,
"value": "<string>",
"default": "<string>"
},
"multiple": true,
"defaultEdge": true
}
]
},
"supportsReenrollment": true,
"color": "<string>",
"status": "<string>",
"supportLink": "<string>"
},
"config": {
"message": "<string>",
"groups": [
{
"id": "<string>",
"name": "<string>",
"phoneNumbers?": [
{
"id": "<string>",
"status": "<string>",
"number": "<string>",
"country": "<string>",
"type": "<string>",
"name": "<string>",
"verified": true,
"provider": "<string>",
"supportedDestinations": [
"<string>"
],
"forwardTo": {},
"universalReply": true,
"channels": {
"sms": {
"active": true,
"universalReply": true,
"supportedDestinations": {},
"regulatory": {
"brandStatus": "<string>",
"campaign": {
"id": "<string>",
"campaignId": "<string>",
"useCase": "<string>"
},
"pft": true,
"submitted": "2023-11-07T05:31:56Z",
"approved": "2023-11-07T05:31:56Z",
"rejected": "2023-11-07T05:31:56Z"
}
},
"voice": {
"active": true,
"incoming": {
"forwardTo": "<string>",
"message": "<string>",
"transcribe": true
},
"features": [
"<string>"
]
},
"whatsapp": {
"active": true
}
},
"groups": [
{
"id": "<string>",
"name": "<string>"
}
],
"hosted": true
}
],
"notifications": [
{
"destination": {
"id": "<string>",
"name": "<string>"
},
"integration": "<string>",
"group": {
"id": "<string>",
"name": "<string>"
}
}
],
"tags": [
"<string>"
],
"users": [
{
"id": "<string>",
"email": "chris@sakari.io",
"firstName": "Chris",
"lastName": "Bloggs",
"mobile": {
"country": "<string>",
"number": "123-456-7890",
"verified": "2023-11-07T05:31:56Z",
"valid": true,
"lineType": "mobile"
},
"tacAccepted": "2023-11-07T05:31:56Z"
}
],
"senders": [
{
"id": "<string>",
"type": "phonenumber",
"subType": "<string>",
"status": "<string>",
"identifier": "<string>",
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"channels": {
"sms": {
"active": true,
"universalReply": true,
"supportedDestinations": {},
"regulatory": {
"brandStatus": "<string>",
"campaign": {
"id": "<string>",
"campaignId": "<string>",
"useCase": "<string>"
},
"pft": true,
"submitted": "2023-11-07T05:31:56Z",
"approved": "2023-11-07T05:31:56Z",
"rejected": "2023-11-07T05:31:56Z"
}
},
"voice": {
"active": true,
"incoming": {
"forwardTo": "<string>",
"message": "<string>",
"transcribe": true
},
"features": [
"<string>"
]
},
"whatsapp": {
"active": true
}
},
"groups": [
{
"id": "<string>",
"name": "<string>"
}
]
}
],
"officeHours": {
"active": true,
"timezone": "<string>",
"times": {
"sun": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"mon": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"tue": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"wed": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"thu": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"fri": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"sat": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
]
}
},
"isDefault": true,
"useSharedPool": true
}
]
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"value": "<string>"
}
],
"properties": [
{
"name": "<string>",
"created": {
"at": "2023-11-07T05:31:56Z"
}
}
]
},
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"name": "<string>",
"readonly": true,
"active": "2023-11-07T05:31:56Z",
"lastActive": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}workflows
Create a workflow
POST
/
v1
/
accounts
/
{accountId}
/
workflows
Create a workflow
curl --request POST \
--url https://api.sakari.io/v1/accounts/{accountId}/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"templateId": "<string>",
"parameters": [
{
"id": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.sakari.io/v1/accounts/{accountId}/workflows"
payload = {
"name": "<string>",
"templateId": "<string>",
"parameters": [
{
"id": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
templateId: '<string>',
parameters: [{id: '<string>', value: '<string>'}]
})
};
fetch('https://api.sakari.io/v1/accounts/{accountId}/workflows', 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://api.sakari.io/v1/accounts/{accountId}/workflows",
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([
'name' => '<string>',
'templateId' => '<string>',
'parameters' => [
[
'id' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.sakari.io/v1/accounts/{accountId}/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"templateId\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.sakari.io/v1/accounts/{accountId}/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"templateId\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sakari.io/v1/accounts/{accountId}/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"templateId\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"versions": [
{
"id": "<string>",
"definition": {
"nodes": [
{
"id": "<string>",
"type": {
"id": "<string>",
"type": "<string>",
"name": "<string>",
"group": "<string>",
"label": "<string>",
"description": "<string>",
"icon": "<string>",
"properties": [
{
"name": "<string>",
"label": "<string>",
"helperText": "<string>",
"link": "<string>",
"mandatory": true,
"args": [
"<string>"
],
"options": [
{
"value": "<string>",
"label": "<string>"
}
],
"min": 123,
"max": 123,
"defaultValue": "<string>",
"conditions": [
{
"property": "<string>",
"comparator": "<string>",
"value": "<string>"
}
]
}
],
"outputs": [
{
"path": "<string>",
"name": "<string>",
"default": true
}
],
"validation": {
"numEdges": 123,
"edges": [
{
"value": {
"mandatory": true,
"editable": true,
"value": "<string>",
"default": "<string>"
},
"multiple": true,
"defaultEdge": true
}
]
},
"supportsReenrollment": true,
"color": "<string>",
"status": "<string>",
"supportLink": "<string>"
},
"config": {
"message": "<string>",
"groups": [
{
"id": "<string>",
"name": "<string>",
"phoneNumbers?": [
{
"id": "<string>",
"status": "<string>",
"number": "<string>",
"country": "<string>",
"type": "<string>",
"name": "<string>",
"verified": true,
"provider": "<string>",
"supportedDestinations": [
"<string>"
],
"forwardTo": {},
"universalReply": true,
"channels": {
"sms": {
"active": true,
"universalReply": true,
"supportedDestinations": {},
"regulatory": {
"brandStatus": "<string>",
"campaign": {
"id": "<string>",
"campaignId": "<string>",
"useCase": "<string>"
},
"pft": true,
"submitted": "2023-11-07T05:31:56Z",
"approved": "2023-11-07T05:31:56Z",
"rejected": "2023-11-07T05:31:56Z"
}
},
"voice": {
"active": true,
"incoming": {
"forwardTo": "<string>",
"message": "<string>",
"transcribe": true
},
"features": [
"<string>"
]
},
"whatsapp": {
"active": true
}
},
"groups": [
{
"id": "<string>",
"name": "<string>"
}
],
"hosted": true
}
],
"notifications": [
{
"destination": {
"id": "<string>",
"name": "<string>"
},
"integration": "<string>",
"group": {
"id": "<string>",
"name": "<string>"
}
}
],
"tags": [
"<string>"
],
"users": [
{
"id": "<string>",
"email": "chris@sakari.io",
"firstName": "Chris",
"lastName": "Bloggs",
"mobile": {
"country": "<string>",
"number": "123-456-7890",
"verified": "2023-11-07T05:31:56Z",
"valid": true,
"lineType": "mobile"
},
"tacAccepted": "2023-11-07T05:31:56Z"
}
],
"senders": [
{
"id": "<string>",
"type": "phonenumber",
"subType": "<string>",
"status": "<string>",
"identifier": "<string>",
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"channels": {
"sms": {
"active": true,
"universalReply": true,
"supportedDestinations": {},
"regulatory": {
"brandStatus": "<string>",
"campaign": {
"id": "<string>",
"campaignId": "<string>",
"useCase": "<string>"
},
"pft": true,
"submitted": "2023-11-07T05:31:56Z",
"approved": "2023-11-07T05:31:56Z",
"rejected": "2023-11-07T05:31:56Z"
}
},
"voice": {
"active": true,
"incoming": {
"forwardTo": "<string>",
"message": "<string>",
"transcribe": true
},
"features": [
"<string>"
]
},
"whatsapp": {
"active": true
}
},
"groups": [
{
"id": "<string>",
"name": "<string>"
}
]
}
],
"officeHours": {
"active": true,
"timezone": "<string>",
"times": {
"sun": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"mon": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"tue": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"wed": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"thu": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"fri": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
],
"sat": [
{
"start": {
"hour": 123,
"minute": 123
},
"end": {
"hour": 123,
"minute": 123
}
}
]
}
},
"isDefault": true,
"useSharedPool": true
}
]
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"value": "<string>"
}
],
"properties": [
{
"name": "<string>",
"created": {
"at": "2023-11-07T05:31:56Z"
}
}
]
},
"created": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"updated": {
"at": "2023-11-07T05:31:56Z",
"by": {
"id": "<string>",
"name": "Joe Bloggs",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "joe@bloggs.com",
"source": "<string>",
"subSource": "<string>"
}
},
"name": "<string>",
"readonly": true,
"active": "2023-11-07T05:31:56Z",
"lastActive": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}{
"success": true,
"error": {
"code": "CONT-010",
"description": "Contact has requested no further communication"
}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Account to apply operations to
Body
application/json
⌘I