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

# Store Pipedrive contact ID on a WordPress user

> Called by Zapier after a contact is created in Pipedrive. Stores the
ID as `pipedrive_contact_id` user meta.

Requires the `X-API-Key` header matching `ss_zapier_api_key`.




## OpenAPI

````yaml /openapi/private/specs/wp/wp-webhooks.yml post /pipedrive/set-contact-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:
  /pipedrive/set-contact-id:
    post:
      tags:
        - Billing – Pipedrive
      summary: Store Pipedrive contact ID on a WordPress user
      description: |
        Called by Zapier after a contact is created in Pipedrive. Stores the
        ID as `pipedrive_contact_id` user meta.

        Requires the `X-API-Key` header matching `ss_zapier_api_key`.
      operationId: pipedriveSetContactId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipedriveSetContactIdRequest'
            example:
              user_id: 123
              pipedrive_contact_id: pd-c-123
      responses:
        '200':
          description: Contact ID stored
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipedriveSetContactIdResponse'
              example:
                success: true
                data:
                  user_id: 123
                  pipedrive_contact_id: pd-c-123
        '400':
          description: Missing required field
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              examples:
                missingUserId:
                  summary: user_id not provided
                  value:
                    code: missing_user_id
                    message: user_id is required
                    data:
                      status: 400
                missingContactId:
                  summary: pipedrive_contact_id not provided
                  value:
                    code: missing_pipedrive_contact_id
                    message: pipedrive_contact_id is required
                    data:
                      status: 400
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: unauthorized
                message: Invalid or missing API key
                data:
                  status: 401
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: user_not_found
                message: No user found with ID 9999
                data:
                  status: 404
      security:
        - apiKey: []
components:
  schemas:
    PipedriveSetContactIdRequest:
      type: object
      required:
        - user_id
        - pipedrive_contact_id
      properties:
        user_id:
          type: integer
          description: WordPress user ID
          examples:
            - 123
        pipedrive_contact_id:
          type: string
          description: Pipedrive contact ID to store as user meta
          examples:
            - pd-c-123
    PipedriveSetContactIdResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
          examples:
            - true
        data:
          type: object
          required:
            - user_id
            - pipedrive_contact_id
          properties:
            user_id:
              type: integer
              examples:
                - 123
            pipedrive_contact_id:
              type: string
              examples:
                - pd-c-123
    WPError:
      type: object
      description: Standard WordPress REST API error envelope
      required:
        - code
        - message
        - data
      properties:
        code:
          type: string
          description: Machine-readable error code
          examples:
            - invalid_api_key
        message:
          type: string
          description: Human-readable error message
          examples:
            - Invalid or missing API key
        data:
          type: object
          required:
            - status
          properties:
            status:
              type: integer
              description: HTTP status code
              examples:
                - 401
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: SageScreen API key stored in `ss_zapier_api_key` option

````