- API >
- Public API Resources >
- Groups and Users >
- User API Keys >
- Create a User API Key
Create a User API Key¶
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
This endpoint retrieves the API keys for a specific Ops Manager user. You must be one of the following users to successfully call this endpoint:
- The Ops Manager user specified in the digest authentication
- The Ops Manager user with the
GLOBAL_OWNER
role
Note
You must have access to an a public API key generated from the GUI by your administrator before you can successfully user this endpoint. See Generate Public API Keys for instructions.
Resource¶
Request Parameters¶
Request Path Parameters¶
Path Element | Required/Optional | Description |
---|---|---|
USER-ID |
Required. | The unique identifier of the Ops Manager user for whom you want to create an
API key. Use the /users/byName/{USER-NAME}
endpoint to retrieve your Ops Manager user ID. Specify the value of the id
field in the response body to that endpoint. |
Request Query Parameters¶
This endpoint supports the following optional request query parameters:
This endpoint may use any of the HTTP request query parameters available to all Ops Manager API resources. These are all optional.
Name | Type | Description | Default | ||||||
---|---|---|---|---|---|---|---|---|---|
pretty |
boolean | Indicates whether the response body should be in a prettyprint format. | false |
||||||
envelope |
boolean | Indicates whether or not to wrap the response in an envelope. Some API clients cannot access the HTTP response headers or
status code. To remediate this, set For endpoints that return one result, the response body includes:
|
false |
Request Body Parameters¶
Name | Type | Description |
---|---|---|
description |
string | Description of the API key, which may be an empty string. Required. |
Response¶
Name | Type | Description |
---|---|---|
createdAt |
timestamp | The time the API key was created. |
description |
string | Description of the API key. |
enabled |
boolean | Indicates whether the API key is enabled. |
id |
string | The unique identifier of the API key. |
key |
string | The new API key. Ops Manager displays the key only one time, so you must copy it. |
usedCount |
number | The number of times that the API key has been used by the associated user. |
userId |
string | The user ID associated with the request for a new API key. |