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

# Set ticket info on an intake item

> Called by Zapier after a support ticket is created or
updated. Can set ticket ID/URL, change status, and reassign the
owner — all in a single call.

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




## OpenAPI

````yaml /openapi/private/specs/services/services-integrations.yml post /intake/set-ticket
openapi: 3.1.0
info:
  title: SageScreen — Intake & Pipedrive Integrations
  version: 1.0.0
servers:
  - url: https://{domain}/wp-json/sagescreen/v1
    description: WordPress REST API
    variables:
      domain:
        default: sagescreen.app
security: []
tags:
  - name: Intake
    description: Sales intake item endpoints
  - name: Account Created
    description: |
      Find-or-create person, org, and deal in Pipedrive.
      Fired for four WP events:
      - Demo signup (candidate, no WP user)
      - Trial account created (council_admin, new council)
      - Paid account created (council_admin, new council)
      - Council user added (any role added to existing council)
  - name: Quote Sync
    description: |
      Advance the Pipedrive deal stage.
      Fired for two WP events:
      - Demo completed (candidate views results for first time)
      - Trial complete (council upgrades from trial to paid)
paths:
  /intake/set-ticket:
    post:
      tags:
        - Intake
      summary: Set ticket info on an intake item
      description: |
        Called by Zapier after a support ticket is created or
        updated. Can set ticket ID/URL, change status, and reassign the
        owner — all in a single call.

        Requires the `X-API-Key` header (Zapier API key from plugin settings).
      operationId: intakeSetTicket
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetTicketRequest'
            examples:
              linkTicket:
                summary: Link a support ticket
                value:
                  intake_item_id: 4821
                  ticket_id: TKT-00312
                  ticket_url: https://support.sagescreen.com/tickets/312
              escalate:
                summary: Escalate an item
                value:
                  intake_item_id: 4821
                  status: intake_escalated
              closeViaStatusId:
                summary: Close via status_id
                value:
                  intake_item_id: 4821
                  status_id: 4
              reassignByEmail:
                summary: Reassign by email
                value:
                  intake_item_id: 4821
                  assignee_email: jane@example.com
      responses:
        '200':
          description: Ticket info updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetTicketResponse'
              example:
                success: true
                data:
                  intake_item_id: 4821
                  ticket_id: TKT-00312
                  ticket_url: https://support.sagescreen.com/tickets/312
                  status: intake_escalated
                  new_owner_id: 5
        '400':
          description: Bad request — missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              examples:
                missingId:
                  summary: No item identifier provided
                  value:
                    code: missing_intake_item_id
                    message: intake_item_id is required
                    data:
                      status: 400
                missingAction:
                  summary: No actionable fields provided
                  value:
                    code: missing_params
                    message: >-
                      At least one of ticket_id, ticket_url, status, status_id,
                      new_owner_id, or assignee_email is required
                    data:
                      status: 400
                invalidStatus:
                  summary: Invalid status value
                  value:
                    code: invalid_status
                    message: >-
                      status must be one of: intake_open, intake_done,
                      intake_escalated
                    data:
                      status: 400
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              example:
                code: invalid_api_key
                message: Invalid or missing API key
                data:
                  status: 401
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              examples:
                itemNotFound:
                  summary: Intake item does not exist
                  value:
                    code: not_found
                    message: Intake item not found
                    data:
                      status: 404
                userNotFoundByEmail:
                  summary: Assignee email not found
                  value:
                    code: user_not_found
                    message: 'No user found with email: missing@example.com'
                    data:
                      status: 404
                userNotFoundById:
                  summary: New owner user ID not found
                  value:
                    code: user_not_found
                    message: 'New owner user not found: 9999'
                    data:
                      status: 404
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPError'
              examples:
                notConfigured:
                  summary: API key not configured in settings
                  value:
                    code: api_not_configured
                    message: Zapier API key not configured
                    data:
                      status: 500
                setFailed:
                  summary: Internal write failure
                  value:
                    code: set_ticket_failed
                    message: Failed to set ticket info
                    data:
                      status: 500
      security:
        - apiKey: []
components:
  schemas:
    SetTicketRequest:
      type: object
      description: |
        `intake_item_id` and at least one action field must be provided.
      properties:
        intake_item_id:
          type: integer
          description: WordPress post ID of the intake item
          examples:
            - 4821
        ticket_id:
          type: string
          description: Support ticket ID to store
          examples:
            - TKT-00312
        ticket_url:
          type: string
          format: uri
          description: Support ticket URL to store
          examples:
            - https://support.sagescreen.com/tickets/312
        status:
          $ref: '#/components/schemas/IntakeStatus'
        status_id:
          type: integer
          description: |
            Support-tool numeric status. Mapped to IntakeStatus:
            `4` or `5` → `intake_done`, anything else → `intake_escalated`.
            Ignored if `status` is also provided.
          examples:
            - 4
        new_owner_id:
          type: integer
          description: WordPress user ID to reassign to
          examples:
            - 5
        assignee_email:
          type: string
          format: email
          description: Email to look up the new owner user
          examples:
            - jane@example.com
    SetTicketResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          properties:
            intake_item_id:
              type: integer
              examples:
                - 4821
            ticket_id:
              type: string
              description: Present only if provided in request
              examples:
                - TKT-00312
            ticket_url:
              type: string
              description: Present only if provided in request
              examples:
                - https://support.sagescreen.com/tickets/312
            status:
              $ref: '#/components/schemas/IntakeStatus'
            new_owner_id:
              type: integer
              description: Present only if reassignment occurred
              examples:
                - 5
    WPError:
      type: object
      description: Standard WordPress REST API error envelope
      required:
        - code
        - message
        - data
      properties:
        code:
          type: string
          description: Machine-readable error code
          examples:
            - not_found
        message:
          type: string
          description: Human-readable error message
          examples:
            - Intake item not found
        data:
          type: object
          required:
            - status
          properties:
            status:
              type: integer
              description: HTTP status code
              examples:
                - 404
    IntakeStatus:
      type: string
      enum:
        - intake_open
        - intake_done
        - intake_escalated
      description: Custom post status for `ss_intake_item`
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Zapier API key stored in `ss_zapier_api_key` option

````