---
title: "Update API keys"
method: POST
path: "/api/v1/edit/api-key"
tags: ["API Keys"]
---

# Update API keys

`POST /api/v1/edit/api-key`

## Request

- Base URL: `/` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/edit/api-key`
- Auth: API key in header `X-API-Key`

Update API keys. Attributes you do not send keep their value, `regen_key` replaces the key value with a new random one. Service keys from mailcow.conf cannot be changed (`api_key_service_locked`).

## Request body

- object
  - `attr` object
    - `description` string: free text, max. 255 characters
    - `access` 'ro' | 'rw'
    - `allow_from` string: IPs/CIDR networks, separated by commas, spaces or newlines (or an array)
    - `skip_ip_check` boolean
    - `active` boolean
    - `regen_key` boolean: issue a new key value
  - `items` object: contains list of API key IDs you want to update

## Response `200`

OK

- object
  - `log` unknown[]: contains request object
    - unknown
  - `msg` unknown[]
    - unknown
  - `type` 'success' | 'danger' | 'error'

## Other responses

- `401`: Unauthorized

## Changes

- **2026-10-23** `679bcc1881c6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mailcow/apis/mailcow-api/changes/api/v1/edit/api-key/post.md)

---

[API](https://skmtc.dev/mailcow/apis/mailcow-api.md) - [All operations](https://skmtc.dev/mailcow/apis/mailcow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mailcow/apis/mailcow-api/revisions/bc8a5589ddad?raw)
