Space Schema

Operations related to Space Schema

List Entity Paths

Returns a list of Entity Paths for a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
query Parameters
object (PaginationInput)

Pagination params. Defaults to count 200.

This parameter exists in alpha.

Example: pagination=pagination.count=10
search
string (search)

Filter paths by entity name or path name.

This parameter exists in alpha.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/entity-paths
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.spaceSchema.listEntityPaths('spaceId'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Events

Returns a list of Events for a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
query Parameters
object (PaginationInput)

Pagination params. Defaults to count 200.

This parameter exists in alpha.

Example: pagination=pagination.count=10
sortBy
string (sortBy)

Field to sort by. Defaults to 'lastSeenAt'.

This parameter exists in alpha.

Enum: "lastSeenAt" "name"
Example: sortBy=lastSeenAt
sortDir
string (sortDir)

Sort direction. Defaults to 'desc'.

This parameter exists in alpha.

Enum: "asc" "desc"
Example: sortDir=desc
search
string (search)

Filter events by name substring.

This parameter exists in alpha.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/events
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.spaceSchema.listEvents('spaceId'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Properties from Entity

Returns a list of Properties for an Entity in a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

  • Forward-only pagination: this endpoint does not support backward traversal. The pagination.previous field is always absent; use pagination.next to advance through pages.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
entitySlug
required
string [ 1 .. 255 ]
Example: my-entity
query Parameters
object (PaginationInput)

Pagination params. Defaults to count 200.

This parameter exists in alpha.

Example: pagination=pagination.count=10
includeSampleValues
boolean (includeSampleValues)

When true, include sample values for each property. Defaults to false.

This parameter exists in alpha.

samplesCount
number (samplesCount)

Max number of sample values to return per property. Defaults to 20, min 1, max 100.

This parameter exists in alpha.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/entities/{entitySlug}/properties
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.spaceSchema.listPropertiesFromEntity('spaceId', 'my-entity'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Properties from Event

Returns a list of Properties for an Event in a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
eventName
required
string [ 1 .. 255 ]
Example: Order Completed
query Parameters
object (PaginationInput)

Pagination params. Defaults to count 200.

This parameter exists in alpha.

Example: pagination=pagination.count=10
sortBy
string (sortBy)

Field to sort by. Defaults to 'lastSeenAt'.

This parameter exists in alpha.

Enum: "lastSeenAt" "name"
Example: sortBy=name
sortDir
string (sortDir)

Sort direction. Defaults to 'desc'.

This parameter exists in alpha.

Enum: "asc" "desc"
Example: sortDir=asc
search
string (search)

Filter properties by name substring.

This parameter exists in alpha.

includeSampleValues
boolean (includeSampleValues)

When true, include sample values for each property. Defaults to false.

This parameter exists in alpha.

samplesCount
number (samplesCount)

Max number of sample values to return per property. Defaults to 20, min 1, max 100.

This parameter exists in alpha.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/events/{eventName}/properties
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.spaceSchema.listPropertiesFromEvent('spaceId', 'Order Completed'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Sample Values from Entity Property

Returns sample values for an Entity Property in a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
entitySlug
required
string [ 1 .. 255 ]
Example: my-entity
propertyName
required
string [ 1 .. 255 ]
Example: email
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/entities/{entitySlug}/properties/{propertyName}/sample-values
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.spaceSchema.listSampleValuesFromEntityProperty('spaceId', 'my-entity', 'email'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Sample Values from Event Property

Returns sample values for an Event Property in a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
eventName
required
string [ 1 .. 255 ]
Example: Order Completed
propertyName
required
string [ 1 .. 255 ]
Example: revenue
query Parameters
propertyType
required
string (propertyType)

The property type.

This parameter exists in alpha.

Enum: "context" "property"
Example: propertyType=property
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/events/{eventName}/properties/{propertyName}/sample-values
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.spaceSchema.listSampleValuesFromEventProperty('spaceId', 'Order Completed', 'revenue', 'property'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Sample Values from Trait

Returns sample values for a Trait in a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
traitKey
required
string [ 1 .. 255 ]
Example: email
query Parameters
collection
string (collection)

Collection to get trait values for. Defaults to 'users'.

This parameter exists in alpha.

Enum: "accounts" "users"
Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/traits/{traitKey}/sample-values
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.spaceSchema.listSampleValuesFromTrait('spaceId', 'email'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}

List Traits

Returns a list of Traits for a Space.

• This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com.

  • Forward-only pagination: this endpoint does not support backward traversal. The pagination.previous field is always absent; use pagination.next to advance through pages.
  • Deduplication guarantee: when sorting by lastSeenAt, results are fully deduplicated for Spaces with up to 2,500 traits. For Spaces with more than 2,500 traits, duplicate trait entries may appear across pages due to an internal pagination tradeoff. Sorting by trait is not affected.

The rate limit for this endpoint is 25 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.

Securitytoken
Request
path Parameters
spaceId
required
string [ 1 .. 255 ]
Example: spaceId
query Parameters
object (PaginationInput)

Pagination params. Defaults to count 200.

This parameter exists in alpha.

Example: pagination=pagination.count=10
sortBy
string (sortBy)

Field to sort by. Defaults to 'trait'.

This parameter exists in alpha.

Enum: "lastSeenAt" "trait"
Example: sortBy=trait
sortDir
string (sortDir)

Sort direction. Defaults to 'asc'.

This parameter exists in alpha.

Enum: "asc" "desc"
Example: sortDir=asc
search
string (search)

Filter traits by key substring.

This parameter exists in alpha.

collection
string (collection)

Collection to list traits for. Defaults to 'users'.

This parameter exists in alpha.

Enum: "accounts" "users"
includeSampleValues
boolean (includeSampleValues)

When true, include sample values for each trait. Defaults to false.

This parameter exists in alpha.

samplesCount
number (samplesCount)

Max number of sample values to return per trait. Defaults to 20, min 1, max 100.

This parameter exists in alpha.

Responses
200

OK

404

Resource not found

422

Validation failure

429

Too many requests

get/spaces/{spaceId}/traits
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.spaceSchema.listTraits('spaceId'))
  console.log(JSON.stringify(result))
} catch (e) {
  console.log('ERROR:', e)
}
Response samples
application/vnd.segment.v1alpha+json
{
  • "data": {
    }
}