curl --request PUT \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"read": false,
"status": "New",
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"solutionsGeneratingState": "initial",
"createdBy": "user",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"insightIds": [
"<string>"
],
"outcomeIds": [
"<string>"
],
"solutionIds": [
"<string>"
],
"topicIds": [
"<string>"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}"
payload = {
"read": False,
"status": "New",
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"solutionsGeneratingState": "initial",
"createdBy": "user",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"insightIds": ["<string>"],
"outcomeIds": ["<string>"],
"solutionIds": ["<string>"],
"topicIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
read: false,
status: 'New',
title: 'Improve Customer Onboarding Experience',
description: 'Streamline the initial user setup process to reduce drop-offs',
solutionsGeneratingState: 'initial',
createdBy: 'user',
ownerId: 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
insightIds: ['<string>'],
outcomeIds: ['<string>'],
solutionIds: ['<string>'],
topicIds: ['<string>']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}', 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}/opportunities/{opportunityId}",
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([
'read' => false,
'status' => 'New',
'title' => 'Improve Customer Onboarding Experience',
'description' => 'Streamline the initial user setup process to reduce drop-offs',
'solutionsGeneratingState' => 'initial',
'createdBy' => 'user',
'ownerId' => 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
'insightIds' => [
'<string>'
],
'outcomeIds' => [
'<string>'
],
'solutionIds' => [
'<string>'
],
'topicIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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}/opportunities/{opportunityId}"
payload := strings.NewReader("{\n \"read\": false,\n \"status\": \"New\",\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"solutionsGeneratingState\": \"initial\",\n \"createdBy\": \"user\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ],\n \"solutionIds\": [\n \"<string>\"\n ],\n \"topicIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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.put("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"read\": false,\n \"status\": \"New\",\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"solutionsGeneratingState\": \"initial\",\n \"createdBy\": \"user\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ],\n \"solutionIds\": [\n \"<string>\"\n ],\n \"topicIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"read\": false,\n \"status\": \"New\",\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"solutionsGeneratingState\": \"initial\",\n \"createdBy\": \"user\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ],\n \"solutionIds\": [\n \"<string>\"\n ],\n \"topicIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "f5d8df32-60b4-417a-8b83-8d4dcb4e88e1",
"read": false,
"status": "New",
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"solutionsGeneratingState": "initial",
"createdBy": "user",
"hideContent": false,
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"hasUnseenInsights": false,
"solutions": [],
"insights": [],
"outcomes": [],
"topics": [],
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4"
}
}{
"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"
}
}Update opportunity
Updates a specific opportunity by ID
curl --request PUT \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"read": false,
"status": "New",
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"solutionsGeneratingState": "initial",
"createdBy": "user",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"insightIds": [
"<string>"
],
"outcomeIds": [
"<string>"
],
"solutionIds": [
"<string>"
],
"topicIds": [
"<string>"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}"
payload = {
"read": False,
"status": "New",
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"solutionsGeneratingState": "initial",
"createdBy": "user",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"insightIds": ["<string>"],
"outcomeIds": ["<string>"],
"solutionIds": ["<string>"],
"topicIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
read: false,
status: 'New',
title: 'Improve Customer Onboarding Experience',
description: 'Streamline the initial user setup process to reduce drop-offs',
solutionsGeneratingState: 'initial',
createdBy: 'user',
ownerId: 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
insightIds: ['<string>'],
outcomeIds: ['<string>'],
solutionIds: ['<string>'],
topicIds: ['<string>']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}', 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}/opportunities/{opportunityId}",
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([
'read' => false,
'status' => 'New',
'title' => 'Improve Customer Onboarding Experience',
'description' => 'Streamline the initial user setup process to reduce drop-offs',
'solutionsGeneratingState' => 'initial',
'createdBy' => 'user',
'ownerId' => 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
'insightIds' => [
'<string>'
],
'outcomeIds' => [
'<string>'
],
'solutionIds' => [
'<string>'
],
'topicIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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}/opportunities/{opportunityId}"
payload := strings.NewReader("{\n \"read\": false,\n \"status\": \"New\",\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"solutionsGeneratingState\": \"initial\",\n \"createdBy\": \"user\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ],\n \"solutionIds\": [\n \"<string>\"\n ],\n \"topicIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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.put("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"read\": false,\n \"status\": \"New\",\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"solutionsGeneratingState\": \"initial\",\n \"createdBy\": \"user\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ],\n \"solutionIds\": [\n \"<string>\"\n ],\n \"topicIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities/{opportunityId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"read\": false,\n \"status\": \"New\",\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"solutionsGeneratingState\": \"initial\",\n \"createdBy\": \"user\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ],\n \"solutionIds\": [\n \"<string>\"\n ],\n \"topicIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "f5d8df32-60b4-417a-8b83-8d4dcb4e88e1",
"read": false,
"status": "New",
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"solutionsGeneratingState": "initial",
"createdBy": "user",
"hideContent": false,
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"hasUnseenInsights": false,
"solutions": [],
"insights": [],
"outcomes": [],
"topics": [],
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4"
}
}{
"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.
API key authentication for public API endpoints. This key is scoped by workspace so a unique key is required per workspace within an organisation.
Path Parameters
Organization ID
Workspace ID
Opportunity ID
Body
Request schema for updating an opportunity
Whether the opportunity has been read
false
Current status of the opportunity
New, Solved, Planned, InProgress "New"
Title of the opportunity
"Improve Customer Onboarding Experience"
Description of the opportunity
"Streamline the initial user setup process to reduce drop-offs"
Current state of solution generation
generating, generated, initial, error "initial"
How the opportunity was created
user, generated "user"
ID of the opportunity owner
"d4e71c2b-a498-42af-b7f5-69de06a0d7c4"
Response
Opportunity updated successfully
Response containing a single opportunity
Opportunity data
Show child attributes
Show child attributes