Skip to main content
PUT
/
api
/
adm
/
companyProjectKeys
/
{id}
Update API Key Metadata
curl --request PUT \
  --url https://localhost:44371/api/adm/companyProjectKeys/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "<string>",
  "expirationDate": "2023-11-07T05:31:56Z",
  "deactivationDate": "2023-11-07T05:31:56Z"
}
'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Updates API key metadata without changing the actual key value. Common use cases include renaming keys for clarity, updating descriptions, activating keys after testing, or deactivating compromised or unused keys. Setting a key to inactive immediately prevents it from authenticating API requests while preserving the key for potential reactivation.

Input

  • Path Parameter: id (guid, required) — Unique identifier of the API key to update.
  • Body: model (CompanyProjectKeyUpdateCommandRequest, required) — Updated key information including:
    • id (guid, required) — Key identifier (must match path parameter).
    • name (string, optional) — Updated descriptive name.
    • description (string, optional) — Updated description.
    • isActive (bool, optional) — Active status.

Output

Returns a CompanyProjectKeyUpdateCommandResponse indicating whether the update was successful.

Example Request

PUT /api/admin/companyProjectKeys/9ef15c43-a955-6f4h-c7g3-1h6d4f0e3g9c
Content-Type: application/json
Authorization: Bearer {token}

{
  "id": "9ef15c43-a955-6f4h-c7g3-1h6d4f0e3g9c",
  "name": "Production API Key - Updated",
  "description": "Updated description for production environment",
  "isActive": false
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Errors

  • 400 Bad Request — Missing required fields, validation errors, or cannot deactivate last active key.
  • 404 Not Found — No API key exists with the specified ID.
  • 401 Unauthorized — Missing or invalid authentication token.

Notes

  • This operation does not change the actual key value; only metadata is modified.
  • Setting isActive=false immediately prevents the key from authenticating API requests.
  • Inactive keys can be reactivated by setting isActive=true in a subsequent update.
  • Projects must maintain at least one active API key at all times.
  • Name and description changes do not affect key functionality.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string<guid>
required

The unique identifier of the API key to update.

Body

application/json

The updated key information including name, description, and active status.

Represents the payload used to update key metadata.

id
string<guid>

The identifier of the key to update.

expirationDate
string<date-time>

The new expiration date for the key.

deactivationDate
string<date-time> | null

The optional deactivation date for the key.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Represents the response returned after updating a key.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null