Ana içeriğe atla

Endpoint

Authentication

Requires a Personal API Access Token.

Request

Headers

Path Parameters

Request Body

The request body should contain a KeyCreateDTO object with the following structure:

Request Body Fields

Key Environment Object

Notes

  • Request Format: This API uses application/json content type. Unlike the Certificate API, files are not uploaded via multipart/form-data. Instead, key content must be base64-encoded and included in the JSON body.
  • name must be unique within the project
  • Key is automatically deployed to all specified environments after creation
  • Key material must be provided as base64-encoded content in the content field
  • environmentName is used to identify the environment (not environmentId)
  • To encode a key file to base64, you can use command-line tools like base64 (Linux/Mac) or certutil -encode (Windows), or any base64 encoding library in your programming language

Response

Success Response (200 OK)

Error Response (400 Bad Request)

cURL Example

Example 2: Create Key with Multiple Environments

Notes and Warnings

  • Key Name:
    • Must be unique within the project
    • Cannot be changed after creation
  • Key Type:
    • SECRET_KEY: Symmetric key (AES, DES, DESede)
    • PRIVATE_KEY: Asymmetric private key (RSA)
    • PUBLIC_KEY: Asymmetric public key (RSA)
  • Environment Name:
    • Use environmentName (not environmentId) to specify the environment
    • Environment name must exist and be accessible
  • Key Content:
    • Must be base64-encoded and included in the JSON body (not uploaded as a file)
    • For private/public keys, include the full key material (PEM format)
    • Example: Read your key file and encode it to base64: base64 -i private-key.pem (Linux/Mac) or certutil -encode private-key.pem temp.txt && type temp.txt (Windows)
    • Content is encrypted before storage
    • Note: This API uses JSON body format. If you need to upload a file directly, consider using the Certificate API which supports multipart/form-data
  • Automatic Deployment:
    • Key is automatically deployed to all specified environments after creation
    • Deployment results are returned in the response

Permissions

User must have SECRETS + MANAGE permission in the project. For deployment operations (when deploying keys to environments), user must also have SECRETS + DEPLOY_UNDEPLOY permission.