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

# Deal approval callback (Zapier)

> Called by Zapier after a CFO approves or rejects a pending deal.
When `approved` is true the deal transitions to `ss_approved`; when false
it reverts to `draft` and an intake item is created for follow-up.

Requires the `X-API-Key` header (Zapier API key from plugin settings).




## OpenAPI

````yaml /openapi/private/specs/wp/wp-webhooks.yml post /deal/approve
openapi: 3.1.0
info:
  title: >-
    SageScreen — Webhooks & CRM Integrations (Billing · Council · User · Deal ·
    Sage)
  version: 1.0.0
servers:
  - url: https://{domain}/wp-json/sagescreen/v1
    description: WordPress REST API
    variables:
      domain:
        default: api.sagescreen.app
security: []
tags:
  - name: Billing – Stripe
    description: Stripe webhook and subscription endpoints
  - name: Billing – Broadcast
    description: Postmark broadcast unsubscribe endpoint
  - name: Billing – Pipedrive
    description: Pipedrive CRM ID set-* webhook endpoints (called by Zapier)
  - name: Billing – AJAX
    description: Credit ledger, reactivation, and portal AJAX endpoints
  - name: Council – REST
    description: Zapier-facing REST endpoints for council data sync
  - name: Council – AJAX
    description: Council user and sage management AJAX endpoints
  - name: User – REST
    description: Zapier-facing REST endpoints
  - name: User – AJAX
    description: Council user management AJAX endpoints
  - name: User – Profile
    description: Self-service profile updates
  - name: Deal REST
    description: REST API endpoints authenticated via X-API-Key
  - name: Deal AJAX
    description: AJAX endpoints authenticated via WordPress nonce + capability check
  - name: Sage – REST
    description: REST API endpoints for sage operations and Python callbacks
  - name: Sage – CRUD
    description: AJAX endpoints for sage creation, editing, and status management
  - name: Sage – Build Workflow
    description: AJAX endpoints for the multi-step sage build process
paths:
  /deal/approve:
    post:
      tags:
        - Deal REST
      summary: Deal approval callback (Zapier)
      description: >
        Called by Zapier after a CFO approves or rejects a pending deal.

        When `approved` is true the deal transitions to `ss_approved`; when
        false

        it reverts to `draft` and an intake item is created for follow-up.


        Requires the `X-API-Key` header (Zapier API key from plugin settings).
      operationId: dealApprove
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DealApproveRequest'
            examples:
              approve:
                summary: CFO approves the deal
                value:
                  deal_uuid: 3d55ae7a-af8b-46c1-ae1c-09afa207ac7f
                  approved: true
                  external_quote_id: QU-00412
              reject:
                summary: CFO rejects the deal
                value:
                  deal_uuid: 3d55ae7a-af8b-46c1-ae1c-09afa207ac7f
                  approved: false
                  note: Pricing too aggressive for this tier.
      responses:
        '200':
          description: Deal status updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealApproveResponse'
              examples:
                approved:
                  summary: Deal approved
                  value:
                    success: true
                    data:
                      deal_id: 1042
                      status: ss_approved
                rejected:
                  summary: Deal rejected by CFO
                  value:
                    success: true
                    data:
                      deal_id: 1042
                      status: draft
                      reason: cfo_rejected
        '400':
          description: Bad request — missing UUID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealPublicWPError'
              example:
                code: missing_uuid
                message: deal_uuid is required
                data:
                  status: 400
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealPublicWPError'
              example:
                code: invalid_api_key
                message: Invalid or missing API key
                data:
                  status: 401
        '404':
          description: Deal not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealPublicWPError'
              example:
                code: deal_not_found
                message: Deal not found
                data:
                  status: 404
        '409':
          description: Deal is not in the expected status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealPublicWPError'
              example:
                code: invalid_status
                message: 'Deal is not pending approval (current: ss_approved)'
                data:
                  status: 409
        '500':
          description: API key not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealPublicWPError'
              example:
                code: key_not_configured
                message: API key not configured on server
                data:
                  status: 500
      security:
        - apiKey: []
components:
  schemas:
    DealApproveRequest:
      type: object
      required:
        - deal_uuid
      properties:
        deal_uuid:
          type: string
          format: uuid
          description: UUID of the deal to approve/reject
          examples:
            - 3d55ae7a-af8b-46c1-ae1c-09afa207ac7f
        approved:
          type: boolean
          description: true to approve, false to reject
          examples:
            - true
        external_quote_id:
          type: string
          description: Quote reference (stored as meta)
          examples:
            - QU-00412
        note:
          type: string
          description: CFO rejection note (only used when approved=false)
          examples:
            - Pricing too aggressive for this tier.
    DealApproveResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          properties:
            deal_id:
              type: integer
              examples:
                - 1042
            status:
              type: string
              description: New deal status (ss_approved or draft)
              examples:
                - ss_approved
            reason:
              type: string
              description: Present only when rejected
              examples:
                - cfo_rejected
    DealPublicWPError:
      type: object
      description: Standard WordPress REST API error envelope
      required:
        - code
        - message
        - data
      properties:
        code:
          type: string
          description: Machine-readable error code
          examples:
            - deal_not_found
        message:
          type: string
          description: Human-readable error message
          examples:
            - Deal not found
        data:
          type: object
          required:
            - status
          properties:
            status:
              type: integer
              description: HTTP status code
              examples:
                - 404
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: SageScreen API key stored in `ss_zapier_api_key` option

````