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

# Draft a policy version

> Draft a policy version



## OpenAPI

````yaml /api-specs/cloud/governance-api.json post /rpc/draft-latest-published-policy-version
openapi: 3.0.3
info:
  description: Service responsible for managing Domino Governance feature
  title: Domino Governance API
  contact:
    name: Domino Data Lab
    url: https://tickets.dominodatalab.com/hc/en-us
    email: support@dominodatalab.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://mycluster.domino.tech/api/governance/v1
    description: >-
      Replace 'mycluster.domino.tech' with your Domino cluster hostname. For
      Domino Cloud customers, that is `your-subdomain`.domino.tech (e.g.,
      acme.domino.tech). For self-hosted deployments, it is the hostname you
      reach the Domino UI at.
security: []
paths:
  /rpc/draft-latest-published-policy-version:
    post:
      tags:
        - policy-versions
      summary: Draft a policy version
      description: Draft a policy version
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/server.DraftPolicyVersionRequest'
        description: The draft policy version request
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/guardrails.PolicyVersion'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.HTTPError'
components:
  schemas:
    server.DraftPolicyVersionRequest:
      type: object
      required:
        - policyId
      properties:
        policyId:
          type: string
    guardrails.PolicyVersion:
      type: object
      properties:
        allowProjectApprovers:
          type: boolean
        classificationArtifactMap:
          type: object
          additionalProperties:
            type: string
        classificationRule:
          type: string
        createdAt:
          type: string
        createdBy:
          type: object
        enforceSequentialOrder:
          type: boolean
        gates:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.PolicyGate'
        id:
          type: string
        mandatoryBundleIds:
          type: array
          items:
            type: string
        notes:
          type: string
        policyId:
          type: string
        simpleClassificationQuestionId:
          type: string
        stages:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.Stage'
        status:
          $ref: '#/components/schemas/guardrails.PolicyStatus'
        taxonomyProperties:
          description: populated by TaxonomyService
          type: array
          items:
            $ref: '#/components/schemas/guardrails.TaxonomyPropertyValue'
        updatedAt:
          type: string
        updatedBy:
          type: object
        upgradeStrategy:
          $ref: '#/components/schemas/guardrails.UpgradeStrategy'
        version:
          type: string
    server.HTTPError:
      type: object
      properties:
        code:
          description: >-
            Code is a stable machine-readable error identifier; absent on most
            errors.
          allOf:
            - $ref: '#/components/schemas/guardrails.ErrorCode'
        message:
          type: string
    guardrails.PolicyGate:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        policyId:
          type: string
        policyVersionId:
          type: string
        resources:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.RuleDefinition'
    guardrails.Stage:
      type: object
      properties:
        approvals:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.StageApproval'
        evidenceSet:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.Evidence'
        id:
          type: string
        name:
          type: string
        notifyOnTransition:
          type: boolean
        policyEntityId:
          type: string
        policyVersionId:
          type: string
    guardrails.PolicyStatus:
      type: string
      enum:
        - Draft
        - Published
        - Archived
      x-enum-varnames:
        - PolicyDraft
        - PolicyPublished
        - PolicyArchived
    guardrails.TaxonomyPropertyValue:
      type: object
      properties:
        description:
          type: string
        groupName:
          type: string
        propertyId:
          type: string
        propertyLabel:
          type: string
        type:
          type: string
        value:
          type: string
        values:
          type: array
          items:
            type: string
    guardrails.UpgradeStrategy:
      type: object
      required:
        - approvals
      properties:
        approvals:
          $ref: '#/components/schemas/guardrails.ApprovalsStrategy'
    guardrails.ErrorCode:
      type: string
      enum:
        - BUNDLE_REQUIRES_POLICY
      x-enum-varnames:
        - CodeBundleRequiresPolicy
    guardrails.RuleDefinition:
      type: object
      required:
        - action
      properties:
        action:
          $ref: '#/components/schemas/guardrails.RuleAction'
        failOpen:
          type: boolean
        parameters:
          type: object
    guardrails.StageApproval:
      type: object
      properties:
        approvers:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.Approver'
        evidence:
          $ref: '#/components/schemas/guardrails.Evidence'
        id:
          type: string
        name:
          type: string
        policyEntityId:
          type: string
        revalidationConfig:
          $ref: '#/components/schemas/guardrails.RevalidationConfig'
    guardrails.Evidence:
      type: object
      properties:
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/guardrails.EvidenceArtifact'
        createdAt:
          type: string
        description:
          type: string
        externalId:
          type: string
        id:
          type: string
        name:
          type: string
        policyId:
          type: string
        policyVersionId:
          type: string
        scope:
          $ref: '#/components/schemas/guardrails.EvidenceScope'
        visible:
          description: >-
            allows true, false or nil values (if nil, FE can decide to show
            everything)
          type: boolean
    guardrails.ApprovalsStrategy:
      type: object
      required:
        - strategy
      properties:
        strategy:
          $ref: '#/components/schemas/guardrails.ApprovalStrategy'
    guardrails.RuleAction:
      type: string
      enum:
        - Deploy
        - CreateApp
        - CreateEndpoint
      x-enum-varnames:
        - Deploy
        - CreateApp
        - CreateEndpoint
    guardrails.Approver:
      type: object
      required:
        - editable
        - id
        - name
        - showByDefault
      properties:
        editable:
          type: boolean
        fromOrganizationUserId:
          type: string
        id:
          type: string
        isOrganizationUser:
          type: boolean
        name:
          type: string
        showByDefault:
          type: boolean
    guardrails.RevalidationConfig:
      type: object
      required:
        - openWindowDaysBefore
        - recurring
        - type
      properties:
        openWindowDaysBefore:
          type: integer
          minimum: 1
        recurring:
          $ref: '#/components/schemas/guardrails.Recurring'
        type:
          enum:
            - absolute
            - relative
          allOf:
            - $ref: '#/components/schemas/guardrails.RevalidationType'
    guardrails.EvidenceArtifact:
      type: object
      properties:
        artifactType:
          $ref: '#/components/schemas/guardrails.ArtifactType'
        details:
          type: object
        id:
          type: string
        policyEntityId:
          type: string
        required:
          type: boolean
        visibilityRule:
          type: string
        visible:
          type: boolean
    guardrails.EvidenceScope:
      type: string
      enum:
        - Global
        - Local
      x-enum-varnames:
        - Global
        - Local
    guardrails.ApprovalStrategy:
      type: string
      enum:
        - retain
        - reset
      x-enum-varnames:
        - ApprovalStrategyRetain
        - ApprovalStrategyReset
    guardrails.Recurring:
      type: object
      required:
        - every
        - unit
      properties:
        every:
          type: integer
          minimum: 1
        startDate:
          type: string
        unit:
          enum:
            - month
            - year
          allOf:
            - $ref: '#/components/schemas/guardrails.RevalidationUnit'
    guardrails.RevalidationType:
      type: string
      enum:
        - absolute
        - relative
      x-enum-varnames:
        - RevalidationTypeAbsolute
        - RevalidationTypeRelative
    guardrails.ArtifactType:
      type: string
      enum:
        - input
        - guidance
        - policyScriptedCheck
        - metadata
      x-enum-varnames:
        - Input
        - Guidance
        - AutomatedJob
        - Metadata
    guardrails.RevalidationUnit:
      type: string
      enum:
        - month
        - year
      x-enum-varnames:
        - RevalidationUnitMonth
        - RevalidationUnitYear

````

## Related topics

- [Define policies](/cloud/platform-capabilities/features/governance/define-governance-policies/index.md)
- [Upsert drafts](/api-reference/drafts/upsert-drafts.md)
- [Get latest draft for bundle ID](/api-reference/drafts/get-latest-draft-for-bundle-id.md)
- [Reset bundle results, drafts, approvals, stage assignees, and optionally detach attachments](/api-reference/rpc/reset-bundle-results-drafts-approvals-stage-assignees-and-optionally-detach-attachments.md)
