Change a conversion goalMenu

Change a conversion goal

PATCH/v1/conversion-goals/{id}

Requires an API key with the conversion-goals:write scope. About keys and scopes

Works with integration, agent and partner keys.

Safe to retry: a repeat sets the same values again. About idempotency

Changes the attribution window, value property or currency for events processed from now on; conversions already counted keep their attribution and value, and are not counted again under the new window. Changing the window sets windowChangedAt, so a reader can tell the all-time totals mix both. Clearing valueProperty clears currency too. The event and its filter cannot change: create another goal.

Path parameters

idstringrequired

The conversion goal's id.

uuid

Header parameters

Kirora-Workspacestringoptional

Partner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.

pattern ^[A-Za-z0-9._:-]{1,128}$

Request body

attributionWindowDurationInputoptional

How long after a message the event still counts: 1 to 3,650 whole days.

2 child attributes
valueintegerrequired

min > 0

unitstringrequired

one of seconds, minutes, hours, days

valuePropertystring | nulloptional

1–64 characters

currencystring | nulloptional

pattern ^[A-Z]{3}$

Returns

Returns 200 OK with a ConversionGoal in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.

  • 200 OKThe goal as changed.
  • 409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.
  • 413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).
  • 415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
idstringrequired

uuid

campaignIdstring | nullrequired

The campaign it measures.

uuid

journeyIdstring | nullrequired

The journey it measures.

uuid

eventNamestringrequired

The event that counts as a conversion.

whereobject[] | nullrequired

Property conditions the event must meet; null counts every one.

at least 1 item · at most 5 items

3 child attributes
propertystringrequired

The event property key.

1–64 characters

operatorstringrequired

notEquals also matches an event without the property. equals and notEquals compare the property as text, ignoring case and accents.

one of equals, notEquals, gt, gte, lt, lte

valuestringrequired

What to compare with, as text ("pro", "true"); a number ("50") for gt, gte, lt and lte.

up to 255 characters

occurrencestring | nullrequired

first: only the contact's first event of this name; repeat: any after it; null: every one.

one of first, repeat

attributionWindowDurationrequired

How long after a message the event still counts, in days.

2 child attributes
valueintegerrequired

min > 0

unitstringrequired

one of seconds, minutes, hours, days

windowChangedAtstring | nullrequired

When the attribution window was last changed; null if never. A change applies to events processed after it: conversions counted before keep the window they were counted under.

date-time

valuePropertystring | nullrequired

The event property summed as revenue; null counts no value.

currencystring | nullrequired

The revenue's currency, if named.

countedFromstringrequired

The earliest events the goal can count: when it was created, the start of the event history then retained. Events from then on are matched to the sends before them, those tracked before the goal existed included; older ones are gone.

date-time

createdAtstringrequired

date-time