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

# Publish the access policy of a SaaS

> Publish the access policy of the SaaS (its natural-language provisioning rule): copy the current draft to the published text so the agent reads it at runtime when reviewing provisioning for this SaaS. Only call this AFTER the user has reviewed the exact draft in the conversation and explicitly confirmed they want it published — it makes the policy live for provisioning decisions. Call getSaasById first to show the draft and confirm. Fails if the SaaS has no access policy yet.

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /saas/{saasId}/rule/publish
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /saas/{saasId}/rule/publish:
    post:
      tags:
        - Saas
      summary: Publish the access policy of a SaaS
      description: >-
        Publish the access policy of the SaaS (its natural-language provisioning
        rule): copy the current draft to the published text so the agent reads
        it at runtime when reviewing provisioning for this SaaS. Only call this
        AFTER the user has reviewed the exact draft in the conversation and
        explicitly confirmed they want it published — it makes the policy live
        for provisioning decisions. Call getSaasById first to show the draft and
        confirm. Fails if the SaaS has no access policy yet.
      operationId: publishSaasRule
      parameters:
        - name: saasId
          required: true
          in: path
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaasRule_Output'
components:
  schemas:
    SaasRule_Output:
      type: object
      properties:
        rule:
          description: >-
            Provisioning rule configured for this SaaS, or null if no rule has
            been authored yet.
          anyOf:
            - type: object
              properties:
                draft:
                  description: >-
                    The editable draft prompt for this SaaS provisioning rule.
                    This is the text updateSaasRule writes.
                  type: string
                published:
                  description: >-
                    The prompt the agent evaluates at runtime when reviewing
                    provisioning for this SaaS, or null if never published. Diff
                    it against the draft to surface pending edits.
                  anyOf:
                    - type: string
                    - type: 'null'
                status:
                  description: >-
                    Publication state. "unpublished": never published (or
                    hidden). "pending-changes": the draft has edits not yet
                    published. "published": the draft matches the published
                    text.
                  type: string
                  enum:
                    - unpublished
                    - pending-changes
                    - published
              required:
                - draft
                - published
                - status
              additionalProperties: false
            - type: 'null'
      required:
        - rule
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.