---
title: "Update a consumer"
method: PUT
path: "/apiops/projects/{projectName}/consumers/{consumerKey}"
tags: ["Consumer"]
---

# Update a consumer

`PUT /apiops/projects/{projectName}/consumers/{consumerKey}`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/consumers/{consumerKey}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/consumers/:consumerKey/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates the consumer and redeploys it. A field the body omits (null) keeps its stored value; send an empty list or an empty string to clear one; send "expireDate": null to remove the expiry. A consumer a live identity source manages cannot be edited (400); actions/enable and actions/disable still apply. username and consumerKey cannot change (400 immutableField). The password changes only through actions/change-password and the organization only through actions/transfer-organization. metadata, when sent, replaces the stored list; secret values are write-only, so a secret entry sent without a value is stored empty — send the value to keep it.

## Path parameters

- `projectName` string, required
- `consumerKey` string, required

## Request body

- ApiOpsConsumerWriteDTO
  - `consumerKey` string
  - `username` string
  - `password` string
  - `fullName` string
  - `email` string
  - `description` string
  - `enabled` boolean
  - `ipList` string[]
  - `expireDate` string, date-time
  - `roleNameList` string[]
  - `metadata` CredentialMetadataDTO[]
    - `key` string
    - `value` string
    - `secret` boolean
    - `includeInJwt` boolean
    - `includeInTokenResponse` boolean
    - `jwtClaimName` string
  - `trafficLogDisabled` boolean
  - `organizationCode` string

## Response `200`

OK

- ApiOpsMutationResponseApiOpsResponseConsumer
  - `status` 'SUCCESS' | 'FAILURE'
  - `resourceVersion` integer
  - `runtimeDeployment` ApiOpsRuntimeDeploymentDTO
    - `state` 'IN_SYNC' | 'DEGRADED'
    - `environments` Environment[]
      - `name` string
      - `acknowledged` boolean
      - `detail` string
  - `result` ApiOpsResponseConsumer
    - `consumerKey` string
    - `username` string
    - `fullName` string
    - `email` string
    - `description` string
    - `enabled` boolean
    - `organizationCode` string
    - `expireDate` string, date-time
    - `trafficLogDisabled` boolean
    - `ipList` string[]
    - `roleNames` string[]
    - `metadata` CredentialMetadataDTO[]
      - `key` string
      - `value` string
      - `secret` boolean
      - `includeInJwt` boolean
      - `includeInTokenResponse` boolean
      - `jwtClaimName` string

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
