> ## Documentation Index
> Fetch the complete documentation index at: https://developer.hellgate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish version

> Publishes a new version of an existing custom schema. Requires the admin:schemas:write scope. Versions are system-assigned integers; every publication creates a new, immutable version, even for an identical document. Built-in schemas cannot be published to. Validation and rate limit match registration. A published version can be bound by a ruleset as soon as the response returns.



## OpenAPI

````yaml /products/specter/openapi.yaml post /api/admin/schemas/{name}/versions
openapi: 3.1.0
info:
  contact:
    email: support@hellgate.io
    name: Starfish GmbH & Co. KG
    url: https://hellgate.io/cpa/specter
  description: Composable decision engine and fraud prevention service.
  license:
    name: Hellgate API Terms
    url: https://hellgate.io/terms-and-conditions
  title: Specter API
  version: '1.0'
servers:
  - description: Managed instance of Specter
    url: https://{instance}.{env}.on-hellgate.cloud
    variables:
      instance:
        default: my-instance
        description: Your unique instance slug, provided during onboarding.
      env:
        default: eu1
        description: Deployment environment (currently eu1).
security: []
tags:
  - description: Evaluate transactions and retrieve decision results.
    name: Decisions
  - description: Close decisions that were flagged for manual review.
    name: Resolutions
  - description: Report payment lifecycle events for a prior decision.
    name: Lifecycle Events
  - description: Manage rulesets and their activation lifecycle.
    name: Rulesets
  - description: Register and version custom decision-payload schemas.
    name: Schemas
  - description: Configure interceptors and intercept live payment requests.
    name: Interceptors
  - description: Subscribe to decision and event notifications.
    name: Webhooks
  - description: Manage blocked field values.
    name: Blacklist
paths:
  /api/admin/schemas/{name}/versions:
    post:
      tags:
        - Schemas
      summary: Publish version
      description: >-
        Publishes a new version of an existing custom schema. Requires the
        admin:schemas:write scope. Versions are system-assigned integers; every
        publication creates a new, immutable version, even for an identical
        document. Built-in schemas cannot be published to. Validation and rate
        limit match registration. A published version can be bound by a ruleset
        as soon as the response returns.
      operationId: admin_schema_versions_publish
      parameters:
        - description: Schema name
          in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishSchemaVersionRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaVersion'
          description: Published version
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrors'
          description: >-
            Validation failure — entries name the offending JSON-Schema path and
            the violation
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Publication rate limit exceeded
          headers:
            Retry-After:
              description: Seconds until publications are accepted again.
              schema:
                type: integer
      callbacks: {}
      security:
        - bearerAuth: []
components:
  schemas:
    PublishSchemaVersionRequest:
      properties:
        carry_over:
          default: true
          description: >-
            When true (default), velocity counters carry over from the previous
            version for field paths present in both versions. When false,
            rulesets bound to the new version count from zero; earlier versions
            keep their counters. Blacklist entries are global and not affected.
            Baked into the version at publication; immutable thereafter.
          type: boolean
        document:
          description: >-
            The JSON Schema document for the new version (same format as
            SchemaVersion.document).
          type: object
      required:
        - document
      title: PublishSchemaVersionRequest
      type: object
    SchemaVersion:
      properties:
        carry_over:
          description: >-
            Whether velocity counters carry over from the previous version for
            field paths present in both versions. When false, rulesets bound to
            this version count from zero — counters of earlier versions are
            untouched and keep serving the rulesets bound to them. Blacklist
            entries are not versioned — they are global and unaffected by this
            flag. Fixed at publication and immutable thereafter. Always true for
            version 1.
          type: boolean
        created_at:
          description: >-
            Null for version 1 of a built-in schema, which ships with the
            platform.
          format: date-time
          type:
            - string
            - 'null'
        deprecated_at:
          format: date-time
          type:
            - string
            - 'null'
        document:
          description: >-
            The JSON Schema document. Each field carries `x-specter-type` (one
            of the 23 entries of the type vocabulary — `string`, `integer`,
            `number`, `boolean`, `email`, `iban`, `country-code`,
            `currency-code`, `language-code`, `date`, `datetime`, `url`, `uuid`,
            `phone`, `ip`, `amount`, `pan`, `masked-pan`, `scheme-enum`,
            `card-funding-type-enum`, `card-segment-enum`, `object`, `array`)
            and optionally `x-data-classification` (`any` — the default — `pii`,
            `pci-pan`, `pci-sad`). A `pan` field is always `pci-pan`;
            `masked-pan` defaults to `pii`. Types validate the decision payload
            at ingestion; markers drive the PCI gate, redaction, and retention.
            See [Schemas](/products/specter/concepts/schemas).
          type: object
        name:
          example: customer-registration
          type: string
        status:
          enum:
            - active
            - deprecated
          type: string
        version:
          description: >-
            System-assigned monotonic integer per schema, starting at 1.
            Merchants never choose it.
          example: 2
          type: integer
      title: SchemaVersion
      type: object
    Error:
      description: Generic error response with classifier, code, and message
      example:
        classifier: NOT_FOUND
        code: 404
        message: The requested resource does not exist
      properties:
        classifier:
          type: string
        code:
          type: integer
        message:
          type: string
      required:
        - classifier
        - code
        - message
      title: Error
      type: object
    ValidationErrors:
      description: Response shape for request validation failures
      example:
        classifier: VALIDATION_ERROR
        code: 422
        validation_errors:
          - message: must be a positive integer
            path: limit
      properties:
        classifier:
          example: VALIDATION_ERROR
          type: string
        code:
          example: 422
          type: integer
        validation_errors:
          items:
            properties:
              message:
                example: must be a positive integer
                type: string
              path:
                example: limit
                type: string
            type: object
          type: array
      required:
        - classifier
        - code
        - validation_errors
      title: ValidationErrors
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: >-
        HS256-signed JWT bearer token, obtained via the OAuth2
        client-credentials grant (see Authentication).
      scheme: bearer
      type: http

````