---
title: "Upsert a Consumer"
method: PUT
path: "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}"
tags: ["Consumers"]
---

# Upsert a Consumer

`PUT /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}`

Create or Update Consumer using ID or username.

## Request body

- Consumer — 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.
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `custom_id` string, nullable — 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.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `tags` string[], nullable — An optional set of strings associated with the Consumer for grouping and filtering.
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.
  - `username` string, nullable — The unique username of the Consumer. You must send either this field or `custom_id` with the request.

## Response `200`

Successfully upserted Consumer

- Consumer — 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.
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `custom_id` string, nullable — 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.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `tags` string[], nullable — An optional set of strings associated with the Consumer for grouping and filtering.
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.
  - `username` string, nullable — The unique username of the Consumer. You must send either this field or `custom_id` with the request.

## Other responses

- `401` — Unauthorized

## Changes

- **2025-07-22** `2c77aeaee5fb` — 1 breaking, 1 info
  - the response property `tags` became nullable for the status `200`
  - the request property `tags` became nullable
- **2025-04-15** `fc6abbc537f3` — 2 breaking, 6 info
  - the response property `created_at` became nullable for the status `200`
  - the response property `updated_at` became nullable for the status `200`
  - the request optional property `created_at` became not read-only
  - the request optional property `updated_at` became not read-only
  - …4 more
- **2024-12-06** `426663331655` — 1 breaking
  - the request property `tags` became not nullable
- **2024-11-11** `08ead66e9ebb` — 4 breaking, 6 info
  - the response property `custom_id` became nullable for the status `200`
  - the response property `id` became nullable for the status `200`
  - the response property `tags` became nullable for the status `200`
  - the response property `username` became nullable for the status `200`
  - …6 more

[Change history](https://skmtc.dev/kong/apis/konnect-api/changes/v2/control-planes/:controlPlaneId/core-entities/consumers/:ConsumerId/put.md)

---

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