> ## 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.

# Update a SaaS rule

> Update the natural-language prompt and/or the lifecycle status of the SaaS rule. Both fields are optional but at least one must be provided.

- Omitted `prompt` → current prompt is preserved.
- Omitted `status` → current status is preserved (or `DRAFT` if no rule existed yet).
- Setting `status` to `ENABLED` requires a prompt — provide one in the same call if no rule exists yet.

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json put /saas/{saasId}/rule
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:
    put:
      tags:
        - Saas
      summary: Update a SaaS rule
      description: >-
        Update the natural-language prompt and/or the lifecycle status of the
        SaaS rule. Both fields are optional but at least one must be provided.


        - Omitted `prompt` → current prompt is preserved.

        - Omitted `status` → current status is preserved (or `DRAFT` if no rule
        existed yet).

        - Setting `status` to `ENABLED` requires a prompt — provide one in the
        same call if no rule exists yet.
      operationId: updateSaasRule
      parameters:
        - name: saasId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSaasRuleBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaasRule_Output'
components:
  schemas:
    UpdateSaasRuleBody:
      type: object
      properties:
        prompt:
          description: >-
            Natural-language policy prompt. If omitted, the current prompt is
            preserved.
          type: string
          minLength: 1
        status:
          description: >-
            New lifecycle status for the rule. If omitted, the current status is
            preserved (or `DRAFT` if no rule existed yet).
          type: string
          enum:
            - DRAFT
            - ENABLED
            - DISABLED
    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:
                prompt:
                  description: >-
                    Natural-language policy prompt that drives provisioning
                    suggestions for this SaaS.
                  type: string
                status:
                  description: 'Lifecycle status of the rule: DRAFT, ENABLED, or DISABLED.'
                  type: string
                  enum:
                    - DRAFT
                    - ENABLED
                    - DISABLED
              required:
                - prompt
                - 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>`.

````