Skip to content

Read the traits a site collects

GET
/v1/id/traits
curl --request GET \
--url https://your-tenant-host/v1/id/traits \
--header 'x-edgekit-site-id: site_example'

Every user-writable, enabled trait this tenant collects, with a list trait’s enabled items and their labels: what a sign-up form and a preferences screen both render. Unauthenticated and edge-cacheable on the same terms as /config: Vary: x-edgekit-site-id, Access-Control-Allow-Origin: *, s-maxage=300, max-age=60. Reads the current trait settings rather than the deployed document, so a new trait appears immediately, not at the next deploy.

x-edgekit-site-id
required

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

string
>= 1 characters <= 128 characters

Example

site_example

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

The traits this tenant collects.

Media typeapplication/json
object
traits
required
Array<object>
object
name
required
string
type
required

Open: accept a member not listed. Known: string, integer, number, boolean, list.

string
label
required
string
required
required
boolean
constraints
required
object
key
additional properties

Example

{
"traits": [
{
"name": "job_industry",
"type": "string",
"label": "Industry",
"required": false,
"constraints": {
"items": [
{
"id": "01926f3a-8b51-7e99-9aaa-8b9c0d1e2f3a",
"label": "Fashion",
"externalId": "IND_FASHION"
}
]
}
}
]
}

Invalid request.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Resource not found.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Request validation failed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Unexpected error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}