Workflow and campaign metrics
curl --request POST \
--url https://api2.getsales.io/playtables/v1/api/workflow-records/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": {
"sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"workflow_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"workflow_version_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"people_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"entered_via_source_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"sender_profile_sid": {
"eq": "<string>",
"in": [
"<string>"
],
"is_null": true
},
"current_step_id": {
"eq": 123,
"in": [
123
]
},
"status": {
"in": [],
"nin": []
},
"last_touch_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": true
},
"created_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"deleted_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": true
}
}
}
'import requests
url = "https://api2.getsales.io/playtables/v1/api/workflow-records/metrics"
payload = {
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": {
"sid": {
"eq": "<string>",
"in": ["<string>"]
},
"workflow_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"workflow_version_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"people_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"entered_via_source_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"sender_profile_sid": {
"eq": "<string>",
"in": ["<string>"],
"is_null": True
},
"current_step_id": {
"eq": 123,
"in": [123]
},
"status": {
"in": [],
"nin": []
},
"last_touch_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": True
},
"created_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"deleted_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
period: {from: '<string>', to: '<string>'},
filter: {
sid: {eq: '<string>', in: ['<string>']},
workflow_sid: {eq: '<string>', in: ['<string>']},
workflow_version_sid: {eq: '<string>', in: ['<string>']},
people_sid: {eq: '<string>', in: ['<string>']},
entered_via_source_sid: {eq: '<string>', in: ['<string>']},
sender_profile_sid: {eq: '<string>', in: ['<string>'], is_null: true},
current_step_id: {eq: 123, in: [123]},
status: {in: [], nin: []},
last_touch_at: {gte: '<string>', lte: '<string>', gt: '<string>', lt: '<string>'},
finished_at: {gte: '<string>', lte: '<string>', is_null: true},
created_at: {gte: '<string>', lte: '<string>', gt: '<string>', lt: '<string>'},
deleted_at: {gte: '<string>', lte: '<string>', is_null: true}
}
})
};
fetch('https://api2.getsales.io/playtables/v1/api/workflow-records/metrics', 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://api2.getsales.io/playtables/v1/api/workflow-records/metrics",
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([
'period' => [
'from' => '<string>',
'to' => '<string>'
],
'filter' => [
'sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'workflow_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'workflow_version_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'people_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'entered_via_source_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'sender_profile_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
],
'is_null' => true
],
'current_step_id' => [
'eq' => 123,
'in' => [
123
]
],
'status' => [
'in' => [
],
'nin' => [
]
],
'last_touch_at' => [
'gte' => '<string>',
'lte' => '<string>',
'gt' => '<string>',
'lt' => '<string>'
],
'finished_at' => [
'gte' => '<string>',
'lte' => '<string>',
'is_null' => true
],
'created_at' => [
'gte' => '<string>',
'lte' => '<string>',
'gt' => '<string>',
'lt' => '<string>'
],
'deleted_at' => [
'gte' => '<string>',
'lte' => '<string>',
'is_null' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <api-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://api2.getsales.io/playtables/v1/api/workflow-records/metrics"
payload := strings.NewReader("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_version_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"people_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"entered_via_source_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sender_profile_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ],\n \"is_null\": true\n },\n \"current_step_id\": {\n \"eq\": 123,\n \"in\": [\n 123\n ]\n },\n \"status\": {\n \"in\": [],\n \"nin\": []\n },\n \"last_touch_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"deleted_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
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://api2.getsales.io/playtables/v1/api/workflow-records/metrics")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_version_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"people_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"entered_via_source_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sender_profile_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ],\n \"is_null\": true\n },\n \"current_step_id\": {\n \"eq\": 123,\n \"in\": [\n 123\n ]\n },\n \"status\": {\n \"in\": [],\n \"nin\": []\n },\n \"last_touch_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"deleted_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api2.getsales.io/playtables/v1/api/workflow-records/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_version_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"people_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"entered_via_source_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sender_profile_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ],\n \"is_null\": true\n },\n \"current_step_id\": {\n \"eq\": 123,\n \"in\": [\n 123\n ]\n },\n \"status\": {\n \"in\": [],\n \"nin\": []\n },\n \"last_touch_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"deleted_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "metrics",
"metrics": {
"period": {
"from": "<string>",
"to": "<string>"
},
"aggregated": {
"counts": {
"total_count": 1,
"groups": {
"status": {},
"workflow_sid": {},
"current_step_id": {},
"sender_profile_sid": {},
"entered_via_source_sid": {}
}
},
"metrics": {
"entered_count": 1,
"replied_count": 1,
"completed_count": 1,
"failed_count": 1,
"exited_count": 1,
"completion_rate": 0.5,
"avg_hours_to_complete": 123
}
},
"filter": {},
"groups": [
{
"key": "<string>",
"counts": {
"total_count": 1,
"groups": {
"status": {},
"workflow_sid": {},
"current_step_id": {},
"sender_profile_sid": {},
"entered_via_source_sid": {}
}
},
"metrics": {
"entered_count": 1,
"replied_count": 1,
"completed_count": 1,
"failed_count": 1,
"exited_count": 1,
"completion_rate": 0.5,
"avg_hours_to_complete": 123
}
}
]
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
},
"applied_filters": {}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}workflow_records
Workflow and campaign metrics
How a workflow or campaign is doing, its enrollment and outcome funnel in a period: entered_count (created_at in [from,to)), replied_count (a reply in it), completed/failed/exited counts, completion_rate, avg_hours_to_complete (finished_at clock). group_by one axis (status | workflow_sid | current_step_id | sender_profile_sid | entered_via_source_sid) adds groups[]: workflow_sid is one funnel per workflow; current_step_id needs workflow_sid.eq. created_at operators in filter are ignored.
Contract:
- MCP tool
get_workflow_records_metrics, registry packagemcp.playtables/workflow_records, mountplaytables.workflow-records. - Operation
metrics, response envelopemetrics. - Flags: read only.
POST
/
api
/
workflow-records
/
metrics
Workflow and campaign metrics
curl --request POST \
--url https://api2.getsales.io/playtables/v1/api/workflow-records/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Team-SID: <api-key>' \
--data '
{
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": {
"sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"workflow_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"workflow_version_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"people_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"entered_via_source_sid": {
"eq": "<string>",
"in": [
"<string>"
]
},
"sender_profile_sid": {
"eq": "<string>",
"in": [
"<string>"
],
"is_null": true
},
"current_step_id": {
"eq": 123,
"in": [
123
]
},
"status": {
"in": [],
"nin": []
},
"last_touch_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": true
},
"created_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"deleted_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": true
}
}
}
'import requests
url = "https://api2.getsales.io/playtables/v1/api/workflow-records/metrics"
payload = {
"period": {
"from": "<string>",
"to": "<string>"
},
"filter": {
"sid": {
"eq": "<string>",
"in": ["<string>"]
},
"workflow_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"workflow_version_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"people_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"entered_via_source_sid": {
"eq": "<string>",
"in": ["<string>"]
},
"sender_profile_sid": {
"eq": "<string>",
"in": ["<string>"],
"is_null": True
},
"current_step_id": {
"eq": 123,
"in": [123]
},
"status": {
"in": [],
"nin": []
},
"last_touch_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"finished_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": True
},
"created_at": {
"gte": "<string>",
"lte": "<string>",
"gt": "<string>",
"lt": "<string>"
},
"deleted_at": {
"gte": "<string>",
"lte": "<string>",
"is_null": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Team-SID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
period: {from: '<string>', to: '<string>'},
filter: {
sid: {eq: '<string>', in: ['<string>']},
workflow_sid: {eq: '<string>', in: ['<string>']},
workflow_version_sid: {eq: '<string>', in: ['<string>']},
people_sid: {eq: '<string>', in: ['<string>']},
entered_via_source_sid: {eq: '<string>', in: ['<string>']},
sender_profile_sid: {eq: '<string>', in: ['<string>'], is_null: true},
current_step_id: {eq: 123, in: [123]},
status: {in: [], nin: []},
last_touch_at: {gte: '<string>', lte: '<string>', gt: '<string>', lt: '<string>'},
finished_at: {gte: '<string>', lte: '<string>', is_null: true},
created_at: {gte: '<string>', lte: '<string>', gt: '<string>', lt: '<string>'},
deleted_at: {gte: '<string>', lte: '<string>', is_null: true}
}
})
};
fetch('https://api2.getsales.io/playtables/v1/api/workflow-records/metrics', 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://api2.getsales.io/playtables/v1/api/workflow-records/metrics",
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([
'period' => [
'from' => '<string>',
'to' => '<string>'
],
'filter' => [
'sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'workflow_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'workflow_version_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'people_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'entered_via_source_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
]
],
'sender_profile_sid' => [
'eq' => '<string>',
'in' => [
'<string>'
],
'is_null' => true
],
'current_step_id' => [
'eq' => 123,
'in' => [
123
]
],
'status' => [
'in' => [
],
'nin' => [
]
],
'last_touch_at' => [
'gte' => '<string>',
'lte' => '<string>',
'gt' => '<string>',
'lt' => '<string>'
],
'finished_at' => [
'gte' => '<string>',
'lte' => '<string>',
'is_null' => true
],
'created_at' => [
'gte' => '<string>',
'lte' => '<string>',
'gt' => '<string>',
'lt' => '<string>'
],
'deleted_at' => [
'gte' => '<string>',
'lte' => '<string>',
'is_null' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Team-SID: <api-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://api2.getsales.io/playtables/v1/api/workflow-records/metrics"
payload := strings.NewReader("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_version_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"people_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"entered_via_source_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sender_profile_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ],\n \"is_null\": true\n },\n \"current_step_id\": {\n \"eq\": 123,\n \"in\": [\n 123\n ]\n },\n \"status\": {\n \"in\": [],\n \"nin\": []\n },\n \"last_touch_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"deleted_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
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://api2.getsales.io/playtables/v1/api/workflow-records/metrics")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_version_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"people_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"entered_via_source_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sender_profile_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ],\n \"is_null\": true\n },\n \"current_step_id\": {\n \"eq\": 123,\n \"in\": [\n 123\n ]\n },\n \"status\": {\n \"in\": [],\n \"nin\": []\n },\n \"last_touch_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"deleted_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api2.getsales.io/playtables/v1/api/workflow-records/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"filter\": {\n \"sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"workflow_version_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"people_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"entered_via_source_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ]\n },\n \"sender_profile_sid\": {\n \"eq\": \"<string>\",\n \"in\": [\n \"<string>\"\n ],\n \"is_null\": true\n },\n \"current_step_id\": {\n \"eq\": 123,\n \"in\": [\n 123\n ]\n },\n \"status\": {\n \"in\": [],\n \"nin\": []\n },\n \"last_touch_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"finished_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n },\n \"created_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"gt\": \"<string>\",\n \"lt\": \"<string>\"\n },\n \"deleted_at\": {\n \"gte\": \"<string>\",\n \"lte\": \"<string>\",\n \"is_null\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "metrics",
"metrics": {
"period": {
"from": "<string>",
"to": "<string>"
},
"aggregated": {
"counts": {
"total_count": 1,
"groups": {
"status": {},
"workflow_sid": {},
"current_step_id": {},
"sender_profile_sid": {},
"entered_via_source_sid": {}
}
},
"metrics": {
"entered_count": 1,
"replied_count": 1,
"completed_count": 1,
"failed_count": 1,
"exited_count": 1,
"completion_rate": 0.5,
"avg_hours_to_complete": 123
}
},
"filter": {},
"groups": [
{
"key": "<string>",
"counts": {
"total_count": 1,
"groups": {
"status": {},
"workflow_sid": {},
"current_step_id": {},
"sender_profile_sid": {},
"entered_via_source_sid": {}
}
},
"metrics": {
"entered_count": 1,
"replied_count": 1,
"completed_count": 1,
"failed_count": 1,
"exited_count": 1,
"completion_rate": 0.5,
"avg_hours_to_complete": 123
}
}
]
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
},
"applied_filters": {}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_failed",
"message": "<string>",
"recoverable": true,
"suggestion": "<string>",
"field_errors": {},
"blockers": [
{
"type": "<string>",
"severity": "hard",
"description": "<string>",
"entity_sid": "<string>",
"resolution": "<string>",
"resolution_hint": "<string>",
"count": 123
}
],
"context": {}
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}Authorizations
Body
application/json
Request body of get_workflow_records_metrics.