younifyd
Menu

Update Achievement

Update achievement

PUT/v1/applications/{applicationId}/campaigns/{campaignId}/achievements/{achievementId}

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Update Achievement action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{updateAchievement.response.data}}.

Request

Path parameters

applicationIdinteger (int64)required

The ID of the Application. It is displayed in your Talon.One deployment URL.

campaignIdinteger (int64)required

The ID of the campaign. It is displayed in your Talon.One deployment URL.

achievementIdinteger (int64)required

The ID of the achievement. You can get this ID with the [List achievement](https://docs.talon.one/management-api#tag/Achievements/operation/listAchievements) endpoint.

Request body

Enter the body as JSON in the step's Body field.

namestring

The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created.

titlestring

The display name for the achievement in the Campaign Manager.

descriptionstring (string)

A description of the achievement.

targetnumber

The required number of actions or the transactional milestone to complete the achievement.

periodstring

The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period.

periodEndOverrideobject

The absolute duration after which the achievement ends and resets for a particular customer profile. **Note**: The duration follows the time zone of the Application this achievement belongs to.

monthinteger (int64)

The achievement ends and resets in this month. **Note**: Only applicable if the period is set to `Y`.

dayOfMonthinteger (int64)

The achievement ends and resets on this day of the month. **Note**: Only applicable if the period is set to `Y` or `M`.

dayOfWeekinteger (int64)

The achievement ends and resets on this day of the week. `1` represents `Monday` and `7` represents `Sunday`. **Note**: Only applicable if the period is set to `W`.

hourinteger (int64)required

The achievement ends and resets at this hour.

minuteinteger (int64)required

The achievement ends and resets at this minute.

secondinteger (int64)required

The achievement ends and resets at this second.

recurrencePolicystring

The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again.

One ofno_recurrenceon_expirationon_completion

activationPolicystring

The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule.

One ofuser_actionfixed_schedule

fixedStartDatestring (date-time)

The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string.

endDatestring (date-time)

The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string.

allowRollbackAfterCompletionboolean

When `true`, customer progress can be rolled back in completed achievements.

json
{
  "name": "Order50Discount",
  "title": "50% off on 50th purchase.",
  "description": "50% off for every 50th purchase in a year.",
  "target": 50,
  "period": "1Y",
  "periodEndOverride": {
    "month": 11,
    "dayOfMonth": 23,
    "hour": 23,
    "minute": 59,
    "second": 59
  },
  "recurrencePolicy": "no_recurrence",
  "activationPolicy": "fixed_schedule",
  "fixedStartDate": "2025-01-01T00:00:00Z",
  "endDate": "2025-01-01T00:00:00Z",
  "allowRollbackAfterCompletion": false
}

Response

Returns 200 with an object. Read it in later steps with {{updateAchievement.response.data.<field>}}.

idinteger (int64)

The internal ID of this entity.

createdstring (date-time)

The time this entity was created.

namestring

The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created.

titlestring

The display name for the achievement in the Campaign Manager.

descriptionstring (string)

A description of the achievement.

targetnumber

The required number of actions or the transactional milestone to complete the achievement.

periodstring

The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period.

periodEndOverrideobject

The absolute duration after which the achievement ends and resets for a particular customer profile. **Note**: The duration follows the time zone of the Application this achievement belongs to.

monthinteger (int64)

The achievement ends and resets in this month. **Note**: Only applicable if the period is set to `Y`.

dayOfMonthinteger (int64)

The achievement ends and resets on this day of the month. **Note**: Only applicable if the period is set to `Y` or `M`.

dayOfWeekinteger (int64)

The achievement ends and resets on this day of the week. `1` represents `Monday` and `7` represents `Sunday`. **Note**: Only applicable if the period is set to `W`.

hourinteger (int64)required

The achievement ends and resets at this hour.

minuteinteger (int64)required

The achievement ends and resets at this minute.

secondinteger (int64)required

The achievement ends and resets at this second.

recurrencePolicystring

The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again.

One ofno_recurrenceon_expirationon_completion

activationPolicystring

The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule.

One ofuser_actionfixed_schedule

fixedStartDatestring (date-time)

The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string.

endDatestring (date-time)

The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string.

allowRollbackAfterCompletionboolean

When `true`, customer progress can be rolled back in completed achievements.

campaignIdinteger (int64)

The ID of the campaign the achievement belongs to.

userIdinteger (int64)

ID of the user that created this achievement.

createdBystring

Name of the user that created the achievement. **Note**: This is not available if the user has been deleted.

hasProgressboolean

Indicates if a customer has made progress in the achievement.

statusstring

The status of the achievement.

One ofinprogressexpirednot_startedcompleted

json
{
  "id": 6,
  "created": {},
  "name": "Order50Discount",
  "title": "50% off on 50th purchase.",
  "description": "50% off for every 50th purchase in a year.",
  "target": 50,
  "campaignId": 1,
  "userId": 1234,
  "period": "1Y",
  "periodEndOverride": {
    "month": 11,
    "dayOfMonth": 23,
    "hour": 23,
    "minute": 59,
    "second": 59
  },
  "recurrencePolicy": "no_recurrence",
  "activationPolicy": "fixed_schedule"
}

Need more? See the Talon.One guide for connection setup and behaviour shared by every action.