Groups and labels
Create a group
Creates a contact group owned by the calling user and returns it with its contacts. name is required. Add existing contacts with group.contact_ids; ids that are not the caller’s contacts are ignored. A rep can instead send group.contacts, and each entry is matched to one of the rep’s contacts by phone number or created as a new contact. avatar defaults to an emoji and avatar_background to #f0f0f0. Returns 400 with the validation errors when the group cannot be saved. Requires a company admin or rep Bearer token; admin users, company API tokens, and partner tokens also need the users update permission.
POST
/
api
/
groups
Create a group
curl --request POST \
--url https://api.fluid.app/api/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"group": {
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contact_ids": [
61840,
61852
]
}
}
'import requests
url = "https://api.fluid.app/api/groups"
payload = { "group": {
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contact_ids": [61840, 61852]
} }
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({
group: {
name: 'Scranton Business Park',
avatar: '📎',
avatar_background: '#E5F5FF',
contact_ids: [61840, 61852]
}
})
};
fetch('https://api.fluid.app/api/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.fluid.app/api/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([
'group' => [
'name' => 'Scranton Business Park',
'avatar' => '📎',
'avatar_background' => '#E5F5FF',
'contact_ids' => [
61840,
61852
]
]
]),
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.fluid.app/api/groups"
payload := strings.NewReader("{\n \"group\": {\n \"name\": \"Scranton Business Park\",\n \"avatar\": \"📎\",\n \"avatar_background\": \"#E5F5FF\",\n \"contact_ids\": [\n 61840,\n 61852\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.fluid.app/api/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"group\": {\n \"name\": \"Scranton Business Park\",\n \"avatar\": \"📎\",\n \"avatar_background\": \"#E5F5FF\",\n \"contact_ids\": [\n 61840,\n 61852\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/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 \"group\": {\n \"name\": \"Scranton Business Park\",\n \"avatar\": \"📎\",\n \"avatar_background\": \"#E5F5FF\",\n \"contact_ids\": [\n 61840,\n 61852\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 7343,
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contacts": [
{
"id": 61840,
"token": "pX7rQ2mK9vT4wN8bH3cJ6dLf",
"first_name": "Holly",
"last_name": "Flax",
"avatar_url": null,
"status": "new",
"email": "holly.flax@dundermifflin.com",
"email2": null,
"phone": "+15705550142",
"phone2": null,
"phone_id": null,
"address": "412 Keystone Road",
"address2": "Apt 3",
"city": "Scranton",
"state": "PA",
"postal_code": "18505",
"language_id": null,
"country_id": null,
"lead_type": null,
"ip": null,
"requested_at": null,
"best_time": null,
"time_zone": "America/New_York",
"reason": null,
"income": null,
"hours": null,
"invest": null,
"interest": null,
"full_name": "Holly Flax",
"discarded_at": null
},
{
"id": 61852,
"token": "Tz4hN7qW2cR8mB5kX9vJ3pLd",
"first_name": "Jan",
"last_name": "Levinson",
"avatar_url": null,
"status": "new",
"email": "jan.levinson@dundermifflin.com",
"email2": null,
"phone": "+15705550187",
"phone2": null,
"phone_id": null,
"address": "1725 Slough Avenue",
"address2": null,
"city": "Scranton",
"state": "PA",
"postal_code": "18505",
"language_id": null,
"country_id": null,
"lead_type": null,
"ip": null,
"requested_at": null,
"best_time": null,
"time_zone": "America/New_York",
"reason": null,
"income": null,
"hours": null,
"invest": null,
"interest": null,
"full_name": "Jan Levinson",
"discarded_at": null
}
],
"activities": []
}{
"message": "<string>"
}Response
Created
A contact group owned by a user, with its contacts.
⌘I
Create a group
curl --request POST \
--url https://api.fluid.app/api/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"group": {
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contact_ids": [
61840,
61852
]
}
}
'import requests
url = "https://api.fluid.app/api/groups"
payload = { "group": {
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contact_ids": [61840, 61852]
} }
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({
group: {
name: 'Scranton Business Park',
avatar: '📎',
avatar_background: '#E5F5FF',
contact_ids: [61840, 61852]
}
})
};
fetch('https://api.fluid.app/api/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.fluid.app/api/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([
'group' => [
'name' => 'Scranton Business Park',
'avatar' => '📎',
'avatar_background' => '#E5F5FF',
'contact_ids' => [
61840,
61852
]
]
]),
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.fluid.app/api/groups"
payload := strings.NewReader("{\n \"group\": {\n \"name\": \"Scranton Business Park\",\n \"avatar\": \"📎\",\n \"avatar_background\": \"#E5F5FF\",\n \"contact_ids\": [\n 61840,\n 61852\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.fluid.app/api/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"group\": {\n \"name\": \"Scranton Business Park\",\n \"avatar\": \"📎\",\n \"avatar_background\": \"#E5F5FF\",\n \"contact_ids\": [\n 61840,\n 61852\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/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 \"group\": {\n \"name\": \"Scranton Business Park\",\n \"avatar\": \"📎\",\n \"avatar_background\": \"#E5F5FF\",\n \"contact_ids\": [\n 61840,\n 61852\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 7343,
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contacts": [
{
"id": 61840,
"token": "pX7rQ2mK9vT4wN8bH3cJ6dLf",
"first_name": "Holly",
"last_name": "Flax",
"avatar_url": null,
"status": "new",
"email": "holly.flax@dundermifflin.com",
"email2": null,
"phone": "+15705550142",
"phone2": null,
"phone_id": null,
"address": "412 Keystone Road",
"address2": "Apt 3",
"city": "Scranton",
"state": "PA",
"postal_code": "18505",
"language_id": null,
"country_id": null,
"lead_type": null,
"ip": null,
"requested_at": null,
"best_time": null,
"time_zone": "America/New_York",
"reason": null,
"income": null,
"hours": null,
"invest": null,
"interest": null,
"full_name": "Holly Flax",
"discarded_at": null
},
{
"id": 61852,
"token": "Tz4hN7qW2cR8mB5kX9vJ3pLd",
"first_name": "Jan",
"last_name": "Levinson",
"avatar_url": null,
"status": "new",
"email": "jan.levinson@dundermifflin.com",
"email2": null,
"phone": "+15705550187",
"phone2": null,
"phone_id": null,
"address": "1725 Slough Avenue",
"address2": null,
"city": "Scranton",
"state": "PA",
"postal_code": "18505",
"language_id": null,
"country_id": null,
"lead_type": null,
"ip": null,
"requested_at": null,
"best_time": null,
"time_zone": "America/New_York",
"reason": null,
"income": null,
"hours": null,
"invest": null,
"interest": null,
"full_name": "Jan Levinson",
"discarded_at": null
}
],
"activities": []
}{
"message": "<string>"
}