For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

Update survey

このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。

Updates metadata, targeting, and content variants. For published surveys,
changes apply to a draft until publish in the UI. latest_version is
required and must match the current draft, otherwise the update returns
409. The check runs before the write rather than atomically with it, so it
reduces but does not fully prevent lost updates from concurrent writers.
Publish, schedule, and test instrumentation are not
available via API in v1. Status fields on the response are derived read-only.
When variants is sent, it must list every existing variant by id with
its unchanged variant key; steps within a variant can be added, edited,
reordered, or removed. tags is not writable in v1 and returns 400.

patch/v1/projects/{project_id}/surveys/{survey_id}

Authorizations

Authorizationstringrequired

http

Path parameters

project_idstringrequired

Amplitude project identifier, backed by the canonical app ID.

Example:12345
Constraints:pattern: ^[0-9]+$
survey_idstringrequired

Survey nudge identifier.

Constraints:pattern: ^[0-9]+$

Header parameters

Idempotency-Keystringrequired

Required on write operations. Keys aren't stored yet, so retrying a write with the same key performs it again; a retried create makes another resource. Check whether the first attempt succeeded before you retry.

Constraints:min length: 8max length: 255

Body

application/json
titlestring
Constraints:min length: 1
descriptionstring
Constraints:nullable
platformstring

Target platform. Guides and surveys without an explicit platform are returned as web.

Allowed values:webiosandroidreact-nativedesktopflutter
priorityinteger
Constraints:min: 1max: 4
trigger_configobject

Trigger configuration object.

lifecycleobject

Lifecycle rules object.

snooze_durationobject

Snooze duration configuration.

snooze_labelstring
Constraints:nullable
template_sourcestring
Constraints:nullable
step_counter_formatstring
Constraints:nullable
variantsobject[]
Show child attributes
idstring
variantstringrequired

Variant key within the nudge.

display_titlestring
Constraints:nullable
display_descriptionstring
Constraints:nullable
snooze_labelstring
Constraints:nullable
done_labelstring
Constraints:nullable
stepsobject[]
idstring
titlestring
Constraints:nullable
form_factorobject

Layout object for a step. type selects the form factor; additional keys are layout-specific.

typestringrequired

Step presentation layout. Required layout keys and allowed values differ by form factor.

Allowed values:bannercardchecklistmodalpinpopovertooltip
contentunknown

Step body content (structure varies by form factor).

sort_keyinteger
Constraints:nullable
latest_versionintegerrequired

Expected latest_version from the last GET with include_unpublished_changes=true.

Other properties8
page_target_segmentsunknown[]
temporarily_hide_page_target_segmentsunknown[]
hide_if_page_targeting_not_metboolean
dismissibleboolean
snoozableboolean
snoozable_on_all_stepsboolean
show_step_counterboolean
tagsstring[]

Response

application/json
200· Survey updated.
dataobjectrequired
Show child attributes
idstringrequired

Numeric nudge identifier.

Constraints:pattern: ^[0-9]+$
objectstringrequired
project_idstringrequired
Constraints:pattern: ^[0-9]+$
typestringrequired
platformstringrequired

Target platform. Guides and surveys without an explicit platform are returned as web.

Allowed values:webiosandroidreact-nativedesktopflutter
titlestringrequired
Constraints:nullable
descriptionstring
Constraints:nullable
is_archivedbooleanrequired
priorityintegerrequired

Trigger precedence (4 = urgent, 1 = low).

Constraints:min: 1max: 4
statusstringrequired

Derived rollout state. Read-only on API responses.

Allowed values:draftpublishedtestingscheduledscheduled-activescheduled-inactiveexperiment-runningexperiment-inactivearchived
status_descriptionstringrequired
keystringrequired

Feature flag key that controls delivery. Matches the [Guides-Surveys] Key property on SDK-tracked guide and survey events, so use it to join events to this guide or survey.

Constraints:nullable
start_atstringrequired

Scheduled start of the live flag. null when no start is scheduled.

Constraints:format: date-timenullable
end_atstringrequired

Scheduled end of the live flag. null when no end is scheduled.

Constraints:format: date-timenullable
urlstringrequired

Admin URL for the guide or survey.

Constraints:format: uri
page_target_segmentsunknown[]

Page URL targeting rules. Empty means globally eligible.

tagsstring[]
created_bystring
Constraints:nullable
last_modified_bystring
Constraints:nullable
created_atstringrequired
Constraints:format: date-timenullable
updated_atstringrequired
Constraints:format: date-timenullable
latest_versionintegerrequired

Monotonic version for optimistic concurrency. Send the value from the latest GET on PATCH; a stale value returns 409.

temporarily_hide_page_target_segmentsunknown[]
hide_if_page_targeting_not_metboolean
trigger_configunknown

When and how the nudge triggers.

lifecycleunknown

Frequency and display lifecycle rules.

dismissibleboolean
snoozableboolean
snoozable_on_all_stepsboolean
snooze_durationunknown

Snooze duration configuration.

snooze_labelstring
Constraints:nullable
template_sourcestring
Constraints:nullable
show_step_counterboolean
step_counter_formatstring
Constraints:nullable
theme_idstring

Theme applied to this guide or survey. null means the project's default theme for the platform. Fetch it with the Themes API.

Constraints:nullablepattern: ^[0-9]+$
variantsobject[]
idstringrequired
variantstringrequired

Variant key within the nudge.

display_titlestring
Constraints:nullable
display_descriptionstring
Constraints:nullable
snooze_labelstring
Constraints:nullable
done_labelstring
Constraints:nullable
stepsobject[]
idstringrequired
titlestring
Constraints:nullable
form_factorobject

Layout object for a step. type selects the form factor; additional keys are layout-specific.

typestringrequired

Step presentation layout. Required layout keys and allowed values differ by form factor.

Allowed values:bannercardchecklistmodalpinpopovertooltip
contentunknown

Step body content (structure varies by form factor).

content_v2object

Block-builder layout: a tree of layout containers whose children are containers or content blocks, including the step's title block. Present only on steps built in the block builder. When present, the dashboard and SDK render this tree, not title and content. Not accepted on create or update.

sort_keyinteger
Constraints:nullable
experiment_variantsobject[]

Read-only experiment variant keys when the nudge is experiment-backed.

keystringrequired
namestring
Constraints:nullable
descriptionstring
Constraints:nullable
payloadunknown

Optional JSON payload associated with the experiment variant.

flag_configoneOf

The Experiment feature flag that delivers this nudge, in the same shape as the Feature Flags API. Includes audience targeting (target_segments) and rollout. With include_unpublished_changes=true, draft rollout and targeting settings are applied over the live flag.

Constraints:objectnull
idstring
project_idstring
Constraints:pattern: ^[0-9]+$
keystring
namestring
descriptionstring
Constraints:nullable
deploymentsstring[]

Deployment IDs associated with this flag. Managed via the create/update deployment fields, not set directly on this field.

enabledboolean
evaluation_modestring
Allowed values:localremote
variantsobject[]
keystringrequired

Stable variant key. The value off is reserved.

Constraints:pattern: ^[A-Za-z0-9_-]+$
namestring
Constraints:nullable
descriptionstring
Constraints:nullable
payloadunknown

Optional JSON payload returned by evaluation.

bucketing_keystring

Bucketing key used for assignment. Never null in responses; defaults to amplitude_id when not explicitly set.

bucketing_saltstring
Constraints:nullable
bucketing_unitstring
Constraints:nullable
rollout_percentageinteger
Constraints:min: 0max: 100
rollout_weightsobject

Variant-keyed rollout weights. Values may be normalized to sum to 100 (percentages) or expressed as unnormalized relative weights (for example { "control": 1, "treatment": 1 } for an even split). Weights are non-negative and may be fractional.

target_segmentsobject[]
namestring
Constraints:nullable
conditionsobject[]required
group_typestring
Constraints:nullable
propstringrequired

Property name or cohort identifier being targeted.

Constraints:min length: 1
prop_typestring

Namespace of the targeted property, for example user, event, or group. Omitted for conditions that target a cohort rather than a property.

Constraints:nullable
opstringrequired

Targeting operator applied to the property values.

Allowed values:isis notcontainsdoes not containlessless or equalgreatergreater or equalset isset is notset containsset does not containglob matchglob does not match
typestringrequired

Condition type, for example property or cohort.

valuesstring[]required

At least one value to match against. Conditions with no values are rejected.

percentageinteger

Segment rollout percentage.

Constraints:nullablemin: 0max: 100
rollout_weightsobject

Variant-keyed rollout weights. Values may be normalized to sum to 100 (percentages) or expressed as unnormalized relative weights (for example { "control": 1, "treatment": 1 } for an even split). Weights are non-negative and may be fractional.

bucketing_keystring
Constraints:nullable
testersobject[]
variant_keystringrequired
valuesstring[]required

User IDs, device IDs, or cohort identifiers included in this variant. At most 2000 entries per variant (the limit is 10 when the entries are cohort identifiers).

ownersstring[]
tagsstring[]
created_bystring
Constraints:nullable
last_modified_bystring
Constraints:nullable
created_atstring
Constraints:format: date-timenullable
updated_atstring
Constraints:format: date-timenullable
parent_dependenciesobject
operatorstringrequired
Allowed values:allany
flagsobject[]required
flag_idstringrequired
allowed_variantsstring[]
linksobject[]
urlstringrequired
Constraints:format: uri
titlestringrequired
versioninteger

Server-managed config version used for optimistic concurrency.

archivedboolean

Whether the resource is archived. Set via the archive (DELETE) operation.

urlstring
Constraints:format: urinullable
objectstring

Resource-type discriminator. Always feature_flag.

これは役に立ちましたか?