Adds a new property or events for a given group group
curl --request POST \
--url https://api.frigade.com/v1/public/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"name": "Acme Inc.",
"companyUrl": "https://example.com",
"logoUrl": "https://example.com/logo.jpg"
},
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
]
}
'import requests
url = "https://api.frigade.com/v1/public/groups"
payload = {
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"name": "Acme Inc.",
"companyUrl": "https://example.com",
"logoUrl": "https://example.com/logo.jpg"
},
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groupId: 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
userId: 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
properties: {
name: 'Acme Inc.',
companyUrl: 'https://example.com',
logoUrl: 'https://example.com/logo.jpg'
},
events: [
{
event: 'SignedUp',
properties: {source: 'landing-page', campaign: 'summer-sale'}
}
]
})
};
fetch('https://api.frigade.com/v1/public/groups', 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.frigade.com/v1/public/groups",
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([
'groupId' => 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
'userId' => 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
'properties' => [
'name' => 'Acme Inc.',
'companyUrl' => 'https://example.com',
'logoUrl' => 'https://example.com/logo.jpg'
],
'events' => [
[
'event' => 'SignedUp',
'properties' => [
'source' => 'landing-page',
'campaign' => 'summer-sale'
]
]
]
]),
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.frigade.com/v1/public/groups"
payload := strings.NewReader("{\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"name\": \"Acme Inc.\",\n \"companyUrl\": \"https://example.com\",\n \"logoUrl\": \"https://example.com/logo.jpg\"\n },\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.frigade.com/v1/public/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"name\": \"Acme Inc.\",\n \"companyUrl\": \"https://example.com\",\n \"logoUrl\": \"https://example.com/logo.jpg\"\n },\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.frigade.com/v1/public/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"name\": \"Acme Inc.\",\n \"companyUrl\": \"https://example.com\",\n \"logoUrl\": \"https://example.com/logo.jpg\"\n },\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyGroups
Create a Group
POST
/
v1
/
public
/
groups
Adds a new property or events for a given group group
curl --request POST \
--url https://api.frigade.com/v1/public/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"name": "Acme Inc.",
"companyUrl": "https://example.com",
"logoUrl": "https://example.com/logo.jpg"
},
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
]
}
'import requests
url = "https://api.frigade.com/v1/public/groups"
payload = {
"groupId": "x34daa11-3745-4ac0-880e-d4b4d51fe13f",
"userId": "d34daa11-3745-4ac0-880e-d4b4d51fe13f",
"properties": {
"name": "Acme Inc.",
"companyUrl": "https://example.com",
"logoUrl": "https://example.com/logo.jpg"
},
"events": [
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groupId: 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
userId: 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
properties: {
name: 'Acme Inc.',
companyUrl: 'https://example.com',
logoUrl: 'https://example.com/logo.jpg'
},
events: [
{
event: 'SignedUp',
properties: {source: 'landing-page', campaign: 'summer-sale'}
}
]
})
};
fetch('https://api.frigade.com/v1/public/groups', 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.frigade.com/v1/public/groups",
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([
'groupId' => 'x34daa11-3745-4ac0-880e-d4b4d51fe13f',
'userId' => 'd34daa11-3745-4ac0-880e-d4b4d51fe13f',
'properties' => [
'name' => 'Acme Inc.',
'companyUrl' => 'https://example.com',
'logoUrl' => 'https://example.com/logo.jpg'
],
'events' => [
[
'event' => 'SignedUp',
'properties' => [
'source' => 'landing-page',
'campaign' => 'summer-sale'
]
]
]
]),
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.frigade.com/v1/public/groups"
payload := strings.NewReader("{\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"name\": \"Acme Inc.\",\n \"companyUrl\": \"https://example.com\",\n \"logoUrl\": \"https://example.com/logo.jpg\"\n },\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.frigade.com/v1/public/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"name\": \"Acme Inc.\",\n \"companyUrl\": \"https://example.com\",\n \"logoUrl\": \"https://example.com/logo.jpg\"\n },\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.frigade.com/v1/public/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"groupId\": \"x34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"userId\": \"d34daa11-3745-4ac0-880e-d4b4d51fe13f\",\n \"properties\": {\n \"name\": \"Acme Inc.\",\n \"companyUrl\": \"https://example.com\",\n \"logoUrl\": \"https://example.com/logo.jpg\"\n },\n \"events\": [\n {\n \"event\": \"SignedUp\",\n \"properties\": {\n \"source\": \"landing-page\",\n \"campaign\": \"summer-sale\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyThis endpoint allows you to upsert new or existing Groups. If the group already exists, it will be updated with the new data.
Any property left unchanged will not be modified. Changes to tracking events are append-only.
Authorizations
Authentication header of the form Bearer: <token>, where <token> is either your public or private API key. See when to use which
Body
application/json
The ID of the group as defined in your own application
Example:
"x34daa11-3745-4ac0-880e-d4b4d51fe13f"
The ID of the user as defined in your own application
Example:
"d34daa11-3745-4ac0-880e-d4b4d51fe13f"
Optional properties to add to the group
Example:
{
"name": "Acme Inc.",
"companyUrl": "https://example.com",
"logoUrl": "https://example.com/logo.jpg"
}
Optional tracking events to add to the group
Show child attributes
Show child attributes
Example:
[
{
"event": "SignedUp",
"properties": {
"source": "landing-page",
"campaign": "summer-sale"
}
}
]
Response
201
The group has been successfully created or updated
⌘I