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

# Publish a policy draft



## OpenAPI

````yaml https://api.abliteration.ai/openapi.json post /v1/organization/policies/{policy_id}/publish
openapi: 3.1.0
info:
  title: Abliteration Platform API
  summary: Greenfield Abliteration backend and API gateway.
  version: 0.1.0
servers:
  - url: https://api.abliteration.ai
    description: Production environment
security: []
paths:
  /v1/organization/policies/{policy_id}/publish:
    post:
      tags:
        - Administration
      summary: Publish a policy draft
      operationId: publishPolicy
      parameters:
        - name: policy_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            description: Public policy ID.
            title: Policy Id
          description: Public policy ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdministrationPolicyActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdministrationPolicy'
        '400':
          description: The request or cursor is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The Admin API key is missing, invalid, expired, or revoked.
          headers:
            WWW-Authenticate:
              description: Authentication scheme required by the endpoint.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The Admin API key lacks the required permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The resource was not found in the credential's organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The request conflicts with current resource or idempotency state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: The request body exceeds the 64 KiB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: The request parameters or body are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: The credential or organization rate limit was exceeded.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Limit for the blocking rate-limit policy.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests or concurrency slots remaining.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix time when the blocking policy resets.
              schema:
                type: integer
            X-RateLimit-Scope:
              description: Credential or organization policy scope.
              schema:
                type: string
            X-RateLimit-Metric:
              description: Requests or concurrent requests.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: The request failed unexpectedly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: A required dependency is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - AdminApiKey: []
components:
  schemas:
    AdministrationPolicyActionRequest:
      properties:
        revision:
          type: integer
          maximum: 2147483647
          minimum: 1
          title: Revision
      additionalProperties: false
      type: object
      required:
        - revision
      title: AdministrationPolicyActionRequest
    AdministrationPolicy:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: organization.policy
          title: Object
          default: organization.policy
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        state:
          type: string
          enum:
            - draft
            - monitoring
            - enforcing
            - paused
          title: State
        revision:
          type: integer
          title: Revision
        current_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Current Version
        has_unpublished_changes:
          type: boolean
          title: Has Unpublished Changes
        created_at:
          type: integer
          title: Created At
        updated_at:
          type: integer
          title: Updated At
        draft:
          $ref: '#/components/schemas/AdministrationPolicyDraft'
        published:
          anyOf:
            - $ref: '#/components/schemas/AdministrationPolicyVersion'
            - type: 'null'
      type: object
      required:
        - id
        - name
        - description
        - state
        - revision
        - has_unpublished_changes
        - created_at
        - updated_at
        - draft
      title: AdministrationPolicy
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorResponse
    AdministrationPolicyDraft:
      properties:
        rule:
          type: string
          title: Rule
        direction:
          type: string
          enum:
            - request
            - response
            - both
          title: Direction
        mode:
          type: string
          enum:
            - monitoring
            - enforcing
          title: Mode
        scope:
          type: string
          enum:
            - organization
            - projects
            - unattached
          title: Scope
        project_ids:
          items:
            type: string
          type: array
          title: Project Ids
        match_threshold_basis_points:
          anyOf:
            - type: integer
            - type: 'null'
          title: Match Threshold Basis Points
        base_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Base Version
      type: object
      required:
        - rule
        - direction
        - mode
        - scope
        - project_ids
      title: AdministrationPolicyDraft
    AdministrationPolicyVersion:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: organization.policy.version
          title: Object
          default: organization.policy.version
        version:
          type: integer
          title: Version
        direction:
          type: string
          enum:
            - request
            - response
            - both
          title: Direction
        mode:
          type: string
          enum:
            - monitoring
            - enforcing
          title: Mode
        scope:
          type: string
          enum:
            - organization
            - projects
            - unattached
          title: Scope
        project_ids:
          items:
            type: string
          type: array
          title: Project Ids
        match_threshold_basis_points:
          anyOf:
            - type: integer
            - type: 'null'
          title: Match Threshold Basis Points
        published_at:
          type: integer
          title: Published At
        current:
          type: boolean
          title: Current
        rule:
          type: string
          title: Rule
      type: object
      required:
        - id
        - version
        - direction
        - mode
        - scope
        - project_ids
        - published_at
        - current
        - rule
      title: AdministrationPolicyVersion
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Stable machine-readable error code.
        message:
          type: string
          title: Message
          description: Bounded human-readable error message.
        type:
          $ref: '#/components/schemas/ErrorType'
          description: Broad stable error category.
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: Request field related to the error.
        request_id:
          type: string
          title: Request Id
          description: Server-owned canonical request ID.
        doc_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Url
          description: Documentation URL for the error.
      type: object
      required:
        - code
        - message
        - type
        - request_id
      title: ErrorDetail
    ErrorType:
      type: string
      enum:
        - auth_error
        - permission_error
        - validation_error
        - rate_limit_error
        - billing_error
        - moderation_error
        - policy_error
        - media_error
        - not_found_error
        - conflict_error
        - provider_error
        - internal_error
      title: ErrorType
  securitySchemes:
    AdminApiKey:
      type: http
      description: >-
        Server-side organization-owned Abliteration Admin API key. Never expose
        this credential in browser code.
      scheme: bearer

````