Update a Consumer

Create or Update Consumer using ID or username. The consumer will be identified via the username or id attribute.If the consumer with the specified ID or username cannot be found, the endpoint will return a 404.

When the username or id attribute has the structure of a UUID, the Consumer being inserted/replaced will be identified by its id. Otherwise it will be identified by its username.

When creating a new Consumer without specifying id (neither in the URL nor in the body), then it will be auto-generated.

Notice that specifying a username in the URL and a different one in the request body is not allowed.

put

Path Parameters

consumer_idstringrequired

The unique identifier or the username of the Consumer to retrieve.

Example:e94215b0-9198-42ce-bf0b-98afff31b2a7

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Body

application/json

Consumer request body

usernamestringrequired

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

custom_idstringrequired

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.

tagsarray[string]

An optional set of strings associated with the Consumer for grouping and filtering.

Response

application/json

The consumer object response body

dataarray[object]
Show Child Parameters
nextstring

Pagination information

Example:http://localhost:8001/consumers?offset=6378122c-a0a1-438d-a5c6-efabae9fb969

put/runtime-groups/{runtimeGroupId}/core-entities/consumers/{consumer_id}

Body

{ "username": "username", "custom_id": "custom_id" }
 
application/json

consumer-groups

Consumer Groups

List consumer groups

Returns a list of active consumer groups.

get

Query Parameters

offsetstring

Offset from which to return the next set of resources. Use the value of the ‘offset’ field from the response of a list operation as input here to paginate through all the resources

sizeinteger

Number of resources to be returned.

Default:100

>= 1<= 1000

tagsstring

A list of tags to filter the list of resources on. Multiple tags can be concatenated using ‘,’ to mean AND or using ‘/’ to mean OR.

Example:tag1,tag2

Path Parameters

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Response

200

Example response

dataarray[object]
Show Child Parameters
get/runtime-groups/{runtimeGroupId}/core-entities/consumer_groups
 
200

Create a consumer group

Create a consumer group by passing a name and optional tags in the request body.

post

Path Parameters

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Body

application/json

Consumer groups request body

namestringrequired

A unique name for the consumer group you want to create.

Example:Example

tagsarray[string]

An optional set of strings associated with the consumer group for grouping and filtering.

Response

200

Example response

dataarray[object]
Show Child Parameters
post/runtime-groups/{runtimeGroupId}/core-entities/consumer_groups

Body

{ "name": "Example", "tags": [ "string" ] }
 
200

Delete a consumer group

Delete a consumer group. Deleting a consumer group removes all consumers from that group. This operation does not delete existing consuemrs.

delete

Path Parameters

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Response

204

HTTP/1.1 204 No Content

delete/runtime-groups/{runtimeGroupId}/core-entities/consumer_groups
 
204