Groups and labels
Add contacts to a group
Adds contacts to one of the calling user’s groups and returns the group with its full contact list. Contacts already in the group are kept. Send existing contact ids in group.contact_ids; ids that are not the caller’s contacts are ignored. A rep can instead send group.contacts to match contacts by phone number or create them. Returns 400 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.
PUT
/
api
/
groups
/
{group_id}
/
add_contacts
Add contacts to a group
curl --request PUT \
--url https://api.fluid.app/api/groups/{group_id}/add_contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"group": {
"contact_ids": [
61861
]
}
}
'import requests
url = "https://api.fluid.app/api/groups/{group_id}/add_contacts"
payload = { "group": { "contact_ids": [61861] } }
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({group: {contact_ids: [61861]}})
};
fetch('https://api.fluid.app/api/groups/{group_id}/add_contacts', 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/{group_id}/add_contacts",
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([
'group' => [
'contact_ids' => [
61861
]
]
]),
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/{group_id}/add_contacts"
payload := strings.NewReader("{\n \"group\": {\n \"contact_ids\": [\n 61861\n ]\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.fluid.app/api/groups/{group_id}/add_contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"group\": {\n \"contact_ids\": [\n 61861\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/groups/{group_id}/add_contacts")
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 \"group\": {\n \"contact_ids\": [\n 61861\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 7343,
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contacts": [
{
"id": 61861,
"token": "Rk8dV3nP6wQ2hT9mC4xB7jLs",
"first_name": "Robert",
"last_name": "California",
"avatar_url": null,
"status": "new",
"email": "robert.california@dundermifflin.com",
"email2": null,
"phone": "+15705550163",
"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": "Robert California",
"discarded_at": null
}
],
"activities": []
}{
"message": "<string>"
}Response
Success
A contact group owned by a user, with its contacts.
⌘I
Add contacts to a group
curl --request PUT \
--url https://api.fluid.app/api/groups/{group_id}/add_contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"group": {
"contact_ids": [
61861
]
}
}
'import requests
url = "https://api.fluid.app/api/groups/{group_id}/add_contacts"
payload = { "group": { "contact_ids": [61861] } }
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({group: {contact_ids: [61861]}})
};
fetch('https://api.fluid.app/api/groups/{group_id}/add_contacts', 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/{group_id}/add_contacts",
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([
'group' => [
'contact_ids' => [
61861
]
]
]),
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/{group_id}/add_contacts"
payload := strings.NewReader("{\n \"group\": {\n \"contact_ids\": [\n 61861\n ]\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.fluid.app/api/groups/{group_id}/add_contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"group\": {\n \"contact_ids\": [\n 61861\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/groups/{group_id}/add_contacts")
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 \"group\": {\n \"contact_ids\": [\n 61861\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 7343,
"name": "Scranton Business Park",
"avatar": "📎",
"avatar_background": "#E5F5FF",
"contacts": [
{
"id": 61861,
"token": "Rk8dV3nP6wQ2hT9mC4xB7jLs",
"first_name": "Robert",
"last_name": "California",
"avatar_url": null,
"status": "new",
"email": "robert.california@dundermifflin.com",
"email2": null,
"phone": "+15705550163",
"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": "Robert California",
"discarded_at": null
}
],
"activities": []
}{
"message": "<string>"
}