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

# Update API Key

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-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-auth-token" type="string" required>
  Your [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>
