Retrieves an API key object by ID

Note: The response does not contain the encrypted portion of the key. See Decrypt User API Key See Using Global API Keys for more information on permission and scope requirements.

SecuritybearerAuth
Request
path Parameters
userId
required
integer

The ID of the user to view keys for.

id
required
integer

The ID of the API key object to retrieve

query Parameters
o
required
integer

The target organization

Responses
200

Successful Operation

4XX

Invalid Request

default

Invalid Request

get/users/{userId}/api_keys/{id}
Request samples
$apiKey = 'your_automox_api_key'

$headers = @{ "Authorization" = "Bearer $apiKey" }

$url = 'https://console.automox.com/api/users/{98765}/api_keys/999999?o=0000'

$response = (Invoke-WebRequest -Method Get -Uri $url -Headers $headers -ContentType "application/json").Content
Response samples
application/json
{
  • "results": [
    • {
      • "id": 98765,
      • "name": "Jane",
      • "is_enabled": true,
      • "expires_at": null,
      • "created_at": "2023-04-20T15:46:56+0000",
      • "user": {
        • "id": 65432,
        • "firstname": "Jane",
        • "lastname": "Doe",
        • "email": "jane.doe@example.com"
        }
      }
    ],
  • "size": 1
}