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

# Create a consumer

`POST /v1/realms/{realmId}/consumers`

Create a new consumer in this Realm. It will be available to use for authentication within a few seconds, unless
the consumer's username is blocked in the Gateway. If this is the case, the new consumer will be available in
`negative_ttl` (see the Realm definition) seconds.

## Request body

- ConsumerCreateRequest
  - `username` string, required — The unique username of the Consumer.
  - `custom_id` string — Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database.
  - `consumer_groups` string[] — 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 `201`

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

## Changes

- **2025-10-29** `19e869275e28` — 1 warning
  - added the new `type` enum value to the `allOf[subschema #2]/invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule` response property for the response status `400`
- **2025-08-22** `96118a9cd7f4` — 5 breaking
  - the response property `allOf[subschema #2]/invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterChoiceItem]/source` became nullable for the status `400`
  - the response property `allOf[subschema #2]/invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterDependentItem]/source` became nullable for the status `400`
  - the response property `allOf[subschema #2]/invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterMaximumLength]/source` became nullable for the status `400`
  - the response property `allOf[subschema #2]/invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterMinimumLength]/source` became nullable for the status `400`
  - …1 more
- **2025-06-27** `9f695af25102` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kong/apis/konnect-api/changes/v1/realms/:realmId/consumers/post.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)
