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

# Update council data from Zapier

> Partially updates a council. All fields are optional — only provided
fields are changed.

Supports updating: name, phone, address, Pipedrive company ID, and
credit adjustments (add/subtract screen or sage credits).

Phone numbers are stripped to digits; 10-digit US numbers get `1`
prepended automatically.

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




## OpenAPI

````yaml /openapi/private/specs/wp/wp-webhooks.yml patch /zapier/council/{id}
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:
  /zapier/council/{id}:
    patch:
      tags:
        - Council – REST
      summary: Update council data from Zapier
      description: |
        Partially updates a council. All fields are optional — only provided
        fields are changed.

        Supports updating: name, phone, address, Pipedrive company ID, and
        credit adjustments (add/subtract screen or sage credits).

        Phone numbers are stripped to digits; 10-digit US numbers get `1`
        prepended automatically.

        Requires the `X-API-Key` header (Zapier API key).
      operationId: zapierUpdateCouncil
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: WordPress post ID (numeric) or council_id UUID
            examples:
              - '123'
              - c9d8e7f6-5a4b-3c2d-1e0f-a1b2c3d4e5f6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ZapierUpdateCouncilRequest'
            example:
              name: Greenville City Council
              phone: (800) 555-1234
              address:
                line1: 123 Main St
                city: Greenville
                state: SC
                postal_code: '29601'
                country: US
              credits:
                type: credits
                action: add
                amount: 10
      responses:
        '200':
          description: Council updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZapierUpdateCouncilResponse'
              example:
                success: true
                data:
                  council_id: c9d8e7f6-5a4b-3c2d-1e0f-a1b2c3d4e5f6
                  post_id: 123
                  updated:
                    name: Greenville City Council
                    phone: '18005551234'
                    address:
                      line1: 123 Main St
                      city: Greenville
                      state: SC
                      postal_code: '29601'
                      country: US
                    credits:
                      type: credits
                      action: add
                      amount: 10
                      running_balance: 60
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouncilPublicWPError'
              example:
                code: invalid_api_key
                message: Invalid or missing API key
                data:
                  status: 401
        '404':
          description: Council not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouncilPublicWPError'
              example:
                code: council_not_found
                message: Council not found
                data:
                  status: 404
        '500':
          description: API key not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouncilPublicWPError'
              example:
                code: api_not_configured
                message: Zapier API key not configured
                data:
                  status: 500
      security:
        - apiKey: []
components:
  schemas:
    ZapierUpdateCouncilRequest:
      type: object
      description: Partial update payload for council
      properties:
        name:
          type: string
          description: New council name (updates post_title)
          examples:
            - Greenville City Council
        phone:
          type: string
          description: Phone number (any format — stripped to digits)
          examples:
            - (800) 555-1234
        address:
          type: object
          properties:
            line1:
              type: string
              examples:
                - 123 Main St
            line2:
              type: string
              examples:
                - Suite 100
            city:
              type: string
              examples:
                - Greenville
            state:
              type: string
              examples:
                - SC
            postal_code:
              type: string
              examples:
                - '29601'
            country:
              type: string
              examples:
                - US
        pipedrive_company_id:
          type: string
          description: External Pipedrive CRM company ID
          examples:
            - '12345'
        credits:
          type: object
          required:
            - type
            - action
            - amount
          description: Credit adjustment
          properties:
            type:
              type: string
              enum:
                - credits
                - sage
              description: Credit type to adjust
              examples:
                - credits
            action:
              type: string
              enum:
                - add
                - subtract
              description: Adjustment direction
              examples:
                - add
            amount:
              type: integer
              minimum: 1
              description: Number of credits (positive integer)
              examples:
                - 10
    ZapierUpdateCouncilResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          required:
            - council_id
            - post_id
            - updated
          properties:
            council_id:
              type: string
              format: uuid
              examples:
                - c9d8e7f6-5a4b-3c2d-1e0f-a1b2c3d4e5f6
            post_id:
              type: integer
              examples:
                - 123
            updated:
              type: object
              description: |
                Contains only the fields that were actually changed.
                Each key mirrors the request field name.
              properties:
                name:
                  type: string
                  examples:
                    - Greenville City Council
                phone:
                  type: string
                  description: Digits only (formatted from input)
                  examples:
                    - '18005551234'
                address:
                  type: object
                  properties:
                    line1:
                      type: string
                    line2:
                      type: string
                    city:
                      type: string
                    state:
                      type: string
                    postal_code:
                      type: string
                    country:
                      type: string
                pipedrive_company_id:
                  type: string
                  examples:
                    - '12345'
                credits:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - credits
                        - sage
                    action:
                      type: string
                      enum:
                        - add
                        - subtract
                    amount:
                      type: integer
                      examples:
                        - 10
                    running_balance:
                      type: integer
                      description: New balance after adjustment
                      examples:
                        - 60
    CouncilPublicWPError:
      type: object
      description: WordPress REST API error envelope
      required:
        - code
        - message
        - data
      properties:
        code:
          type: string
          examples:
            - council_not_found
        message:
          type: string
          examples:
            - Council 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

````