Teams
Agent teams.
1
GET List Teams
GET https://api.greenbubble.io/api/teams
cURL
curl -X GET 'https://api.greenbubble.io/api/teams' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
2
GET Team Permissions
GET https://api.greenbubble.io/api/teams/permissions
cURL
curl -X GET 'https://api.greenbubble.io/api/teams/permissions' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams/permissions', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams/permissions"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams/permissions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
3
GET Get Team
GET https://api.greenbubble.io/api/teams/TEAM_ID
cURL
curl -X GET 'https://api.greenbubble.io/api/teams/TEAM_ID' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams/TEAM_ID', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams/TEAM_ID"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams/TEAM_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
4
POST Create Team
POST https://api.greenbubble.io/api/teams/create
cURL
curl -X POST 'https://api.greenbubble.io/api/teams/create' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name":"Sales Team","members":[]}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams/create', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Sales Team",
"members": []
})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams/create"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"name": "Sales Team",
"members": []
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams/create');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"Sales Team","members":[]}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
5
PUT Update Team
PUT https://api.greenbubble.io/api/teams/TEAM_ID
cURL
curl -X PUT 'https://api.greenbubble.io/api/teams/TEAM_ID' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams/TEAM_ID', {
method: 'PUT',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams/TEAM_ID"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.put(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams/TEAM_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
6
DELETE Delete Team
DELETE https://api.greenbubble.io/api/teams/delete
cURL
curl -X DELETE 'https://api.greenbubble.io/api/teams/delete' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"ids":["TEAM_ID"]}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams/delete', {
method: 'DELETE',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"TEAM_ID"
]
})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams/delete"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"ids": [
"TEAM_ID"
]
}
response = requests.delete(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams/delete');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"ids":["TEAM_ID"]}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
7
PATCH Toggle Team Status
PATCH https://api.greenbubble.io/api/teams/TEAM_ID/toggle-status
cURL
curl -X PATCH 'https://api.greenbubble.io/api/teams/TEAM_ID/toggle-status' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/teams/TEAM_ID/toggle-status', {
method: 'PATCH',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/teams/TEAM_ID/toggle-status"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.patch(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/teams/TEAM_ID/toggle-status');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;