---
title: "Create a new Basic-auth credential"
method: POST
path: "/basic-auths"
tags: ["Basic-auth credentials"]
---

# Create a new Basic-auth credential

`POST /basic-auths`

Create a new Basic-auth credential

## Request body

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

## Response `201`

Successfully created Basic-auth credential

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

## Other responses

- `401` — Unauthorized

## Changes

> 4 revisions in range; 1 not diffed.

- **2024-11-26** `99e71588eb61` — 4 breaking, 1 warning, 10 info
  - added the new required request property `password`
  - added the new required request property `username`
  - the request's body type changed from no type to `object`
  - the response's body type changed from no type to `object` for status `201`
  - …11 more

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