Segment’s access management tools let Workspace owners manage which users can access different parts of their Segment Workspaces.
Adds a list of access permissions to a user.
• 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": "2c0vbJcxowv7x1gyOp45ObHFqoQ",
- "roleName": "Workspace Owner",
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "subjectId": "sgJDWk3K21k6LE3tLU9nRK",
- "subjectType": "user",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE",
- "labels": [ ]
}
]
}
]
}
}
Updates the list of access permissions for a user.
• 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": [ ]
}
]
}
]
}
}
Invites a list of users to join a Workspace.
• When called, this endpoint may generate one or more of the following audit trail events:* Non-Segment User Invited to Workspace
Config API omitted fields:
parent
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.
required | Array of objects (invites) The list of invites. |
Created
Resource not found
Validation failure
Too many requests
{- "invites": [
- {
- "email": "foo@example.com",
- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE"
}
]
}
]
}
]
}
{- "data": {
- "emails": [
- "foo@example.com"
]
}
}
Removes a list of invitations to join a Workspace.
• When called, this endpoint may generate one or more of the following audit trail events:* Invite 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.iamUsers.deleteInvites('emails.0=foo%40example.com')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "status": "SUCCESS"
}
}
Returns a list of invitations to join a Workspace.
Config API omitted fields:
parent
object (PaginationInput) Defines the pagination parameters. 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.iamUsers.listInvites()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "pagination": {
- "current": "MA==",
- "totalEntries": 1
}, - "invites": [
- "foo@example.com"
]
}
}
Removes one or multiple users.
• When called, this endpoint may generate the Group Memberships 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.iamUsers.deleteUsers('userIds.0=dLPzv57d5nRGz8U5iegLKp')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "status": "SUCCESS"
}
}
Returns a list of users with access to the Workspace.
object (PaginationInput) Pagination for users. 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.iamUsers.listUsers()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "users": [
- {
- "id": "i2VTJURQprNfqdwjLFPWYx",
- "name": "Sloth",
- "email": "sloth@segment.com"
}, - {
- "id": "sgJDWk3K21k6LE3tLU9nRK",
- "name": "",
- "email": "papi@segment.com"
}
], - "pagination": {
- "current": "MA==",
- "totalEntries": 2
}
}
}
Returns a user given their id.
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.iamUsers.getUser('sgJDWk3K21k6LE3tLU9nRK')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "user": {
- "id": "sgJDWk3K21k6LE3tLU9nRK",
- "name": "",
- "email": "papi@segment.com",
- "permissions": [
- {
- "roleId": "1WDUuRLxv84rrfCNUwvkrRtkxnS",
- "roleName": "Workspace Owner",
- "resources": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "type": "WORKSPACE",
- "labels": [ ]
}
]
}
]
}
}
}
Returns all groups a user belongs to.
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.iamUsers.listUserGroupsFromUser('sgJDWk3K21k6LE3tLU9nRK')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "groups": [ ],
- "pagination": {
- "current": "MA==",
- "totalEntries": 0
}
}
}