UploadApiKey
post
/20160918/users/{user_id}/apiKeys
Upload an API signing key for the specified user. Every user has authorization to use this operation to upload a key for their own user. An administrator does not need to write a policy to give users this ability.
Important: In addition to an API key, you need to be granted authorizations to compartments and resource operations to do the work you need to do.
After you send your UploadApiKey request, the new key's lifecycleState will temporarily be CREATING. Before using the key, make sure its lifecycleState has changed to ACTIVE.
Request
Supported Media Types
- application/json
Path Parameters
-
userId(required): string
The OCID of the user.
Header Parameters
-
opc-retry-token: string
Minimum Length:
1
Maximum Length:64
A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
Request object for uploading an API key for a user.
Root Schema : CreateApiKeyDetails
Type:
Show Source
object
-
key(required):
string
The public key. Must be an RSA key in PEM format.
Response
Supported Media Types
- application/json
200 Response
The key is being uploaded.
Headers
-
etag: string
For optimistic concurrency control. See if-match.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : ApiKey
Type:
object
A PEM-format RSA credential for securing requests to the Oracle Private Cloud Appliance REST API. Also known as an *API signing key*. Specifically, this is the public key from the key pair. The private key remains with the user calling the API. Important: This is not the SSH key for accessing compute instances. Each user can have a maximum of three API signing keys.
Show Source
-
fingerprint:
string
The key's fingerprint (for example, 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
-
inactiveStatus:
integer(int64)
The detailed status of INACTIVE lifecycleState.
-
keyId:
string
An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
-
keyValue:
string
The key's value.
-
lifecycleState:
string
Minimum Length:
1
Maximum Length:64
Allowed Values:[ "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED" ]
The API key's current state. After creating an ApiKey object, make sure its lifecycleState changes from CREATING to ACTIVE before using it. -
timeCreated:
string(date-time)
Date and time the ApiKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
-
userId:
string
The OCID of the user the key belongs to.
Example Response (application-json)
{ "keyId": "ocid1.tenancy.aaaaaaaaba3pv6exampleuniqueID/ocid1.user.aaaaaaaaqvexampleuniqueID/cd:7c:ee:29:8b:2f:c6:48:13:c9:9f:12:66:77:ef:c2", "keyValue": "-----BEGIN PUBLIC KEY-----\cmdnMIIBIjANBgkqhkiG9w0BAQEFA...AOCAQ8AMIIBCgKCAQEA7hglbuGudIO3sgoAa1n/\nHgUdIGeQmwf/QIv3Y0nOEP4TB7rbdCH99oJYzF86M2\nmwIDAQAB\n-----END PUBLIC KEY-----", "fingerprint": "cd:7c:ee:29:8b:2f:c6:48:13:c9:9f:12:66:77:ef:c2", "userId": "ocid1.user.aaaaaaaaqvrexampleuniqueID", "lifecycleState": "ACTIVE", "timeCreated": "2016-12-07T00:59:17.326Z" }
400 Response
Bad Request
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
403 Response
Forbidden
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
404 Response
Not Found
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
409 Response
Conflict
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
429 Response
Too Many Requests
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
500 Response
Internal Server Error
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
Default Response
An error has occurred.
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload