Update a goal
curl --request PUT \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Increase User Engagement",
"description": "We aim to increase daily active users by 25% in Q3",
"priority": 1,
"trend": 0,
"analyticEvents": [
"event1",
"event2"
],
"ownerId": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"opportunityIds": [
"<string>"
],
"metricIds": [
"<string>"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}"
payload = {
"title": "Increase User Engagement",
"description": "We aim to increase daily active users by 25% in Q3",
"priority": 1,
"trend": 0,
"analyticEvents": ["event1", "event2"],
"ownerId": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"opportunityIds": ["<string>"],
"metricIds": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Increase User Engagement',
description: 'We aim to increase daily active users by 25% in Q3',
priority: 1,
trend: 0,
analyticEvents: ['event1', 'event2'],
ownerId: '7b9e5d2c-f314-48a9-be56-9843a2f6c019',
opportunityIds: ['<string>'],
metricIds: ['<string>']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}', 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}/outcomes/{outcomeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Increase User Engagement',
'description' => 'We aim to increase daily active users by 25% in Q3',
'priority' => 1,
'trend' => 0,
'analyticEvents' => [
'event1',
'event2'
],
'ownerId' => '7b9e5d2c-f314-48a9-be56-9843a2f6c019',
'opportunityIds' => [
'<string>'
],
'metricIds' => [
'<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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}"
payload := strings.NewReader("{\n \"title\": \"Increase User Engagement\",\n \"description\": \"We aim to increase daily active users by 25% in Q3\",\n \"priority\": 1,\n \"trend\": 0,\n \"analyticEvents\": [\n \"event1\",\n \"event2\"\n ],\n \"ownerId\": \"7b9e5d2c-f314-48a9-be56-9843a2f6c019\",\n \"opportunityIds\": [\n \"<string>\"\n ],\n \"metricIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Increase User Engagement\",\n \"description\": \"We aim to increase daily active users by 25% in Q3\",\n \"priority\": 1,\n \"trend\": 0,\n \"analyticEvents\": [\n \"event1\",\n \"event2\"\n ],\n \"ownerId\": \"7b9e5d2c-f314-48a9-be56-9843a2f6c019\",\n \"opportunityIds\": [\n \"<string>\"\n ],\n \"metricIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Increase User Engagement\",\n \"description\": \"We aim to increase daily active users by 25% in Q3\",\n \"priority\": 1,\n \"trend\": 0,\n \"analyticEvents\": [\n \"event1\",\n \"event2\"\n ],\n \"ownerId\": \"7b9e5d2c-f314-48a9-be56-9843a2f6c019\",\n \"opportunityIds\": [\n \"<string>\"\n ],\n \"metricIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"title": "Increase User Engagement",
"description": "We aim to increase daily active users by 25% in Q3",
"priority": 1,
"hideContent": false,
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"opportunities": [],
"solutions": [],
"insights": [],
"metrics": [],
"trend": 0,
"analyticEvents": [
"event1",
"event2"
],
"ownerId": "7b9e5d2c-f314-48a9-be56-9843a2f6c019"
}
}{
"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": "NOT_FOUND",
"description": "The requested resource was not found"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"description": "An unexpected error occurred on the server"
}
}Goals
Update a goal
Update an existing goal by its ID
PUT
/
organisations
/
{orgId}
/
workspaces
/
{workspaceId}
/
outcomes
/
{outcomeId}
Update a goal
curl --request PUT \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Increase User Engagement",
"description": "We aim to increase daily active users by 25% in Q3",
"priority": 1,
"trend": 0,
"analyticEvents": [
"event1",
"event2"
],
"ownerId": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"opportunityIds": [
"<string>"
],
"metricIds": [
"<string>"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}"
payload = {
"title": "Increase User Engagement",
"description": "We aim to increase daily active users by 25% in Q3",
"priority": 1,
"trend": 0,
"analyticEvents": ["event1", "event2"],
"ownerId": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"opportunityIds": ["<string>"],
"metricIds": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Increase User Engagement',
description: 'We aim to increase daily active users by 25% in Q3',
priority: 1,
trend: 0,
analyticEvents: ['event1', 'event2'],
ownerId: '7b9e5d2c-f314-48a9-be56-9843a2f6c019',
opportunityIds: ['<string>'],
metricIds: ['<string>']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}', 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}/outcomes/{outcomeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Increase User Engagement',
'description' => 'We aim to increase daily active users by 25% in Q3',
'priority' => 1,
'trend' => 0,
'analyticEvents' => [
'event1',
'event2'
],
'ownerId' => '7b9e5d2c-f314-48a9-be56-9843a2f6c019',
'opportunityIds' => [
'<string>'
],
'metricIds' => [
'<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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}"
payload := strings.NewReader("{\n \"title\": \"Increase User Engagement\",\n \"description\": \"We aim to increase daily active users by 25% in Q3\",\n \"priority\": 1,\n \"trend\": 0,\n \"analyticEvents\": [\n \"event1\",\n \"event2\"\n ],\n \"ownerId\": \"7b9e5d2c-f314-48a9-be56-9843a2f6c019\",\n \"opportunityIds\": [\n \"<string>\"\n ],\n \"metricIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Increase User Engagement\",\n \"description\": \"We aim to increase daily active users by 25% in Q3\",\n \"priority\": 1,\n \"trend\": 0,\n \"analyticEvents\": [\n \"event1\",\n \"event2\"\n ],\n \"ownerId\": \"7b9e5d2c-f314-48a9-be56-9843a2f6c019\",\n \"opportunityIds\": [\n \"<string>\"\n ],\n \"metricIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Increase User Engagement\",\n \"description\": \"We aim to increase daily active users by 25% in Q3\",\n \"priority\": 1,\n \"trend\": 0,\n \"analyticEvents\": [\n \"event1\",\n \"event2\"\n ],\n \"ownerId\": \"7b9e5d2c-f314-48a9-be56-9843a2f6c019\",\n \"opportunityIds\": [\n \"<string>\"\n ],\n \"metricIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "7b9e5d2c-f314-48a9-be56-9843a2f6c019",
"title": "Increase User Engagement",
"description": "We aim to increase daily active users by 25% in Q3",
"priority": 1,
"hideContent": false,
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"opportunities": [],
"solutions": [],
"insights": [],
"metrics": [],
"trend": 0,
"analyticEvents": [
"event1",
"event2"
],
"ownerId": "7b9e5d2c-f314-48a9-be56-9843a2f6c019"
}
}{
"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": "NOT_FOUND",
"description": "The requested resource was not found"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"description": "An unexpected error occurred on the server"
}
}Authorizations
JWT authentication for organization-scoped endpoints.
Path Parameters
Organization ID
Workspace ID
Outcome ID
Body
application/json
Request schema for updating an outcome
Title of the outcome
Example:
"Increase User Engagement"
Detailed description of the outcome
Example:
"We aim to increase daily active users by 25% in Q3"
Priority level of the outcome
Example:
1
Trend indicator for the outcome
Example:
0
List of analytic events associated with the outcome
Example:
["event1", "event2"]
ID of the owner of the outcome
Example:
"7b9e5d2c-f314-48a9-be56-9843a2f6c019"
Response
Success
Response containing a single outcome
Outcome with relationships
Show child attributes
Show child attributes
⌘I