{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/azion/main/json-schema/azion-certificate-request-schema.json",
  "title": "CertificateRequest",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/azion-api-openapi.json#/components/schemas/CertificateRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true,
      "format": "int64"
    },
    "name": {
      "type": "string",
      "pattern": ".*",
      "maxLength": 250,
      "minLength": 1
    },
    "certificate": {
      "type": [
        "string",
        "null"
      ],
      "pattern": ".*",
      "maxLength": 1000000,
      "minLength": 1
    },
    "private_key": {
      "type": [
        "string",
        "null"
      ],
      "writeOnly": true,
      "pattern": ".*",
      "maxLength": 64000,
      "minLength": 1
    },
    "issuer": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "pattern": ".*"
    },
    "subject_name": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^.*$"
      },
      "readOnly": true
    },
    "validity": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "pattern": "^.*$"
    },
    "type": {
      "enum": [
        "certificate",
        "trusted_ca_certificate"
      ],
      "type": "string",
      "default": "certificate",
      "description": "The value can't be changed after the certificate creation.\n\n* `certificate` - Certificate\n* `trusted_ca_certificate` - Trusted CA Certificate",
      "x-extensible-enum": [
        "certificate",
        "trusted_ca_certificate"
      ]
    },
    "managed": {
      "type": "boolean",
      "readOnly": true,
      "default": false
    },
    "status": {
      "enum": [
        "challenge_verification",
        "active",
        "pending",
        "failed"
      ],
      "type": "string",
      "description": "* `challenge_verification` - Challenge Verification\n* `active` - Active\n* `pending` - Pending\n* `failed` - Failed",
      "readOnly": true,
      "x-extensible-enum": [
        "challenge_verification",
        "active",
        "pending",
        "failed"
      ]
    },
    "status_detail": {
      "type": "string",
      "readOnly": true,
      "default": "",
      "pattern": ".*",
      "maxLength": 500,
      "minLength": 0
    },
    "csr": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "pattern": ".*"
    },
    "challenge": {
      "enum": [
        "dns",
        "http"
      ],
      "type": "string",
      "description": "* `dns` - Uses DNS to solve the ACME challenge.\n* `http` - Uses HTTP to solve the ACME challenge.",
      "x-extensible-enum": [
        "dns",
        "http"
      ]
    },
    "authority": {
      "enum": [
        "lets_encrypt"
      ],
      "type": "string",
      "description": "* `lets_encrypt` - lets_encrypt",
      "x-extensible-enum": [
        "lets_encrypt"
      ]
    },
    "key_algorithm": {
      "enum": [
        "rsa_2048",
        "rsa_4096",
        "ecc_384"
      ],
      "type": "string",
      "description": "* `rsa_2048` - 2048-bit RSA\n* `rsa_4096` - 4096-bit RSA\n* `ecc_384` - 384-bit Prime Field Curve",
      "default": "ecc_384",
      "x-extensible-enum": [
        "rsa_2048",
        "rsa_4096",
        "ecc_384"
      ]
    },
    "active": {
      "type": "boolean"
    },
    "product_version": {
      "type": "string",
      "readOnly": true,
      "pattern": "\\d+\\.\\d+",
      "maxLength": 50,
      "minLength": 3
    },
    "last_editor": {
      "type": "string",
      "readOnly": true,
      "pattern": "^.*$"
    },
    "last_modified": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "Timestamp of the last modification made to the certificate content on the platform.",
      "pattern": "^.*$"
    },
    "renewed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "Timestamp indicating when the managed certificate was renewed on our platform.",
      "pattern": "^.*$"
    },
    "common_name": {
      "type": "string",
      "writeOnly": true,
      "maxLength": 64,
      "minLength": 1,
      "pattern": "^(((\\*\\.)?[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)$"
    },
    "alternative_names": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 250,
        "minLength": 1,
        "pattern": "^(((\\*\\.)?[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)$"
      },
      "writeOnly": true
    },
    "source_certificate": {
      "type": [
        "integer",
        "null"
      ],
      "maximum": 2147483647,
      "minimum": 1,
      "writeOnly": true,
      "format": "int64"
    }
  },
  "required": [
    "authority",
    "challenge",
    "common_name",
    "csr",
    "id",
    "issuer",
    "last_editor",
    "last_modified",
    "managed",
    "name",
    "product_version",
    "renewed_at",
    "status",
    "status_detail",
    "subject_name",
    "validity"
  ],
  "additionalProperties": false
}