---
title: "Upsert a Basic-auth credential associated with a Consumer"
method: PUT
path: "/{workspace}/consumers/{ConsumerIdForNestedEntities}/basic-auth/{BasicAuthId}"
tags: ["Basic-auth credentials"]
---

# Upsert a Basic-auth credential associated with a Consumer

`PUT /{workspace}/consumers/{ConsumerIdForNestedEntities}/basic-auth/{BasicAuthId}`

Create or Update a Basic-auth credential associated with a Consumer using ID.

## Path parameters

- `ConsumerIdForNestedEntities` string, required
- `BasicAuthId` string, required
- `workspace` string, required

## Request body

- BasicAuthWithoutParents
  - `consumer` object, nullable
    - `id` string
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `password` string, required
  - `tags` string[], nullable — A set of strings representing tags.
  - `username` string, required

## Response `200`

Successfully upserted Basic-auth credential

- BasicAuth
  - `consumer` object, nullable
    - `id` string
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `password` string, required
  - `tags` string[], nullable — A set of strings representing tags.
  - `username` string, required

## Changes

> 8 revisions in range; 1 not diffed.

- **2025-10-09** `740b73588ef4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kong/apis/kong-enterprise-admin-api/changes/:workspace/consumers/:ConsumerIdForNestedEntities/basic-auth/:BasicAuthId/put.md)

---

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