Skip to main content

Get API Key

Retrieves the current API key for a specific user by their User ID.

Endpoint​

GET /v2/users/key/{id}

Path Parameters​

ParameterTypeRequiredDescription
idintegerYesThe User ID whose API key to retrieve
note

This operation requires NetworkAdmin or higher AuthLevel. Users may retrieve their own API key via Get Me and Generate API Key.

Response​

Returns the API key string for the specified user.

{
"success": true,
"data": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Code Examples​

curl -X GET "https://rest.ecgrid.io/v2/users/key/$ID" \
-H "X-API-Key: $ECGRID_API_KEY"

See Also​

  • Generate API Key — generate a new API key, invalidating the current one
  • Get Me — retrieve your own user context and confirm which key is active
  • Authentication — how to use API keys in requests