A space is a separate Personas environment. Consider the two main reasons you might use spaces:
Get Messaging Subscriptions for space.
• 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
{- "subscriptions": [
- {
- "key": "jacob@exmple.com",
- "type": "EMAIL"
}, - {
- "key": "jane@exmple.com",
- "type": "EMAIL"
}, - {
- "key": "pgibbonsexample.com",
- "type": "EMAIL"
}, - {
- "key": "+12162226233",
- "type": "SMS"
}
]
}
{- "data": {
- "successes": [
- {
- "key": "jacob@exmple.com",
- "type": "EMAIL",
- "status": "SUBSCRIBED",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}, - {
- "key": "jane@exmple.com",
- "type": "EMAIL",
- "status": "SUBSCRIBED",
- "updatedAt": "2006-01-02T15:04:05.000Z",
- "groups": [
- {
- "name": "promotions",
- "id": "grp_id",
- "status": "SUBSCRIBED",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}
]
}, - {
- "key": "2162226233",
- "type": "SMS",
- "status": "DID_NOT_SUBSCRIBE",
- "updatedAt": "2006-01-02T15:04:05.000Z"
}
], - "failures": [
- {
- "key": "pgibbonsexample.com",
- "type": "EMAIL",
- "errors": [
- {
- "code": "INVALID_EMAIL",
- "message": "Email is not valid"
}
]
}
]
}
}
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
}
}
}
Replace Messaging Subscriptions in 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.
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
{- "subscriptions": [
- {
- "key": "jacob@exmple.com",
- "type": "EMAIL",
- "status": "SUBSCRIBED"
}, - {
- "key": "jane@exmple.com",
- "type": "EMAIL",
- "status": "SUBSCRIBED",
- "groups": [
- {
- "name": "promotions",
- "status": "SUBSCRIBED"
}
]
}, - {
- "key": "pgibbonsexample.com",
- "type": "EMAIL",
- "status": "UNSUBSCRIBED"
}, - {
- "key": "+12162226233",
- "type": "SMS",
- "status": "DID_NOT_SUBSCRIBE"
}
]
}
{- "data": {
- "successes": [
- {
- "key": "jacob@exmple.com",
- "type": "EMAIL",
- "status": "SUBSCRIBED"
}, - {
- "key": "jane@exmple.com",
- "type": "EMAIL",
- "status": "SUBSCRIBED",
- "groups": [
- {
- "name": "promotions",
- "status": "SUBSCRIBED",
- "id": "grp_id"
}
]
}, - {
- "key": "2162226233",
- "type": "SMS",
- "status": "DID_NOT_SUBSCRIBE"
}
], - "failures": [
- {
- "key": "pgibbonsexample.com",
- "type": "EMAIL",
- "status": "UNSUBSCRIBED",
- "errors": [
- {
- "code": "INVALID_EMAIL",
- "message": "Email is not valid"
}
]
}
]
}
}