Skip to content
POST /group-mapping

Create a new group mapping that grants a role and environment access to members of a SCIM group.

Request Body

environment_idsstring[]

Environment IDs that members of the mapped group are granted access to. Each item must be an environment ID string; a nested array or any other value is a 400.

rolestring

The role granted to members of the mapped SCIM group.

Example: member
Possible values:
adminmember
scim_group_idstring · uuid

The ID of the SCIM group this mapping applies to.

Example: 9c2b104d-74a6-47f2-b93e-c6b611e82391
team_idstring · uuid

The ID of the team this mapping belongs to.

Example: 05daecaf-4365-42e8-8370-8127de5dd717

Response Body

created_atstring · date-time

The date and time when the group mapping was created.

Example: 2021-08-10T10:00:00.000Z
environment_idsstring[]

Environment IDs that members of the mapped group are granted access to.

idstring · uuid

The ID of the group mapping.

Example: 1ba1f401-7183-47c5-9e39-e8e257e3c795
rolestring

The role granted to members of the mapped SCIM group. Null leaves the role unchanged.

Example: member
Possible values:
adminmember
scim_group_idstring · uuid

The ID of the SCIM group this mapping applies to.

Example: 9c2b104d-74a6-47f2-b93e-c6b611e82391
team_idstring · uuid

The ID of the team that owns this group mapping.

Example: 05daecaf-4365-42e8-8370-8127de5dd717
updated_atstring · date-time

The date and time when the group mapping was last updated.

Example: 2021-08-10T10:30:00.000Z

Errors

StatusDescription
400Bad request if required fields are missing, or if scim_group_id is not a SCIM group of the team
403Forbidden if the user is not an admin of the specified team. API tokens are never team admins, so they always get 403.
409Conflict if no admin who can sign in would be left in the team after the change (the members of the mapping's group are recomputed without what it gave them). Nothing is changed; make another member an admin first.
curl -X POST 'https://api.truto.one/group-mapping' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
  "scim_group_id": "9c2b104d-74a6-47f2-b93e-c6b611e82391",
  "role": "member",
  "environment_ids": []
}'
const body = {
  "team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
  "scim_group_id": "9c2b104d-74a6-47f2-b93e-c6b611e82391",
  "role": "member",
  "environment_ids": []
};

const response = await fetch('https://api.truto.one/group-mapping', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.truto.one/group-mapping"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
    "scim_group_id": "9c2b104d-74a6-47f2-b93e-c6b611e82391",
    "role": "member",
    "environment_ids": []
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())