> ## Documentation Index
> Fetch the complete documentation index at: https://velt-mintlify-e6426361.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update API Key

> Update the display name of an existing Velt workspace API key using the v2 REST API to keep keys organized across environments and projects.

Use this API to update the name of an existing API key.

<Info>
  This endpoint uses **workspace-level auth**: pass `x-velt-workspace-id` and `x-velt-workspace-auth-token` (from the Create Workspace response) as headers.
</Info>

# Endpoint

`POST https://api.velt.dev/v2/workspace/apikey/update`

# Headers

<ParamField header="x-velt-workspace-id" type="string" required>
  Your Workspace ID.
</ParamField>

<ParamField header="x-velt-workspace-auth-token" type="string" required>
  Your workspace [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="apiKey" type="string" required>
      The API key to update.
    </ParamField>

    <ParamField body="apiKeyName" type="string" required>
      New display name for the API key.
    </ParamField>
  </Expandable>
</ParamField>

# Example Request

```JSON theme={null}
{
  "data": {
    "apiKey": "velt_api_key_1",
    "apiKeyName": "Updated Production Key"
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "API key updated successfully.",
    "data": null
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "status": "NOT_FOUND",
    "message": "API key not found."
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "API key updated successfully.",
      "data": null
    }
  }
  ```
</ResponseExample>
