---
title: "Upsert a Basic-auth credential"
method: PUT
path: "/basic-auths/{BasicAuthId}"
tags: ["Basic-auth credentials"]
---

# Upsert a Basic-auth credential

`PUT /basic-auths/{BasicAuthId}`

Create or Update Basic-auth credential using ID.

## Request body

- BasicAuth
  - `created_at` integer — Unix epoch when the resource was created.
  - `id` string
  - `password` string
  - `tags` string[]
  - `username` string
  - `consumer` object
    - `id` string

## Response `200`

Successfully upserted Basic-auth credential

- BasicAuth
  - `created_at` integer — Unix epoch when the resource was created.
  - `id` string
  - `password` string
  - `tags` string[]
  - `username` string
  - `consumer` object
    - `id` string

## Other responses

- `401` — Unauthorized

## Changes

> 3 revisions in range; 1 not diffed.

- **2024-09-11** `5bd52189d290` — 1 warning
  - deleted the `path` request parameter `BasicAuthId`

[Change history](https://skmtc.dev/kong/apis/kong-enterprise-admin-api/changes/basic-auths/: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/5bd52189d290/schema)
