# Change a reward. Rewards already taken keep what they were

`PUT /loyalty/rewards/{id}` · Rivier · contacts

Change a reward. Rewards already taken keep what they were.

- Scope: contacts:admin
- Sdk: contacts.loyalty.updateReward
- Cli: contacts loyalty update reward

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "description": {
      "type": "string",
      "maxLength": 400,
      "default": ""
    },
    "costPoints": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000000
    },
    "kind": {
      "type": "string",
      "enum": [
        "percent",
        "fixed",
        "free_shipping",
        "gift"
      ]
    },
    "percentBp": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000
        },
        {
          "type": "null"
        }
      ]
    },
    "amountMinor": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000000
        },
        {
          "type": "null"
        }
      ]
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z]{3}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "minSubtotalMinor": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000000,
      "default": 0
    },
    "validDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365,
      "default": 60
    },
    "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000,
      "default": 0
    }
  },
  "required": [
    "name",
    "costPoints",
    "kind"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/loyalty/rewards/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "costPoints": 0,
  "kind": "percent"
}'
```
