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

# Search all

> Search across orders, patients, prescribers, products and tasks.



## OpenAPI

````yaml /openapi-public.yml get /api/v1/search
openapi: 3.0.3
info:
  title: Blend API
  version: 1.0.0
  description: API for Blend
servers:
  - url: https://api.byblend.com
    description: Blend production server
security:
  - bearerAuth: []
tags:
  - name: Orders
    description: Order management endpoints
  - name: Patients
    description: Patient management endpoints
  - name: Reports
    description: Reporting endpoints
  - name: Products and Materials
    description: Product catalog and inventory endpoints
  - name: Electronic Prescriptions
    description: Electronic prescription management endpoints
  - name: Prescriptions
    description: Prescription management endpoints
  - name: Authentication
    description: Authentication endpoints
  - name: Notifications
    description: User management endpoints
  - name: Prescribers
paths:
  /api/v1/search:
    get:
      tags:
        - Search
      summary: Search all
      description: Search across orders, patients, prescribers, products and tasks.
      parameters:
        - name: q
          in: query
          schema:
            type: string
            example: '1234567890'
            description: >
              Search query. Enclose phrases in URL-escaped quotes to search for
              an exact phrase, e.g. "Joe Public."  Searchable fields include ID,
              order number, name, email, phone, prescriber identifiers, product
              name and SKU. Substring search is supported for all fields.
          required: true
        - name: limit
          in: query
          required: false
          description: >-
            Optional limit on the number of results to return. Max is 100,
            default is 50.
          schema:
            type: integer
            example: 100
      responses:
        '200':
          description: >
            Successful response with array of search results, ordered by
            relevance.  The `result_type` in each item is one of `order`,
            `patient`, `prescriber`, `prescription`, `non_prescription`,
            `order_material`, or `task`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      anyOf:
                        - title: Patient
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  example: patient
                            - $ref: '#/components/schemas/PatientFull'
                        - title: Order
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  enum:
                                    - order
                                is_patient_order:
                                  type: boolean
                                  example: true
                                  description: >-
                                    If the result matched on the order's
                                    patient.
                            - $ref: '#/components/schemas/Order'
                        - title: Prescriber
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  enum:
                                    - prescriber
                            - $ref: '#/components/schemas/PrescriberFull'
                        - title: Prescription product
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  enum:
                                    - prescription
                            - $ref: '#/components/schemas/ProductPrescriptionFull'
                        - title: Non-prescription product
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  enum:
                                    - non_prescription
                            - $ref: '#/components/schemas/ProductNonPrescriptionFull'
                        - title: Order material
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  enum:
                                    - order_material
                            - $ref: '#/components/schemas/ProductOrderMaterialFull'
                        - title: Task
                          type: object
                          allOf:
                            - $ref: '#/components/schemas/SearchRank'
                            - type: object
                              properties:
                                result_type:
                                  type: string
                                  enum:
                                    - task
                            - $ref: '#/components/schemas/TaskFull'
components:
  schemas:
    SearchRank:
      type: object
      properties:
        rank:
          type: number
          example: 0.7
          description: >-
            Ranking score of the search result, from 0 to 1, indicating
            relevance to the search query
    PatientFull:
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - $ref: '#/components/schemas/PatientBase'
        - type: object
          properties:
            is_minor:
              type: boolean
              example: false
              description: >-
                Whether the patient is a minor. Automatically calculated based
                on date of birth.
    Order:
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          properties:
            address:
              $ref: '#/components/schemas/Address'
            custom_shipping:
              $ref: '#/components/schemas/OrderCustomShipping'
              description: >-
                Custom shipping details for the order if your account has custom
                shipping enabled, and you have provided prepaid label details.
            customer_id:
              type: string
              format: uuid
              example: b658f16f-819c-4503-aede-bd555fc4ebfb
            external_id:
              type: string
              example: my-system-128318AA2
              description: External (your own system's) ID associated with the order.
            is_replacement:
              type: boolean
              example: false
              description: Whether the order is a replacement order
            order_number:
              type: string
              example: ORD250312003548IAU4
              description: Friendlier identifier for the order. Auto-generated.
            original_order_id:
              type: string
              format: uuid
              example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
              description: ID of the original order, if this is a replacement order
            patient:
              $ref: '#/components/schemas/PatientOrder'
            prescription_count:
              type: integer
              example: 1
              description: >-
                Number of prescriptions associated with the order (expected to
                be the same as the number of prescription products in the
                products object)
            priority_requested:
              type: boolean
              example: false
              description: Whether the order has a priority request
            cancellation_requested:
              type: boolean
              example: false
              description: >-
                Whether the customer has requested cancellation for an order in
                picked or verified status
            replacement_order_ids:
              type: array
              items:
                type: string
                format: uuid
                example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
                description: >-
                  IDs of any replacement orders, if they have been created from
                  this order
            replacement_reason:
              type: string
              example: Product arrived damaged
              description: If this is a replacement order, reason for the replacement
            replacement_requested:
              type: boolean
              example: false
              description: >-
                Whether the order has a replacement request. This field is
                deprecated and will be removed in a future version. Please use
                replacement_request_status instead.
            replacement_request_status:
              type: string
              example: pending
              description: Status of the replacement request
              enum:
                - pending
                - fulfilled
                - declined
                - cancelled
            replacement_requested_at:
              type: string
              example: '2025-01-01T00:00:00Z'
              description: Date and time a replacement request was made
            replacement_requested_reason:
              type: string
              example: Product arrived damaged
              description: Reason for the replacement request
            shipments:
              type: array
              items:
                $ref: '#/components/schemas/OrderShipment'
                description: >-
                  Once an order has been shipped, details on its shipment(s)
                  will be provided in this array.
            shipping:
              type: object
              properties:
                carrier:
                  type: string
                  example: usps
                  description: Desired shipment carrier.
                service_level:
                  type: string
                  example: usps_ground_advantage
                  description: Desired shipment service level.
            status:
              type: string
              example: received
    PrescriberFull:
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - $ref: '#/components/schemas/PrescriberBase'
        - type: object
          properties:
            addresses:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/ID'
                  - $ref: '#/components/schemas/Timestamps'
                  - $ref: '#/components/schemas/AddressCreate'
                  - type: object
                    properties:
                      type:
                        type: string
                        example: practice
                        description: Type of address, either 'practice' or 'working'
            qualifications:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/ID'
                  - $ref: '#/components/schemas/Timestamps'
                  - $ref: '#/components/schemas/PrescriberQualification'
            credentials:
              type: array
              items:
                $ref: '#/components/schemas/PrescriberCredential'
            restrictions:
              type: array
              items:
                $ref: '#/components/schemas/ProductPrescriptionSimple'
    ProductPrescriptionFull:
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - $ref: '#/components/schemas/ProductPrescription'
    ProductNonPrescriptionFull:
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - $ref: '#/components/schemas/ProductNonPrescription'
    ProductOrderMaterialFull:
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - $ref: '#/components/schemas/ProductOrderMaterial'
    TaskFull:
      type: object
      properties:
        id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        assignee:
          $ref: '#/components/schemas/User'
        completed_at:
          type: string
          format: date-time
          example: '2025-02-01T20:10:43Z'
        created_at:
          type: string
          format: date-time
          example: '2025-01-01T00:00:00Z'
        created_by_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        assignee_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        name:
          type: string
          example: Confirm shelf-stability of recent batch
        description:
          type: string
          example: >-
            Please find the most recent batch (April 2, 2025) of the topical
            rapamycin and confirm shelf-stability given the new expiration date
            of May 14, 2025.
        category_code:
          type: string
          example: T01
        category_name:
          type: string
          example: Order
        status_code:
          type: string
          example: NEW
        status_name:
          type: string
          example: New
        order_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        patient_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        prescription_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        watchers:
          type: array
          items:
            $ref: '#/components/schemas/User2'
    ID:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
    Timestamps:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: Date and time of creation
          example: '2025-03-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Date and time of last update
          example: '2025-03-15T12:00:00Z'
    PatientBase:
      type: object
      properties:
        first_name:
          type: string
          example: Willard
        middle_name:
          type: string
          example: Moises
        last_name:
          type: string
          example: Donnelly
        gender:
          type: string
          enum:
            - male
            - female
          example: male
          description: Gender of the patient
        email:
          type: string
          example: Harmon43@gmail.com
        phone:
          type: string
          description: 10-digit phone number without formatting, e.g. 6417383445
          example: '6417383445'
        date_of_birth:
          type: string
          format: date
          example: '1990-01-01'
        driver_license_number:
          type: string
          example: B49188319
        driver_license_state:
          type: string
          example: CA
        ssn:
          type: string
          example: '123456789'
          description: Social Security number. Can be provided with or without hyphens.
        primary_language:
          type: string
          description: ISO 639-1 language code
          example: en
        guardian_name:
          type: string
          description: Name of the patient's guardian. Required if patient is a minor.
          example: John Guardian
        guardian_phone:
          type: string
          example: '6417383445'
        guardian_email:
          type: string
          example: parent@example.com
        guardian_relationship:
          type: string
          description: >-
            Relationship of the guardian to the patient. See relationship types
            lookup for available values; most common are `parent` and
            `legal_guardian`; and `other` can be used.
          example: parent
        height_inches:
          type: integer
          example: 72
          description: Height of the patient in inches
        weight_pounds:
          type: integer
          example: 180
          description: Weight of the patient in pounds
        external_id:
          type: string
          example: '1234567890'
          description: >-
            External (your own) ID for the patient, to be used for prescription
            matching
        is_smoker:
          type: boolean
          example: false
          description: Whether the patient is a smoker
        is_diabetic:
          type: boolean
          example: false
          description: Whether the patient is diabetic
        is_pregnant:
          type: boolean
          example: false
          description: Whether the patient is pregnant
        receive_sms:
          type: boolean
          example: true
          description: >-
            Whether the patient should receive SMS notifications for shipments.
            This is only applicable if you have authorized Blend to send patient
            communications on your behalf.
        receive_email:
          type: boolean
          example: true
          description: >-
            Whether the patient should receive email notifications for
            shipments. This is only applicable if you have authorized Blend to
            send patient communications on your behalf.
        address:
          $ref: '#/components/schemas/AddressCreate'
    Address:
      allOf:
        - $ref: '#/components/schemas/ID'
        - type: object
          properties:
            address_1:
              type: string
              example: 140 Lindgren Streets
            address_2:
              type: string
              example: Apt 227
            city:
              type: string
              example: North Consueloburgh
            state:
              type: string
              description: Two-letter state abbreviation
              example: CA
            country:
              type: string
              description: Two-letter country code
              example: US
            type:
              type: string
              description: Type of address, if applicable
              example: shipping
            zip_code:
              type: string
              description: 5-digit ZIP code or ZIP+4 code, e.g. 02108 or 02108-1234
              example: '02108'
    OrderCustomShipping:
      type: object
      properties:
        label_url:
          type: string
          example: https://example.com/label.pdf
          description: URL of the printable (4x6) custom shipping label
        tracking_number:
          type: string
          example: TEST123456
          description: Tracking number from the custom shipping label
        tracking_url:
          type: string
          example: https://example.com/track/TEST123456
          description: Tracking URL of the custom shipping label
        carrier:
          type: string
          example: UPS
          description: Carrier of the custom shipping label
    PatientOrder:
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - $ref: '#/components/schemas/PatientBase'
    OrderShipment:
      type: object
      properties:
        carrier:
          type: string
          example: USPS
          description: Shipment carrier.
        created_at:
          type: string
          format: date-time
          example: '2026-04-17T18:31:05.175498'
          description: >-
            Date and time the package label was purchased and the item marked
            shipped.
        delivered_at:
          type: string
          format: date-time
          example: '2026-04-17T18:31:05.175498'
          description: Date and time the shipment was delivered.
        id:
          type: string
          format: uuid
          example: 0239CA06-9A71-4FFE-8A8D-5403540A19E7
          description: Blend internal shipment ID.
        service_level:
          type: string
          example: Ground Advantage
          description: Shipment service level.
        status:
          type: string
          example: shipped
          description: Status of the shipment.
          enum:
            - shipped
            - cancelled
            - delivered
        tracking_number:
          type: string
          example: '9200190347375200467807'
          description: Tracking number for the shipment.
        tracking_url:
          type: string
          example: >-
            https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9200190347375200467807
          description: Tracking URL for the shipment.
    PrescriberBase:
      type: object
      properties:
        first_name:
          type: string
          example: Willard
        middle_name:
          type: string
          example: Moises
        last_name:
          type: string
          example: Donnelly
        email:
          type: string
          example: Harmon43@gmail.com
        phone:
          type: string
          description: 10-digit phone number without formatting, e.g. 6417383445
          example: '6417383445'
        date_of_birth:
          type: string
          format: date
          example: '1990-01-01'
        gender:
          type: string
          example: Male
          description: Gender of the prescriber
        npi:
          type: string
          example: '1234567890'
          description: National Provider Identifier
        dea:
          type: string
          description: DEA Registration Number
          example: F91234563
        spi:
          type: string
          description: Surescripts Provider ID
          example: 1234567890ABCDEF
        driver_license_number:
          type: string
          description: Driver's license number
          example: B49188319
        driver_license_state:
          type: string
          description: Two-letter state abbreviation
          example: CA
        is_active:
          type: boolean
          description: Whether the prescriber is currently active
          example: true
        credential_npi:
          type: string
          description: Direct credential text as provided by the NPI registry
          example: M.D./Ph.D
    AddressCreate:
      type: object
      required:
        - address_1
        - city
        - state
        - zip_code
      properties:
        address_1:
          type: string
          example: 140 Lindgren Streets
        address_2:
          type: string
          example: Apt 227
        city:
          type: string
          example: North Consueloburgh
        state:
          type: string
          description: Two-letter state abbreviation
          example: CA
        country:
          type: string
          description: Two-letter country code, defaults to US
          example: US
        zip_code:
          type: string
          description: 5-digit ZIP code or 9-digit ZIP+4 code, e.g. 02108 or 02108-1234.
          example: '02108'
    PrescriberQualification:
      type: object
      properties:
        state:
          type: string
          example: CA
        license_number:
          type: string
          example: '1234567890'
          description: >-
            License number for the prescriber in this state. Note that when a
            state qualification is updated with a new license number, the old
            qualification will be automatically deactivated.
        description:
          type: string
          example: Nurse Practitioner, Family
          description: Description of the license qualification
        expiration_date:
          type: string
          format: date
          example: '2025-03-15'
        is_active:
          type: boolean
          example: true
      required:
        - state
        - license_number
    PrescriberCredential:
      type: object
      properties:
        credential_code:
          type: string
          example: MD
        credential_name:
          type: string
          example: Doctor of Medicine
    ProductPrescriptionSimple:
      type: object
      allOf:
        - $ref: '#/components/schemas/ID'
        - type: object
          properties:
            name:
              type: string
              example: Mupirocin
            sku:
              type: string
              example: '1234567890'
    ProductBase:
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          properties:
            sku:
              type: string
              example: '1234567890'
              description: Unique inventory identifier for the product
    ProductPrescription:
      type: object
      properties:
        name:
          type: string
          example: Mupirocin
        description:
          type: string
          example: A topical cream that is used to treat skin infections.
        product_code:
          type: string
          example: SUPERSPRAY15
          description: >-
            Customer reference for the product for use in electronic
            prescriptions.
        form:
          type: string
          example: cream
          description: Optional form of the product for customer use, if desired.
        is_active:
          type: boolean
          example: true
          description: Whether the product is currently active for purchase or prescription
        label_orientation:
          type: string
          example: portrait
          description: >-
            Orientation of the printed product label, either `portrait` or
            `landscape`.
        strength:
          type: string
          example: 1%
          description: Optional strength of the product for customer use, if desired.
    ProductNonPrescription:
      type: object
      properties:
        name:
          type: string
          example: Krill Farms Fish Oil
        description:
          type: string
          example: A fish oil supplement complementary to prescribed products.
        form:
          type: string
          example: liquid
          description: Optional form of the product for customer use, if desired.
        is_active:
          type: boolean
          example: true
          description: Whether the product is currently active for purchase
    ProductOrderMaterial:
      type: object
      properties:
        name:
          type: string
          example: Referral Brochure
        description:
          type: string
          example: Customer brochure included in every shipment.
        category:
          type: string
          example: marketing
        current_stock:
          type: integer
          example: 927
        reorder_threshold:
          type: integer
          example: 100
        has_inventory:
          type: boolean
          example: true
          description: Whether the product has any inventory associated with it
        is_global:
          type: boolean
          example: false
          description: >-
            Whether the material is customer-specific or Blend-wide (e.g.
            regulatory inserts)
    User:
      type: object
      properties:
        id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
        first_name:
          type: string
          example: Rodrigo
        last_name:
          type: string
          example: Davis
        role:
          type: string
          example: admin
    User2:
      type: object
      properties:
        id:
          type: string
          example: 1326d1e5-ba9a-42b5-8fe2-38882aa65708
        first_name:
          type: string
          example: Daphne
        last_name:
          type: string
          example: Dafoe
        role:
          type: string
          example: admin
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````