A space is a separate Personas environment. Consider the two main reasons you might use spaces:
Returns the Space by id.
• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.
• In order to successfully call this endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out to your customer success manager 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.spaces.getSpace('9aQ1Lj62S4bomZKLF4DPqW')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "space": {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "name": "Default Space Papi E2E",
- "slug": "default-space-papi-e2e"
}
}
}List Spaces.
• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.
• In order to successfully call this endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out to your customer success manager for more information.
object (PaginationInput) Pagination params This parameter exists in alpha. Example: pagination=pagination.count=200 |
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.spaces.listSpaces()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "spaces": [
- {
- "id": "9aQ1Lj62S4bomZKLF4DPqW",
- "name": "Default Space Papi E2E",
- "slug": "default-space-papi-e2e"
}
], - "pagination": {
- "current": "MA==",
- "totalEntries": 1
}
}
}