List metrics
curl --request GET \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/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 => [
"Authorization: Bearer <token>"
],
]);
$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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"title": "Daily Active Users",
"ownerId": "user_123456789",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"description": "Number of unique users who performed any action in the last 24 hours",
"unit": "users",
"type": "custom",
"targetValue": 100,
"targetDirection": "up",
"currentValue": 150,
"previousValue": 140,
"periodType": "calendar",
"periodValue": "month",
"timeseries": [
{
"date": "2023-11-07T05:31:56Z",
"value": 85
}
],
"relatedOutcomes": [
"<unknown>"
]
}
]
}{
"error": {
"code": "INVALID_REQUEST",
"description": "One or more fields are invalid",
"fields": [
"title",
"description"
],
"validationErrors": {
"invalidFields": {
"title": {
"type": "too_small",
"message": "Title must be at least 3 characters long",
"path": [
"title"
]
},
"deadline": {
"type": "invalid_date",
"message": "Deadline must be a valid date in the future",
"path": [
"deadline"
]
}
}
}
}
}{
"error": {
"code": "UNAUTHORISED_ERROR",
"description": "User is unauthenticated"
}
}{
"error": {
"code": "UNAUTHORISED_ERROR",
"description": "User is unauthorised"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"description": "An unexpected error occurred on the server"
}
}Metrics
List metrics
Lists metrics for a workspace. Can optionally filter by outcome ID.
GET
/
organisations
/
{orgId}
/
workspaces
/
{workspaceId}
/
metrics
List metrics
curl --request GET \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/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 => [
"Authorization: Bearer <token>"
],
]);
$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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"title": "Daily Active Users",
"ownerId": "user_123456789",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"description": "Number of unique users who performed any action in the last 24 hours",
"unit": "users",
"type": "custom",
"targetValue": 100,
"targetDirection": "up",
"currentValue": 150,
"previousValue": 140,
"periodType": "calendar",
"periodValue": "month",
"timeseries": [
{
"date": "2023-11-07T05:31:56Z",
"value": 85
}
],
"relatedOutcomes": [
"<unknown>"
]
}
]
}{
"error": {
"code": "INVALID_REQUEST",
"description": "One or more fields are invalid",
"fields": [
"title",
"description"
],
"validationErrors": {
"invalidFields": {
"title": {
"type": "too_small",
"message": "Title must be at least 3 characters long",
"path": [
"title"
]
},
"deadline": {
"type": "invalid_date",
"message": "Deadline must be a valid date in the future",
"path": [
"deadline"
]
}
}
}
}
}{
"error": {
"code": "UNAUTHORISED_ERROR",
"description": "User is unauthenticated"
}
}{
"error": {
"code": "UNAUTHORISED_ERROR",
"description": "User is unauthorised"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"description": "An unexpected error occurred on the server"
}
}Authorizations
JWT authentication for organization-scoped endpoints.
Query Parameters
Optional outcome ID to filter metrics by. If omitted, returns all metrics for the workspace.
Response
Success
Response containing an array of metrics
Array of metrics
Show child attributes
Show child attributes
⌘I