Restore a previous version of a activity property

Search Documentation

Search across all developer documentation

activity-properties

Restore a previous version of a activity property

POST /v1/activity-properties/{id}/versions/{version}/restore
Auth required api.activities.manage

Reinstates a previous definition. A restore is an ordinary edit whose content happens to be old: it snapshots the state it replaces in the same transaction, so nothing is lost, the restore is itself in the history, and restoring the version it created undoes it. That is why this operation is NOT classified destructive, and why a test-environment credential may call it.

It bypasses the optimistic-concurrency check by design — "whatever is there now, make it this" is not a statement about what the caller last read — and it deletes no history.

Classified like any other edit to the registry: it always applies, and a disruptive restore raises the same standing per-segment evaluation warning the equivalent update would.

Path parameters

id string required

The property's UUID, or the dotted activity.property form (for example order.total).

version integer required

The version number, as returned by the versions collection. Version numbers are the handle on every kind here, including the kinds whose dashboard routes address a version by row id.

Responses

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

200 The definition after the restore, and the version the restore created application/json
kind string required
restored integer required

The version number that was reinstated.

current object required

The definition as it now stands, in the shape the kind's own read route returns.

version object required

One row of a definition's history.

Fields of version:

version_number integer required
created_at string<date-time> required

When the snapshot was taken, which is when the edit that REPLACED this state was made — not when this state was authored.

actor object required

Who made one edit. The label is resolved server-side — a person's name, an API key's name, an OAuth client's name — because the name lives in a different table per kind and a client can read none of them. It never carries a key, a token or a client secret; a revoked credential falls back to a short form of its id rather than rendering blank.

Fields of actor:

kind string enum required

unknown is an honest value rather than an error: it is what rows predating actor recording carry, and what a write reached with no credential records.

One of: user, api_key, oauth_client, system, unknown

id string optional

The users / api_keys / oauth_clients id, per kind. Absent for system and unknown.

label string required
session string optional

The HTTP request id of the edit — the same value on the matching audit row, so the two can be joined. It is NOT an MCP session id: the MCP transport is stateless and reads no session header.

content_hash string optional
summary string required

How this version differs from the one before it — +3 −1 lines for a source kind, renamed, type string→number for a schema kind. The oldest row says first recorded version.

current object optional

A promoted activity-property definition — the typed schema a Segment's SendQL predicate references as activity.<activity_name>.<property_name>.

Fields of current:

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
404 Resource not found 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