> ## 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 the purchasing policy draft

> Overwrite the purchasing policy draft, and optionally publish it in the same call. You must provide the COMPLETE policy text — this fully replaces the draft, it does not append. Call getPurchasingPolicy first and re-send the full, edited body. With `publish: true` the new draft goes live immediately, the one-call path for a change already reviewed; without it the draft is written but stays offline until publishPurchasingPolicy is called. Requires the marketplace to be enabled for the company: when it is disabled, the call is refused with 403 `MarketplaceDisabledError` (a Primo admin must enable it).

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json patch /purchasing-policy
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:
  /purchasing-policy:
    patch:
      tags:
        - PurchasingPolicy
      summary: Update the purchasing policy draft
      description: >-
        Overwrite the purchasing policy draft, and optionally publish it in the
        same call. You must provide the COMPLETE policy text — this fully
        replaces the draft, it does not append. Call getPurchasingPolicy first
        and re-send the full, edited body. With `publish: true` the new draft
        goes live immediately, the one-call path for a change already reviewed;
        without it the draft is written but stays offline until
        publishPurchasingPolicy is called. Requires the marketplace to be
        enabled for the company: when it is disabled, the call is refused with
        403 `MarketplaceDisabledError` (a Primo admin must enable it).
      operationId: updatePurchasingPolicy
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePurchasingPolicyBodyDto'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchasingPolicyResponseDto_Output'
components:
  schemas:
    UpdatePurchasingPolicyBodyDto:
      type: object
      properties:
        content:
          description: >-
            The COMPLETE new purchasing policy text. This fully replaces the
            draft — it is not appended.
          type: string
        publish:
          description: >-
            Set to true to publish the policy in the same call: the draft is
            written and immediately copied to the published text the agent reads
            at runtime. Use it when the user has already confirmed the change —
            a unitary request such as "raise the approval threshold to €1,000"
            is that confirmation — so one edit costs one approval instead of
            two. Leave it out for an open-ended rewrite the user has not seen
            yet: the draft is saved and stays offline until
            publishPurchasingPolicy.
          type: boolean
      required:
        - content
    PurchasingPolicyResponseDto_Output:
      type: object
      properties:
        id:
          type: string
        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
        draft:
          description: The editable draft. This is the text updatePurchasingPolicy writes.
          type: object
          properties:
            content:
              description: The Markdown body of the purchasing policy.
              type: string
          required:
            - content
          additionalProperties: false
        published:
          description: >-
            The published text the AI agent sees at runtime, or null if never
            published. Diff it against the draft to surface pending edits.
          anyOf:
            - type: object
              properties:
                content:
                  description: The Markdown body of the purchasing policy.
                  type: string
              required:
                - content
              additionalProperties: false
            - type: 'null'
      required:
        - id
        - status
        - draft
        - published
      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.