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

# Start Docket Search

> Starts a new docket search for the given business UUID or person UUID.

By default, this endpoint executes synchronously and returns the completed
result. Send ``Prefer: respond-async`` to opt into asynchronous execution,
which returns ``202 Accepted`` immediately and delivers results via
webhooks or polling.



## OpenAPI

````yaml /api-reference/openapi.json post /docket_searches
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /docket_searches:
    post:
      tags:
        - Litigation & Bankruptcy
      summary: Start Docket Search
      description: >-
        Starts a new docket search for the given business UUID or person UUID.


        By default, this endpoint executes synchronously and returns the
        completed

        result. Send ``Prefer: respond-async`` to opt into asynchronous
        execution,

        which returns ``202 Accepted`` immediately and delivers results via

        webhooks or polling.
      operationId: start_docket_search_docket_searches_post
      parameters:
        - name: Prefer
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Request execution preference (RFC 7240). Use ``respond-async`` for
              asynchronous execution, ``wait=N`` to specify a synchronous
              timeout hint in seconds, or ``priority=low`` to route the task to
              the low-priority queue.
            examples:
              - respond-async
              - wait=30
              - priority=low
            title: Prefer
          description: >-
            Request execution preference (RFC 7240). Use ``respond-async`` for
            asynchronous execution, ``wait=N`` to specify a synchronous timeout
            hint in seconds, or ``priority=low`` to route the task to the
            low-priority queue.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/v1.BusinessDocketSearchRequest'
                - $ref: '#/components/schemas/v1.PersonDocketSearchRequest'
                - $ref: '#/components/schemas/v1.BusinessSearchDocketSearchRequest'
              title: Litigation/Bankruptcy Request Object
              description: >-
                The request object containing the business ID or person ID of
                the entity the litigation/bankruptcy search is going to be
                performed for
              examples:
                - type: Business
                  business_id: ea47aad1-3780-4096-9444-83da35de3494
                  options:
                    - Order.Litigations
                    - Order.Bankruptcy
                - type: Person
                  person_id: 1834d57a-4dd3-409d-b147-e7e9f132058f
                  options:
                    - Order.Litigations
                    - Order.Bankruptcy
                - type: BusinessSearch
                  business_search_id: 58e1908e-cb64-4e00-89ec-a31c2e27a20f
                  options:
                    - Order.Litigations
                    - Order.Bankruptcy
                  additional_search_entities:
                    - name: John Doe
                      type: Person
                    - name: Alt Name LLC
                      type: Business
      responses:
        '201':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1.DocketSearchResponse'
            application/vnd.baselayer.v1+json:
              schema:
                $ref: '#/components/schemas/v1.DocketSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    v1.BusinessDocketSearchRequest:
      properties:
        type:
          type: string
          const: Business
          title: Type
          default: Business
        business_id:
          type: string
          format: uuid
          title: Business Id
          description: ID of the business to search for.
        options:
          items:
            $ref: '#/components/schemas/DocketSearchOptions'
          type: array
          minItems: 1
          title: Options
          description: >-
            Options controlling which types of docket searches to run. Defaults
            to both civil litigations and bankruptcy. Use ['Order.Litigations']
            for civil dockets only, or ['Order.Bankruptcy'] for bankruptcy only.
          default:
            - Order.Litigations
            - Order.Bankruptcy
          examples:
            - - Order.Litigations
            - - Order.Bankruptcy
            - - Order.Litigations
              - Order.Bankruptcy
      additionalProperties: false
      type: object
      required:
        - business_id
      title: BusinessDocketSearchRequest (v1)
      description: Represents a docket business search request.
    v1.PersonDocketSearchRequest:
      properties:
        type:
          type: string
          const: Person
          title: Type
          default: Person
        person_id:
          type: string
          format: uuid
          title: Person Id
          description: ID of the person to search for.
        options:
          items:
            $ref: '#/components/schemas/DocketSearchOptions'
          type: array
          minItems: 1
          title: Options
          description: >-
            Options controlling which types of docket searches to run. Defaults
            to both civil litigations and bankruptcy. Use ['Order.Litigations']
            for civil dockets only, or ['Order.Bankruptcy'] for bankruptcy only.
          default:
            - Order.Litigations
            - Order.Bankruptcy
          examples:
            - - Order.Litigations
            - - Order.Bankruptcy
            - - Order.Litigations
              - Order.Bankruptcy
      additionalProperties: false
      type: object
      required:
        - person_id
      title: PersonDocketSearchRequest (v1)
      description: Represents a docket person search request.
    v1.BusinessSearchDocketSearchRequest:
      properties:
        type:
          type: string
          const: BusinessSearch
          title: Type
          default: BusinessSearch
        business_search_id:
          type: string
          format: uuid
          title: Business Search Id
          description: >-
            The ID of the completed business search the docket search task
            should be run against.
        options:
          items:
            $ref: '#/components/schemas/DocketSearchOptions'
          type: array
          minItems: 1
          title: Options
          description: >-
            Options controlling which types of docket searches to run. Defaults
            to both civil litigations and bankruptcy. Use ['Order.Litigations']
            for civil dockets only, or ['Order.Bankruptcy'] for bankruptcy only.
          default:
            - Order.Litigations
            - Order.Bankruptcy
          examples:
            - - Order.Litigations
            - - Order.Bankruptcy
            - - Order.Litigations
              - Order.Bankruptcy
        additional_search_entities:
          anyOf:
            - items:
                $ref: '#/components/schemas/v1.AdditionalDocketSearchEntityRequest'
              type: array
            - type: 'null'
          title: Additional Search Entities
          description: >-
            A list of additional entities to be searched along with the business
            search in the docket search.
          examples:
            - - name: John Doe
                type: Person
            - - name: Alt Name LLC
                type: Business
      additionalProperties: false
      type: object
      required:
        - business_search_id
      title: BusinessSearchDocketSearchRequest (v1)
      description: Represents a business search docket search request
    v1.DocketSearchResponse:
      description: Represents a docket search response.
      properties:
        id:
          description: ID of the docket search request
          format: uuid
          title: Id
          type: string
        search_entities:
          description: A list of entities searched in the docket search.
          items:
            $ref: '#/components/schemas/v1.AdditionalDocketSearchEntityResponse'
          title: Search Entities
          type: array
        business_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          default: null
          description: ID of the business the search was performed for
          title: Business Id
        person_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          default: null
          description: ID of the person the search was performed for
          title: Person Id
        business_search_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          default: null
          description: ID of the business search the docket search was performed for
          title: Business Search Id
        state:
          $ref: '#/components/schemas/v1.TaskState'
          description: State of the search request
        error:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Any errors that occurred during the docket search request.
          title: Error
        last_updated_at:
          description: Date the search was last updated
          format: date
          title: Last Updated At
          type: string
        dockets:
          description: A list of dockets associated with the search request.
          items:
            $ref: '#/components/schemas/v1.DocketResponse'
          title: Dockets
          type: array
      required:
        - id
        - search_entities
        - state
        - last_updated_at
        - dockets
      title: DocketSearchResponse (v1)
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocketSearchOptions:
      type: string
      enum:
        - Order.Litigations
        - Order.Bankruptcy
    v1.AdditionalDocketSearchEntityRequest:
      properties:
        name:
          description: The name of the entity to search for.
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        type:
          $ref: '#/components/schemas/BusinessOrPersonType'
          description: The type of the entity to search for.
      additionalProperties: false
      type: object
      required:
        - name
        - type
      title: AdditionalDocketSearchEntityRequest (v1)
      description: Represents a request to add an entity to a docket search.
    v1.AdditionalDocketSearchEntityResponse:
      properties:
        name:
          description: The name of the entity to search for.
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        type:
          $ref: '#/components/schemas/v1.BusinessOrPersonType'
          description: The type of the entity to search for.
        normalized_name:
          readOnly: true
          title: Normalized Name
          type: string
      required:
        - name
        - type
        - normalized_name
      title: AdditionalDocketSearchEntityResponse (v1)
      type: object
    v1.TaskState:
      enum:
        - PENDING
        - EXECUTING
        - COMPLETED
        - FAILED
        - CANCELLED
      title: TaskState
      type: string
    v1.DocketResponse:
      description: Represents a docket response.
      properties:
        id:
          description: ID of the docket
          format: uuid
          title: Id
          type: string
        docket_number:
          description: Unique identifier for the Docket in the given court system
          examples:
            - A19284
          title: Docket Number
          type: string
        court:
          description: Court in which the docket was filed
          examples:
            - Supreme Court of Orange County
          title: Court
          type: string
        state:
          anyOf:
            - $ref: '#/components/schemas/v1.CourtStateAbbreviation'
            - type: 'null'
          default: null
          description: State where the court is located (US for federal courts)
          examples:
            - CA
            - NY
            - US
        division:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Which court division
          examples:
            - Civil Court Division
          title: Division
        judges:
          default: []
          description: List of judges assigned to the docket
          examples:
            - - Honorable Paul Shaw
          items:
            type: string
          title: Judges
          type: array
        title:
          description: Title of the docket
          examples:
            - Doe v. City of New York
          title: Title
          type: string
        case_type:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Type of case
          examples:
            - Civil
            - Criminal
            - Bankruptcy
          title: Case Type
        status:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Status of the case
          examples:
            - Pending
          title: Status
        is_bankruptcy:
          description: Is the case a bankruptcy
          title: Is Bankruptcy
          type: boolean
        bankruptcy_type:
          anyOf:
            - $ref: '#/components/schemas/v1.BankruptcyType'
            - type: 'null'
          default: null
          description: If the docket is a bankruptcy, is it Chapter 7 or Chapter 11
          examples:
            - Chapter 7
            - Chapter 11
        date_filed:
          default: '1900-01-01'
          description: >-
            Date the case was filed.  In cases where the date is not provided,
            this will be set to 1900-01-01.
          format: date
          title: Date Filed
          type: string
        date_closed:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          default: null
          description: Date the case was closed or terminated, if known
          title: Date Closed
        last_synced_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: Datetime the case was last refreshed
          title: Last Synced At
        parties:
          default: []
          description: List of parties involved in the docket
          items:
            $ref: '#/components/schemas/v1.DocketParty'
          title: Parties
          type: array
        updates:
          default: []
          description: List of updates to the docket
          items:
            $ref: '#/components/schemas/v1.DocketUpdate'
          title: Updates
          type: array
        match_level:
          anyOf:
            - $ref: '#/components/schemas/v1.MatchType'
            - type: 'null'
          default: null
          deprecated: true
          description: >-
            The match level of the docket to the entity's name. Deprecated in
            favor of match_confidence.
        search_entity_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The name of the entity that the docket matched to
          title: Search Entity Name
        search_entity_type:
          anyOf:
            - $ref: '#/components/schemas/v1.BusinessOrPersonType'
            - type: 'null'
          default: null
          description: The type of the entity that the docket matched to
        match_confidence:
          anyOf:
            - $ref: '#/components/schemas/v1.DocketMatchConfidenceResponse'
            - type: 'null'
          default: null
          description: >-
            Confidence level and signals that the docket is associated with the
            search subject. 
        risk_level:
          anyOf:
            - $ref: '#/components/schemas/v1.RiskLevel'
            - type: 'null'
          default: null
          description: The risk level of the docket
          examples:
            - low
            - medium
            - high
        normalized_status:
          anyOf:
            - $ref: '#/components/schemas/v1.NormalizedDocketStatus'
            - type: 'null'
          default: null
          description: The normalized status of the docket
          examples:
            - open
            - closed
      required:
        - id
        - docket_number
        - court
        - title
        - is_bankruptcy
      title: DocketResponse (v1)
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    BusinessOrPersonType:
      enum:
        - Business
        - Person
      title: BusinessOrPersonType
      type: string
    v1.BusinessOrPersonType:
      enum:
        - Business
        - Person
      title: BusinessOrPersonType
      type: string
    v1.CourtStateAbbreviation:
      enum:
        - US
        - AL
        - AK
        - AZ
        - AR
        - CA
        - CO
        - CT
        - DE
        - DC
        - FL
        - GA
        - HI
        - ID
        - IL
        - IN
        - IA
        - KS
        - KY
        - LA
        - ME
        - MD
        - MA
        - MI
        - MN
        - MS
        - MO
        - MT
        - NE
        - NV
        - NH
        - NJ
        - NM
        - NY
        - NC
        - ND
        - OH
        - OK
        - OR
        - PA
        - RI
        - SC
        - SD
        - TN
        - TX
        - UT
        - VT
        - VA
        - WA
        - WV
        - WI
        - WY
        - PR
        - CN
        - VI
        - AE
        - AA
        - AP
        - MX
      title: CourtStateAbbreviation
      type: string
    v1.BankruptcyType:
      enum:
        - Chapter 7
        - Chapter 9
        - Chapter 11
        - Chapter 12
        - Chapter 13
        - Chapter 15
      title: BankruptcyType
      type: string
    v1.DocketParty:
      description: Represents a docket party.
      properties:
        id:
          description: The unique identifier of the docket party.
          format: uuid
          title: Id
          type: string
        name:
          description: The name of the docket party.
          title: Name
          type: string
        party_type:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Type of party
          examples:
            - Complaintant
          title: Party Type
        counsel:
          default: []
          description: List of counsel representing the party
          examples:
            - - Robin Keller
          items:
            type: string
          title: Counsel
          type: array
      required:
        - id
        - name
      title: DocketParty (v1)
      type: object
    v1.DocketUpdate:
      description: Represents a docket update.
      properties:
        id:
          description: ID of the litigation
          format: uuid
          title: Id
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Update title
          examples:
            - Update 2
          title: Title
        contents:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Update contents
          examples:
            - New details about the case.
          title: Contents
        date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          default: null
          description: Update date
          examples:
            - '2024-06-01'
          title: Date
        exhibits:
          default: []
          description: List of exhibits
          items:
            $ref: '#/components/schemas/v1.DocketExhibit'
          title: Exhibits
          type: array
      required:
        - id
      title: DocketUpdate (v1)
      type: object
    v1.MatchType:
      enum:
        - NO_MATCH
        - SIMILAR
        - EXACT
      title: MatchType
      type: string
    v1.DocketMatchConfidenceResponse:
      description: |-
        How likely a docket involves the search subject: a confidence level
        plus the three signals it's built from.
      properties:
        confidence:
          $ref: '#/components/schemas/v1.ConfidenceLevel'
          description: The confidence level that this docket involves the search subject.
          examples:
            - high
            - medium
            - low
        name_match:
          $ref: '#/components/schemas/v1.MatchType'
          description: >-
            The degree to which the names associated with the docket match the
            name(s) of the search subject.
          examples:
            - NO_MATCH
            - SIMILAR
            - EXACT
        address_match:
          $ref: '#/components/schemas/v1.DocketAddressMatchType'
          description: >-
            The degree to which the address information of the docket matches
            the addresses of the search subject.
          examples:
            - STATE
            - ADJACENT
            - FEDERAL_VENUE
            - NO_MATCH
            - UNKNOWN
        date_match:
          $ref: '#/components/schemas/v1.DocketDateMatchType'
          description: >-
            The consistency between the docket's filing date and the date when
            the search subject was legally capable of being a party in the
            docket (e.g. the date of incorporation).
          examples:
            - CONSISTENT
            - INCONSISTENT
            - UNKNOWN
      required:
        - confidence
        - name_match
        - address_match
        - date_match
      title: DocketMatchConfidenceResponse (v1)
      type: object
    v1.RiskLevel:
      enum:
        - high
        - medium
        - low
        - no_risk
      title: RiskLevel
      type: string
    v1.NormalizedDocketStatus:
      enum:
        - open
        - closed
      title: NormalizedDocketStatus
      type: string
    v1.DocketExhibit:
      description: Represents a docket exhibit.
      properties:
        id:
          description: ID of the litigation
          format: uuid
          title: Id
          type: string
        title:
          description: Exhibit title
          examples:
            - Exhibit 1A
          title: Title
          type: string
        is_available:
          default: false
          description: Is the exhibit available
          title: Is Available
          type: boolean
        document_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The document_url is a string that represents Docket Exhibit's
            document URL.
          readOnly: true
          title: Document Url
      required:
        - id
        - title
        - document_url
      title: DocketExhibit (v1)
      type: object
    v1.ConfidenceLevel:
      enum:
        - high
        - medium
        - low
      title: ConfidenceLevel
      type: string
    v1.DocketAddressMatchType:
      description: |-
        Court-venue-vs-subject-state signal for docket match_confidence.
        Distinct from `AddressMatchType` (KYB/international address comparison,
        above) — different domain, different value set.
      enum:
        - STATE
        - ADJACENT
        - FEDERAL_VENUE
        - NO_MATCH
        - UNKNOWN
      title: DocketAddressMatchType
      type: string
    v1.DocketDateMatchType:
      description: |-
        Filing-date-vs-reference-date veto signal for docket
        match_confidence.
      enum:
        - CONSISTENT
        - INCONSISTENT
        - UNKNOWN
      title: DocketDateMatchType
      type: string
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````