Workspaces

A Workspace is a group of Sources that you administer and Segment bills together. Workspaces help companies manage access for different users and data Sources and let you collaborate with team members, add permissions, and share Sources across your team using a shared billing account.

When you first log in to your Segment account, you can create a new Workspace, or choose to log into an existing Workspace if your account is part of an existing organization.

As the Segment Public API scopes tokens to a Workspace, all operations within the API are also limited to the Workspace to which that token belongs.

Migrate from the Config API

Like the Segment Public API, the Config API has one endpoint to retrieve details about a Workspace. The getWorkspace endpoint returns the following fields:

Config API Public API
create_time Not returned
display_name name
id id
name slug (workspace/ prefix removed)

To migrate, replace any use of the Config API endpoints with the Segment Public API counterparts, using the field mappings in the table above.

Get Workspace

Returns the Workspace associated with the token used to access this resource.

Securitytoken
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/
Request samples
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript'

const api = configureApis('/* Insert your Public API token here */')

try {
  const result = await unwrap(api.workspaces.getWorkspace())
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
{
  • "data": {
    }
}