Create Keystore

Overview

Creates a new keystore and deploys it to environments. Keystores are containers for cryptographic keys and certificates.

Endpoint

POST /apiops/projects/{projectName}/keystores/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

Header Value Required
Authorization Bearer {token} Yes
Content-Type application/json Yes

Path Parameters

Parameter Type Required Description
projectName string Yes Project name

Request Body

The request body should contain a complete Keystore object. See the Keystore structure in the response format.

Notes

  • name must be unique within the project
  • Keystore is automatically deployed to all specified environments after creation
  • Keystore file must be provided as base64-encoded content

Response

Success Response (200 OK)

{
  "success": true,
  "deploymentResult": {
    "success": true,
    "message": "Deployment completed successfully",
    "environmentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Deployed successfully"
      }
    ]
  }
}

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "Keystore (name: my-keystore) is already exist! Try update operation if want to change its value."
}

cURL Example

curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/keystores/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-keystore",
    "description": "Keystore for API security",
    "keyStoreEnvironmentList": [
      {
        "environmentName": "production",
        "type": "JKS",
        "file": "base64-encoded-keystore-content"
      }
    ]
  }'

Notes and Warnings

  • Keystore Name:
    • Must be unique within the project
  • Automatic Deployment:
    • Keystore is automatically deployed after creation
  • Permissions:
    • Requires ROLE_API_SECURITY permission
    • Requires ROLE_DEPLOY_UNDEPLOY_PROXIES permission for deployment