Create new opportunity
curl --request POST \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"createdBy": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"solutionIds": [
"<string>"
],
"insightIds": [
"<string>"
],
"outcomeIds": [
"<string>"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities"
payload = {
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"createdBy": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"solutionIds": ["<string>"],
"insightIds": ["<string>"],
"outcomeIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Improve Customer Onboarding Experience',
description: 'Streamline the initial user setup process to reduce drop-offs',
createdBy: 'user',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerId: 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
solutionIds: ['<string>'],
insightIds: ['<string>'],
outcomeIds: ['<string>']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities', 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",
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([
'title' => 'Improve Customer Onboarding Experience',
'description' => 'Streamline the initial user setup process to reduce drop-offs',
'createdBy' => 'user',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerId' => 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
'solutionIds' => [
'<string>'
],
'insightIds' => [
'<string>'
],
'outcomeIds' => [
'<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"
payload := strings.NewReader("{\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"createdBy\": \"user\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"solutionIds\": [\n \"<string>\"\n ],\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"createdBy\": \"user\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"solutionIds\": [\n \"<string>\"\n ],\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"createdBy\": \"user\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"solutionIds\": [\n \"<string>\"\n ],\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\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": "TOO_MANY_REQUESTS",
"description": "Rate limit exceeded"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"description": "An unexpected error occurred on the server"
}
}Opportunities
Create new opportunity
Creates a new opportunity in the specified workspace
POST
/
organisations
/
{orgId}
/
workspaces
/
{workspaceId}
/
opportunities
Create new opportunity
curl --request POST \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"createdBy": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"solutionIds": [
"<string>"
],
"insightIds": [
"<string>"
],
"outcomeIds": [
"<string>"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities"
payload = {
"title": "Improve Customer Onboarding Experience",
"description": "Streamline the initial user setup process to reduce drop-offs",
"createdBy": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "d4e71c2b-a498-42af-b7f5-69de06a0d7c4",
"solutionIds": ["<string>"],
"insightIds": ["<string>"],
"outcomeIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Improve Customer Onboarding Experience',
description: 'Streamline the initial user setup process to reduce drop-offs',
createdBy: 'user',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerId: 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
solutionIds: ['<string>'],
insightIds: ['<string>'],
outcomeIds: ['<string>']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities', 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",
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([
'title' => 'Improve Customer Onboarding Experience',
'description' => 'Streamline the initial user setup process to reduce drop-offs',
'createdBy' => 'user',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerId' => 'd4e71c2b-a498-42af-b7f5-69de06a0d7c4',
'solutionIds' => [
'<string>'
],
'insightIds' => [
'<string>'
],
'outcomeIds' => [
'<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"
payload := strings.NewReader("{\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"createdBy\": \"user\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"solutionIds\": [\n \"<string>\"\n ],\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"createdBy\": \"user\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"solutionIds\": [\n \"<string>\"\n ],\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/opportunities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Improve Customer Onboarding Experience\",\n \"description\": \"Streamline the initial user setup process to reduce drop-offs\",\n \"createdBy\": \"user\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"d4e71c2b-a498-42af-b7f5-69de06a0d7c4\",\n \"solutionIds\": [\n \"<string>\"\n ],\n \"insightIds\": [\n \"<string>\"\n ],\n \"outcomeIds\": [\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": "TOO_MANY_REQUESTS",
"description": "Rate limit exceeded"
}
}{
"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.
Body
application/json
Request schema for creating an opportunity
Title of the opportunity
Example:
"Improve Customer Onboarding Experience"
Description of the opportunity
Example:
"Streamline the initial user setup process to reduce drop-offs"
How the opportunity was created
Available options:
user, generated Example:
"user"
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$ID of the opportunity owner
Example:
"d4e71c2b-a498-42af-b7f5-69de06a0d7c4"
Response
Opportunity created successfully
Response containing a single opportunity
Opportunity data
Show child attributes
Show child attributes
⌘I