---
title: "Update API Key"
method: PUT
path: "/apikeys/{key_id}"
tags: ["Authentication/API Key (Machine 2 Machine)"]
---

# Update API Key

`PUT /apikeys/{key_id}`

This is a limited action and will require special access to create API keys. The Update is even more limited only allowing the change of the description and IP restrictions. You will not be able to change the scope, access rights or any premissions. A new apikey would need to be created in those cases.

## Path parameters

- `key_id` string, required

## Request body

- object
  - `description` string, required — This is the main description/name for the API key that should describe its purpose for tracking and understanding its intended use.
  - `ip-address` string — Optional IP restrictions for API to require access from matching IP or subnets. Multipe ips/subnets can be provided comma seperated
  - `allowed-models` union — This is an optional limitation to the ability of this apikey. The default is * or all models, but can be set to a specific model or array of models allowing specific access. The "models" are linked to objects as defined in the scope definition and might have varies terminolofy from the api itself.
    - string — A string with a specific model or "*" for all.
    - string[] — An array of models.

## Response `202`

- SuccessResponse
  - `code` integer, required
  - `message` string, required

## Other responses

- `400`
- `401`
- `403`
- `404`

---

[API](https://skmtc.net/ns-api/apis/netsapiens-api-v2.md) · [All operations](https://skmtc.net/ns-api/apis/netsapiens-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ns-api/netsapiens-api-v2/revisions/d37f65b5b886/schema)
