A User Group is a set of Team Members with a set of shared policies. A Segment Team Member can be a member of one or many Groups. All roles in the Segment App are additive, which means that you can assign group memberships and individual roles to a single team member. For example, a single user can inherit roles from a Group definition AND have access to more resources through individually assigned roles.
Adds a list of access permissions to a user group.
• When called, this endpoint may generate one or more of the following audit trail events:* Policy Created
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
{- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE"
}
]
}
]
}
{- "data": {
- "permissions": [
- {
- "policyId": "2c0vcbHoTzptxMbf7CMQTfNBkPt",
- "roleName": "Workspace Owner",
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "subjectId": "bBABwqbaDf2QdwTbW8bNEm",
- "subjectType": "group",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE",
- "labels": [ ]
}
]
}
]
}
}
Updates the list of access permissions for a user group.
• When called, this endpoint may generate the Policy Deleted
event in the audit trail.
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
{- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE"
}
]
}
]
}
{- "data": {
- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "roleName": "Workspace Owner",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE",
- "labels": [ ]
}
]
}
]
}
}
Adds a list of users or invites to a user group.
• When called, this endpoint may generate one or more of the following audit trail events:* Subjects Added to Group
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
{- "emails": [
- "foo@example.com"
]
}
{- "data": {
- "userGroup": {
- "id": "bBABwqbaDf2QdwTbW8bNEm",
- "name": "PAPI Example Group",
- "memberCount": 1
}
}
}
Returns users belonging to a user group.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.iamGroups.listUsersFromUserGroup('bBABwqbaDf2QdwTbW8bNEm')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "users": [ ],
- "pagination": {
- "current": "MA==",
- "totalEntries": 0
}
}
}
Creates a user group.
• When called, this endpoint may generate one or more of the following audit trail events:* User Group Created
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
{- "name": "New User Group Nbr5tuI40h"
}
{- "data": {
- "userGroup": {
- "id": "2c0vcOBQRrwQrEKEDcJODSE0Znj",
- "name": "New User Group Nbr5tuI40h",
- "memberCount": 0
}
}
}
Returns all user groups.
object (PaginationInput) Pagination for user groups. This parameter exists in v1. Example: pagination=pagination.count=2 |
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.iamGroups.listUserGroups()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "userGroups": [
- {
- "id": "bBABwqbaDf2QdwTbW8bNEm",
- "name": "PAPI Example Group",
- "memberCount": 0,
- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "roleName": "Workspace Owner",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE",
- "labels": [ ]
}
]
}
]
}
], - "pagination": {
- "current": "MA=="
}
}
}
Removes a user group from a Workspace.
• When called, this endpoint may generate the User Group Deleted
event in the audit trail.
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.iamGroups.deleteUserGroup('2c0vZc1kXJ9Nf9wIJ1Gb7JzORGf')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "status": "SUCCESS"
}
}
Returns a user group.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.iamGroups.getUserGroup('bBABwqbaDf2QdwTbW8bNEm')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "userGroup": {
- "id": "bBABwqbaDf2QdwTbW8bNEm",
- "name": "PAPI Example Group",
- "memberCount": 0,
- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "roleName": "Workspace Owner",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE",
- "labels": [ ]
}
]
}
]
}
}
}
Updates a user group for a Workspace.
• When called, this endpoint may generate the User Group Updated
event in the audit trail.
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
{- "name": "PAPI Example Group"
}
{- "data": {
- "userGroup": {
- "id": "bBABwqbaDf2QdwTbW8bNEm",
- "name": "PAPI Example Group",
- "memberCount": 0
}
}
}
Returns the emails of invitees to a user group.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.iamGroups.listInvitesFromUserGroup('bBABwqbaDf2QdwTbW8bNEm')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "emails": [ ],
- "pagination": {
- "current": "MA==",
- "totalEntries": 0
}
}
}
Removes one or multiple users or invites from a user group by email.
• When called, this endpoint may generate one or more of the following audit trail events:* Group Memberships Deleted
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.iamGroups.removeUsersFromUserGroup('bBABwqbaDf2QdwTbW8bNEm', 'emails.0=foo%40example.com')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "status": "SUCCESS"
}
}
Replaces the members of a user group by email.
• When called, this endpoint may generate one or more of the following audit trail events:* Subjects Added to Group
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
{- "emails": [
- "foo@example.com"
]
}
{- "data": {
- "userGroup": {
- "id": "bBABwqbaDf2QdwTbW8bNEm",
- "name": "PAPI Example Group",
- "memberCount": 1
}
}
}