Teams API
With Teams api V4 you can:
Notes:
feature_tasks_enabled
is a feature flag used to determine which team have the task management feature enabled. Please, feel free to contact support for more details about the feature and/or if you would like to ask for enabling this feature.
List teams
Fetch a paginated list of team.
GET /api/v4/teams?fields=is_owner_of
[
{
"id": 123,
"contact_tracing_enabled": true,
"form_contact_tracing_enabled": true,
"feature_tasks_enabled": true,
"guests_enabled": true,
"industry": "",
"is_owner_of": true,
"location": "",
"name": "Workers all Safe",
"risk_register_enabled": true,
"sso_required": false,
"sso_team_id": "workers-all-safe",
"user_timeout": null,
"wearables_enabled": true
},
{
"id": 321,
"contact_tracing_enabled": true,
"form_contact_tracing_enabled": true,
"feature_tasks_enabled": true,
"guests_enabled": false,
"industry": null,
"is_owner_of": false,
"location": null,
"name": "Productive and Sound",
"risk_register_enabled": false,
"sso_required": false,
"sso_team_id": "afsdfsdfgsdf",
"user_timeout": null,
"wearables_enabled": false
},
...
]
Fetch a team
Get a team. See the optional available fields.
GET /api/v4/team/123?fields=is_owner_of
{
"id": 123,
"contact_tracing_enabled": true,
"form_contact_tracing_enabled": true,
"feature_tasks_enabled": true,
"guests_enabled": true,
"industry": "",
"is_owner_of": true,
"location": "",
"name": "Workers all Safe",
"risk_register_enabled": true,
"sso_required": false,
"sso_team_id": "workers-all-safe",
"user_timeout": null,
"wearables_enabled": true
}
Create a Team
POST /api/v4/team
{
"team": {
"name": "Great worker in Action",
"industry": "Productivity",
"location": "Americas"
"feature_tasks_enabled": true
}
}
Notes:
- The feature_tasks_enabled in the request payload is optional, and only available to branded app admin, default to true
{
contact_tracing_enabled: false
feature_tasks_enabled: true
form_contact_tracing_enabled: false
guests_enabled: false
id: 456
industry: "Productivity"
location: "Americas"
name: "Great worker in Action"
risk_register_enabled: true
sso_required: false
sso_team_id: "cwx_qqj8sb8"
user_timeout: null
wearables_enabled: false
}
Update a Team
Updates the allowed fields of one single team. Allowed fields:
feature_tasks_enabled
industry
location
mapbox_access_token
mapbox_dataset_id
mapbox_username
name
PATCH /api/v4/teams/123
{
"team": {
"feature_tasks_enabled": true,
"industry": "Safety and protection",
"location": "Global",
"name": "Every Worker Safe",
}
}
204 No Content
Add One or Multiple Users to One or Multiple Team Channels
POST /api/v4/teams/1/add_users_to_team_channels
Params required
{
"users": [
{"user_id":6,"role":"operator","send_email":false},
{"user_id":54,"role":"operator","send_email":false}
],
"channels": [
{"name":"Team channel","id":4,"isSelected":true},
{"name":"Team channel 2","id":5,"isSelected":true}
]
}
Response
{
"teams": [
[
{
"object": {
"user_id": 6,
"role": "operator",
"send_email": false
},
"http_status": 200,
"status": "success",
"errors": {}
},
{
"object": {
"user_id": 54,
"role": "operator",
"send_email": false
},
"http_status": 201,
"status": "success",
"errors": {}
}
],
[
{
"object": {
"user_id": 6,
"role": "operator",
"send_email": false
},
"http_status": 200,
"status": "success",
"errors": {}
},
{
"object": {
"user_id": 54,
"role": "operator",
"send_email": false
},
"http_status": 201,
"status": "success",
"errors": {}
}
]
]
}
Available fields
You can use the fields parameter in any of the Teams API methods. The requested method will respond with the required fields accordingly. Some fields are included by default but you can opt-out from them on request.
- id
- contact_tracing_enabled
- form_contact_tracing_enabled
- feature_tasks_enabled
- guests_enabled
- industry
- is_admin_of
- is_manager_of
- is_owner_of
- location
- mapbox_access_token
- mapbox_dataset_id
- mapbox_username
- name
- owner_id
- risk_register_enabled
- sso_required?
- sso_team_id
- training_enabled
- user_timeout
- wearables_enabled