Add locations to a group
curl --request POST \
--url https://clarus-api.com/api/groups/{group_id}/location_groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "location_groups",
"attributes": {
"group_id": 42,
"location_ids": [
1057,
1058,
1059
]
}
}
}
'import requests
url = "https://clarus-api.com/api/groups/{group_id}/location_groups"
payload = { "data": {
"type": "location_groups",
"attributes": {
"group_id": 42,
"location_ids": [1057, 1058, 1059]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'location_groups',
attributes: {group_id: 42, location_ids: [1057, 1058, 1059]}
}
})
};
fetch('https://clarus-api.com/api/groups/{group_id}/location_groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Groups
Add locations to a group
Add one or more locations to a location group. Provide location_id or location_ids.
POST
/
api
/
groups
/
{group_id}
/
location_groups
Add locations to a group
curl --request POST \
--url https://clarus-api.com/api/groups/{group_id}/location_groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "location_groups",
"attributes": {
"group_id": 42,
"location_ids": [
1057,
1058,
1059
]
}
}
}
'import requests
url = "https://clarus-api.com/api/groups/{group_id}/location_groups"
payload = { "data": {
"type": "location_groups",
"attributes": {
"group_id": 42,
"location_ids": [1057, 1058, 1059]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'location_groups',
attributes: {group_id: 42, location_ids: [1057, 1058, 1059]}
}
})
};
fetch('https://clarus-api.com/api/groups/{group_id}/location_groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "location_groups",
"attributes": {
"group_id": 42,
"location_ids": [1057, 1058, 1059]
}
}
}
| Field | Required | Description |
|---|---|---|
group_id | Yes | The group to add locations to |
location_id | One of | Single location ID |
location_ids | One of | Array of location IDs |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The group ID
Body
application/json
Show child attributes
Show child attributes
Response
Locations added to the group

