Update a consumer

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.

patch

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

Body

application/json

UpdateConsumerPayload

* Additional properties are NOT allowed.
usernamestring

The unique username of the Consumer.

>= 1 characters

custom_idstring | null

Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database.

>= 1 characters

consumer_groupsarray | null[string]unique-items

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.

typestring

Type of the consumer.

Allowed values:proxydeveloperadminapplication

Default:proxy

tagsarray[string]unique-items

Response

application/json

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.

* Additional properties are NOT allowed.
idstring(uuid)requiredread-only

The Consumer ID.

Example:b9e81174-b5bb-4638-a3c3-8afe61a0abf8

usernamestring | nullrequired

The unique username of the Consumer. You must send either this field or custom_id with the request.

custom_idstring | nullrequired

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.

typestringrequired

Type of the consumer.

Allowed values:proxydeveloperadminapplication

Default:proxy

tagsarray[string]requiredunique-items
consumer_groupsarray[string]requiredunique-items

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_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity creation date.

Example:2022-11-04T20:10:06.927Z

updated_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity update date.

Example:2022-11-04T20:10:06.927Z

patch/realms/{realmId}/consumers/{consumerId}

Body

{ "username": "Jason" }
 
application/json

Delete a consumer

Delete a consumer. This operation removes the consumer from the system, causing all future authentication
requests using keys associated with that consumer to fail. However, it does not immediately invalidate any
cached keys stored in the gateway’s state. These keys may remain usable until the cache expires, based on the
TTL (Time-To-Live) configured for the realm.

delete

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

Response

success

delete/realms/{realmId}/consumers/{consumerId}
 

Change the realm of a consumer

Change the realm membership of a consumer without changing their credentials.

post

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

Body

application/json

MoveConsumerRequest

target_realm_idstringrequired

Response

application/json

success

RealmReference

realm_idstringrequired
post/realms/{realmId}/consumers/{consumerId}/move

Body

{ "target_realm_id": "77fd4d02-5d87-4f76-90a9-1bd6ce152c36" }
 
application/json

Centrally Managed Keys

Centrally managed consumers use key-auth mechanism to authenticate consumers. Keys refer to the API key credential used by the consumer to authenticate to your services.

List keys

List all the credential keys related to this consumer.
These keys are used by the kay-auth plugin to authenticate the consumer.

get

Query Parameters

page[size]integer

The maximum number of items to include per page. The last page of a collection may include fewer items.

Example:10

page[before]string

Request the next page of data, starting with the item before this parameter.

Example:ewogICJpZCI6ICJoZWxsbyB3b3JsZCIKfQ

page[after]string

Request the next page of data, starting with the item after this parameter.

Example:ewogICJpZCI6ICJoZWxsbyB3b3JsZCIKfQ

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

Response

application/json

success

ListKeys

dataarray[object]required
Show Child Parameters
metaobjectrequired

Pagination metadata.

Show Child Parameters
get/realms/{realmId}/consumers/{consumerId}/keys
 
application/json