Skip to content

Change a referral reward

PATCH
/api/v1/newsletter/referrals/milestones/{id}
curl --request PATCH \
--url https://digize.com/api/v1/newsletter/referrals/milestones/example \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "referrals": 1, "name": "example", "description": "example", "kind": "promo_code", "codes": [ "example" ], "downloadUrl": "example", "active": true }'

Changes a milestone; what’s left out stays. codes replaces the codes left to hand out, and those who earned it while it had none get one. active: false stops it being earned.

Needs the newsletter:write permission.

id
required
string
>= 1 characters <= 64 characters
Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
referrals
integer
>= 1 <= 10000
name
string
>= 1 characters <= 80 characters
description
string
<= 500 characters
kind
string
Allowed values: promo_code download physical
codes
Array<string>
<= 5000 items
downloadUrl
Any of:
string
<= 2000 characters
active
boolean

Done

Media typeapplication/json
object
id
required
string
referrals
required

Referrals that earn it.

number
name
required
string
description
required
string
kind
required
string
Allowed values: promo_code download physical
codesLeft
required

Promo codes left to hand out.

number
downloadUrl
required
string | null
active
required
boolean
earned
required
number
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Example

{
"kind": "promo_code"
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}