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

# Search tickets

> Performs full text & faceted search over tickets. Use `preset_filter` to apply one of the predefined filter sets. Use `custom_preset_filter` (UUID) to apply a saved custom filter. Filter by tag with `tags` (repeat for OR matching). Filter by assignee with `assignee` (organization user ID).



## OpenAPI

````yaml https://api.initdesk.com/schema.yaml get /organizations/{organization_id}/search/
openapi: 3.0.3
info:
  title: initdesk Customer API
  version: 1.19.0
  description: OpenAPI documentation for the customer-facing API served by the gateway.
servers:
  - url: https://api.initdesk.com
    description: Customer API gateway
security:
  - IntegrationToken: []
tags:
  - name: Organizations
    description: Organization metadata and context for all other resources.
  - name: Customers
    description: >-
      End users (requesters) scoped to the organization. Tickets reference
      customers by ID.
  - name: Tickets
    description: >-
      Tickets, messages, attachments, search, and statuses. A ticket is the
      conversation container; messages are nested under
      `/tickets/{pk}/messages/`.
  - name: Custom Preset Filters
    description: >-
      Saved ticket search filters scoped to the organization. Integration tokens
      receive organization-shared filters only.
  - name: Inboxes
    description: >-
      Organization mailboxes for routing tickets. Each inbox has an email prefix
      and optional default-inbox flag (is_default: true). On ticket create,
      inbox_id is optional: omit to use the default inbox, or provide an inbox
      ID to target a specific mailbox.
  - name: Tags
    description: Organization-scoped ticket tags with id, name, and optional color.
  - name: Help Center
    description: >-
      Support portal settings, knowledge base collections, articles, and article
      search.
paths:
  /organizations/{organization_id}/search/:
    get:
      tags:
        - Tickets
      summary: Search tickets
      description: >-
        Performs full text & faceted search over tickets. Use `preset_filter` to
        apply one of the predefined filter sets. Use `custom_preset_filter`
        (UUID) to apply a saved custom filter. Filter by tag with `tags` (repeat
        for OR matching). Filter by assignee with `assignee` (organization user
        ID).
      operationId: search_tickets
      parameters:
        - in: query
          name: assignee
          schema:
            type: integer
          description: Filter tickets assigned to the given organization user ID.
        - in: query
          name: channel
          schema:
            type: string
          description: Filter by conversation channel type (e.g. email).
        - in: query
          name: custom_preset_filter
          schema:
            type: string
          description: >-
            Apply a saved custom preset filter by UUID. Integration tokens may
            only use organization-shared filters.
        - in: query
          name: email
          schema:
            type: string
          description: Filter by customer email (case-insensitive exact match).
        - in: query
          name: is_spam
          schema:
            type: boolean
          description: >-
            When omitted defaults to false. Pass true to include only spam
            tickets. Accepted values: true, false (case-insensitive).
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
        - in: query
          name: preset_filter
          schema:
            type: string
            enum:
              - focused
              - needs_attention
          description: 'Apply a predefined filter. Allowed values: needs_attention, focused'
        - in: query
          name: query
          schema:
            type: string
          description: Full-text search query. Alias for `search`.
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: >-
            Filter by tag name (case-insensitive). Repeat the parameter to match
            tickets with any of the listed tags (e.g. `?tags=urgent&tags=vip`).
        - in: query
          name: waiting_on
          schema:
            type: string
            enum:
              - ''
              - associate
              - customer
          description: Filter by waiting_on status.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTicketSearchList'
          description: ''
      security:
        - IntegrationToken: []
components:
  schemas:
    PaginatedTicketSearchList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/TicketSearch'
    TicketSearch:
      type: object
      description: A dynamic DocumentSerializer class.
      properties:
        id:
          type: integer
        public_id:
          type: string
        channel:
          allOf:
            - $ref: '#/components/schemas/TicketChannel'
          readOnly: true
          nullable: true
        customer:
          allOf:
            - $ref: '#/components/schemas/Customer'
          readOnly: true
        inbox:
          allOf:
            - $ref: '#/components/schemas/TicketInbox'
          readOnly: true
        assignee:
          allOf:
            - $ref: '#/components/schemas/AssigneeSearch'
          readOnly: true
          nullable: true
        subject:
          type: string
        status:
          enum:
            - created
            - active
            - closed
          type: string
          description: |-
            * `created` - Created
            * `active` - Active
            * `closed` - Closed
          x-spec-enum-id: 786352f031cd9dcc
          readOnly: true
        waiting_on:
          enum:
            - ''
            - customer
            - associate
          type: string
          description: |-
            * `` - (none)
            * `customer` - Customer
            * `associate` - Associate
          x-spec-enum-id: 1b01ac3e125d3656
          readOnly: true
        summary:
          type: string
        classification:
          enum:
            - ''
            - no_response
            - customer_inactivity
            - resolved
            - invalid
            - other
          type: string
          description: |-
            * `` - (pending)
            * `no_response` - No Response
            * `customer_inactivity` - Customer Inactivity
            * `resolved` - Resolved
            * `invalid` - Invalid
            * `other` - Other
          x-spec-enum-id: 4fafa904badf8649
          readOnly: true
        short_description:
          type: string
          nullable: true
          readOnly: true
        sentiment_analysis_class:
          enum:
            - positive
            - negative
            - neutral
            - pending
          type: string
          description: |-
            * `positive` - Positive
            * `negative` - Negative
            * `neutral` - Neutral
            * `pending` - Pending
          x-spec-enum-id: fead30f480c5a929
          readOnly: true
        customer_visible_reply_count:
          type: integer
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        resolved_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        language:
          type: string
        origin:
          type: string
        is_spam:
          type: boolean
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TicketTag'
          readOnly: true
        has_attachments:
          type: boolean
      required:
        - assignee
        - channel
        - classification
        - created_at
        - customer
        - customer_visible_reply_count
        - has_attachments
        - id
        - inbox
        - is_spam
        - language
        - origin
        - public_id
        - resolved_at
        - sentiment_analysis_class
        - short_description
        - status
        - subject
        - summary
        - tags
        - updated_at
        - waiting_on
    TicketChannel:
      type: object
      properties:
        type:
          type: string
          readOnly: true
        connection_id:
          type: integer
          readOnly: true
      required:
        - connection_id
        - type
    Customer:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        is_spam:
          type: boolean
          description: If true, emails from this customer are marked as spam
      required:
        - id
        - name
    TicketInbox:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          title: Inbox Name
        email_prefix:
          type: string
          readOnly: true
        customer_interaction_style:
          enum:
            - helpdesk
            - conversational
          type: string
          x-spec-enum-id: b8814c0c94798024
          readOnly: true
          description: >-
            Helpdesk exposes ticket numbers in customer emails and messages;
            conversational keeps interactions natural without ticket references.


            * `helpdesk` - Helpdesk

            * `conversational` - Conversational
      required:
        - customer_interaction_style
        - email_prefix
        - id
        - name
    AssigneeSearch:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
          format: email
    TicketTag:
      type: object
      description: Read-only tag payload embedded on ticket list/detail/search responses.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        color:
          type: string
          readOnly: true
      required:
        - color
        - id
        - name
  securitySchemes:
    IntegrationToken:
      type: apiKey
      in: header
      name: X-Initdesk-Token

````