Promote a custom-activity property

Search Documentation

Search across all developer documentation

activity-properties

Promote a custom-activity property

POST /v1/activity-properties
Auth required api.activities.manage

Promotes a custom-activity property into the evaluable registry — registering (activity_name, property_name) → type so a Segment's SendQL predicate can reference it as activity.<activity>.<property>. enum_values is required when type is enum and rejected otherwise. An invalid name or type, or exceeding the per-activity promoted-property cap, returns 422 validation_failed.

A built-in property returns 409 conflict: the six page properties carried by every site_* activity (path, referrer, title, utm_source, utm_medium, utm_campaign) are already evaluable everywhere, so there is nothing to promote and a second definition could disagree about the type.

Request body

Content type: application/json

activity_name string required

The custom activity whose property to promote; a lowercase identifier.

property_name string required

The property key to promote; a lowercase identifier.

type string enum required

One of: string, number, bool, datetime, enum

enum_values array<string> optional

Required when type is enum; must be empty/omitted otherwise.

description string optional

Responses

Errors follow the RFC 7807 problem format — see the error reference.

201 The promoted activity-property definition application/json
id string<uuid> required
activity_name string required

The custom activity whose property this promotes; a lowercase identifier.

property_name string required

The property key inside the activity's properties; a lowercase identifier.

type string enum required

One of: string, number, bool, datetime, enum

enum_values array<string> optional

Allowed values when type is enum; omitted otherwise.

description string required
created_at string<date-time> required
updated_at string<date-time> required
401 Missing, malformed, or unknown API key application/problem+json
403 Key lacks the required scope or plan limit violated application/problem+json
409 The mutation is rejected by a state rule rather than a bad request. The code is conflict. application/problem+json
422 A query parameter, path value or body field failed validation. The body is a validation_failed Problem. When the refusal is about a reference — a segment key, template slug, topic or attribute name the organization does not have — it additionally carries validation_code, field, line/column, missing, candidates and next_step, so a client can correct the call without a second round of guessing. See ValidationProblem. application/problem+json
429 Per-org rate limit exceeded application/problem+json
500 Unexpected server-side failure. The code is internal_error. The request_id field can be quoted to SendOps support to investigate. application/problem+json