---
title: "Update a consumer"
method: PATCH
path: "/v1/realms/{realmId}/consumers/{consumerId}"
tags: ["Centrally Managed Consumers"]
---

# Update a consumer

`PATCH /v1/realms/{realmId}/consumers/{consumerId}`

Update a Consumer's details. Any consumers already cached in a running Gateway will not be affected body the changes to the Realm until `ttl` minutes have passed.

## Request body

- UpdateConsumerPayload
  - `username` string — The unique username of the Consumer.
  - `custom_id` string, nullable — Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database.
  - `consumer_groups` string[], nullable — A list of consumer groups that the Consumer is in. If `consumer_groups` are provided on the Consumer object _and_ on the Realm, the Consumer will be placed in all defined consumer groups.
  - `type` 'proxy' | 'developer' | 'admin' | 'application' — Type of the consumer.
  - `tags` string[]

## Response `200`

success

- CentralizedConsumer — The Consumer object represents a consumer - or a user - of a Service. You can either rely on Kong as the primary datastore, or you can map the consumer list with your database to keep consistency between Kong and your existing primary datastore.
  - `id` string, uuid, required — The Consumer ID.
  - `username` string, required — The unique username of the Consumer. You must send either this field or `custom_id` with the request.
  - `custom_id` string, nullable, required — Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or `username` with the request.
  - `type` 'proxy' | 'developer' | 'admin' | 'application', required — Type of the consumer.
  - `tags` string[], required
  - `consumer_groups` string[], required — A list of consumer groups that the Consumer is in. If `consumer_groups` are provided on the Consumer object _and_ on the Realm, the Consumer will be placed in all defined consumer groups.
  - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time, required — An ISO-8601 timestamp representation of entity update date.

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[API](https://skmtc.net/kong/apis/konnect-api.md) · [All operations](https://skmtc.net/kong/apis/konnect-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api/revisions/06734a9c491f/schema)
