Operation

POST /users/{id}/rotate_api_key

Generates a new API key for the user. Admin callers may rotate any user's key; non-admin callers may only rotate their own.

Operation ID: rotateUserApiKey · Tags: Users

Parameters

Name In Required Type Description
id path Yes integer

Request Body

No request body is defined for this operation.

Responses

Content Types

  • application/json
{
  "description": "Rotated API key",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "meta": {
            "type": "object",
            "properties": {
              "api_key": {
                "type": "string",
                "description": "Newly generated api key; shown only once in this response"
              }
            },
            "required": [
              "api_key"
            ]
          }
        }
      }
    }
  }
}

{
  "$ref": "#/components/responses/Unauthorized"
}

{
  "$ref": "#/components/responses/Forbidden"
}

{
  "$ref": "#/components/responses/NotFound"
}

API Playground

The in-page tester only supports GET. For POST, use the sample curl below or the dedicated resource docs (e.g. Contacts, Link Builder). Sign in to enable live testing with your API key.

Action Method Endpoint Description
Rotate a user's API key POST /api/v1/users/1/rotate_api_key OpenAPI operationId: rotateUserApiKey.

Example request (replace YOUR_API_KEY or sign in above):

curl -X POST "https://app.hienergy.ai/api/v1/users/1/rotate_api_key" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Accept: application/json"
  -H "Content-Type: application/json" \
  -d '{}'
Ask Dex AIIntegration help

If this page feels TLDR, ask Dex AI.

Dex AI speaks your language, and all the other languages you may not. It will write the integration for you with the right endpoint and headers in one plain-English answer.