curl --request GET \
--url https://api.affinity.co/v2/teams \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/teams"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.affinity.co/v2/teams', 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.affinity.co/v2/teams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.affinity.co/v2/teams"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.affinity.co/v2/teams")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/teams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyGet metadata on all Teams
| ⚠️ This endpoint is currently in BETA |
|---|
Paginate through all Teams in your organization that you have access to view.
Use the includes query parameter to add membersPreview and accessibleListsPreview to each team. Each preview carries a totalCount and a short data sample; the full collections are available at GET /v2/teams/{teamId}/members and GET /v2/teams/{teamId}/accessible-lists. The team’s privacyType is gated and only returned when the caller has the “Manage Teams” permission, the organization has team-based privacy controls enabled, and cross-team visibility is enabled for the organization; it is omitted from every team in the response otherwise.
You can filter Teams using the filter query parameter:
| Property Name | Description | Type | Allowed Operators | Examples |
|---|---|---|---|---|
id | Filter Teams by id | int64 | = | id=1|id=2 |
name | Filter Teams by name | text | =, =^, =$, =~ | name=^Invest |
curl --request GET \
--url https://api.affinity.co/v2/teams \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/teams"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.affinity.co/v2/teams', 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.affinity.co/v2/teams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.affinity.co/v2/teams"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.affinity.co/v2/teams")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/teams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyAuthorizations
A static Affinity API key, presented as a bearer token.
Query Parameters
Cursor for the next or previous page
"ICAgICAgYmVmb3JlOjo6Nw"
Number of items to include in the page
1 <= x <= 100100
Include total count of the collection in the pagination response
Affinity Filter Language expression. See description for filterable properties.
Sort order. Prefix with - for descending. Defaults to name ascending.
name, -name, createdAt, -createdAt ["name"]
Additional properties to include in the response.
membersPreview, accessibleListsPreview Was this page helpful?