Get conversation metrics config
curl --request GET \
--url https://api.coval.dev/v1/organization/conversation-metrics \
--header 'x-api-key: <api-key>'import requests
url = "https://api.coval.dev/v1/organization/conversation-metrics"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.coval.dev/v1/organization/conversation-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://api.coval.dev/v1/organization/conversation-metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.coval.dev/v1/organization/conversation-metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coval.dev/v1/organization/conversation-metrics")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/organization/conversation-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"default_conversation_metrics": [
"8EktrIgaVxn9LfxkIynagX"
],
"conditional_conversation_metrics": [
{
"id": "rule-voice",
"type": "RUN_METADATA",
"metadata_key": "channel",
"metadata_type": "STRING",
"match_type": "EQUALS",
"metadata_value": "voice",
"metric": "8EktrIgaVxn9LfxkIynagX",
"metrics": [
"8EktrIgaVxn9LfxkIynagX"
]
}
]
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication failed",
"details": [
{
"field": "x-api-key",
"description": "API key is required in the x-api-key header"
}
]
}
}{
"error": {
"code": "PERMISSION_DENIED",
"message": "Insufficient permissions",
"details": [
{
"field": "permissions",
"description": "The API key does not include the required organization permission."
}
]
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Organization not found",
"details": [
{
"description": "Organization not found."
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred while processing the organization request"
}
]
}
}Conversations Config
Get conversation metrics config
Return the conversation metrics configuration for the selected workspace: the default metric IDs run on every conversation, plus the conditional rules that add metrics based on run metadata. Each unset workspace field inherits from the organization configuration. If no workspace can be resolved, the organization configuration is returned for compatibility.
GET
/
organization
/
conversation-metrics
Get conversation metrics config
curl --request GET \
--url https://api.coval.dev/v1/organization/conversation-metrics \
--header 'x-api-key: <api-key>'import requests
url = "https://api.coval.dev/v1/organization/conversation-metrics"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.coval.dev/v1/organization/conversation-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://api.coval.dev/v1/organization/conversation-metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.coval.dev/v1/organization/conversation-metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coval.dev/v1/organization/conversation-metrics")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/organization/conversation-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"default_conversation_metrics": [
"8EktrIgaVxn9LfxkIynagX"
],
"conditional_conversation_metrics": [
{
"id": "rule-voice",
"type": "RUN_METADATA",
"metadata_key": "channel",
"metadata_type": "STRING",
"match_type": "EQUALS",
"metadata_value": "voice",
"metric": "8EktrIgaVxn9LfxkIynagX",
"metrics": [
"8EktrIgaVxn9LfxkIynagX"
]
}
]
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication failed",
"details": [
{
"field": "x-api-key",
"description": "API key is required in the x-api-key header"
}
]
}
}{
"error": {
"code": "PERMISSION_DENIED",
"message": "Insufficient permissions",
"details": [
{
"field": "permissions",
"description": "The API key does not include the required organization permission."
}
]
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Organization not found",
"details": [
{
"description": "Organization not found."
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred while processing the organization request"
}
]
}
}Authorizations
API key for authentication
Headers
Workspace whose conversation metrics configuration is read or updated. When omitted, the organization's active default workspace is used when one can be resolved.
Response
Successful response
Was this page helpful?