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

# Search

> Search all the events collected by Flare (global search), like `GET /search/`, with the parameters passed in a JSON body. To get the next page, pass the `search_after` value of the last response (also returned as `next`) as `from` or `search_after`; the response has no `links.next`. Results are sorted by `sort_by` in `order` (newest first by default) and `size` is capped at 10 results per page. Searches are subject to the global search quota of the tenant: 403 `GLOBAL_SEARCH_LIMIT_REACHED` is returned once it is exhausted. Other errors are 400 `INVALID_SEARCH_ARGUMENTS` (invalid parameter), `INVALID_QUERY` (the query cannot be executed), `WILDCARD_FIELD` and `RESTRICTED_TERM`, and 403 `RESTRICTED_FIELD`. Deprecated: use `POST /firework/v4/events/global/_search` instead.

&#x20;Required API key permission: **Read Tenant**

> [!WARNING]
>
> **DEPRECATED:** This endpoint should be replaced by
> [/firework/v4/events/global/\_search ](https://api.docs.flare.io/api-reference/v4/endpoints/events/search-events-globally.md)

> [!NOTE]
>
> This endpoint is subject to quotas and is subject to the `Search` ratelimiting tier.
> See
> [Rate Limits and Quotas ](https://api.docs.flare.io/concepts/rate-limits-and-quotas.md).


## OpenAPI

````yaml firework-v2-openapi post /firework/v2/search/
openapi: 3.0.1
info:
  description: >

    Manage and access Firework resources.


    Requests are authenticated with API tokens, which are obtained using an API
    key:


    1. Generate an API key from the [Profile
    page](https://app.flare.io/#/profile).

    2. Send a `POST` request to `https://api.flare.io/tokens/generate` with the
    `Authorization: <api-key>` header to get an API token. API tokens expire
    after 1 hour.

    3. Call the API endpoints with the `Authorization: Bearer <api-token>`
    header.


    See [Authentication](https://api.docs.flare.io/concepts/authentication) for
    details.
  title: Firework API
  version: v2
servers:
  - url: https://api.flare.io/
security:
  - BearerAuth: []
tags:
  - description: >-
      The authenticated user, its API keys, organizations, tenants, onboarding
      and usage.
    name: Account
  - description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
    name: Events
  - description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
    name: Identifiers
  - description: Report groups, reports, their sections, schedules and delivery channels.
    name: Reports
paths:
  /firework/v2/search/:
    post:
      tags:
        - Events
      summary: Search events with a JSON body
      description: >-
        Search all the events collected by Flare (global search), like `GET
        /search/`, with the parameters passed in a JSON body. To get the next
        page, pass the `search_after` value of the last response (also returned
        as `next`) as `from` or `search_after`; the response has no
        `links.next`. Results are sorted by `sort_by` in `order` (newest first
        by default) and `size` is capped at 10 results per page. Searches are
        subject to the global search quota of the tenant: 403
        `GLOBAL_SEARCH_LIMIT_REACHED` is returned once it is exhausted. Other
        errors are 400 `INVALID_SEARCH_ARGUMENTS` (invalid parameter),
        `INVALID_QUERY` (the query cannot be executed), `WILDCARD_FIELD` and
        `RESTRICTED_TERM`, and 403 `RESTRICTED_FIELD`. Deprecated: use `POST
        /firework/v4/events/global/_search` instead.
      operationId: post_search
      parameters:
        - description: >-
            Fields to includes in the results in a dotted form. For example,
            "data.actor_name" will include items similar to:```json
                    "items": [{
                        "data": {
                            "actor_name": "Seller123"
                        }
                    }]
                    ```

                    By default, all fields are included in the response.
                    
          explode: true
          in: query
          name: fields
          schema:
            items:
              type: string
            type: array
          style: form
        - description: |2-
              The `time` parameter is used to limit results to those found in the provided time span.  

              *Expected format* : from@to  

              *Example value* : 2019-09-03T04:00:00.000Z@2019-09-14T04:00:00.000Z
          in: query
          name: time
          schema:
            type: string
        - description: >-
            The `size` parameter is used to limit the number of results returned
            for the search query.
          in: query
          name: size
          schema:
            default: 10
            type: integer
        - description: >-
            The `search_after` parameter is used to paginate through results.  


            To get the first page of results, omit this parameter. Afterward,
            include the `search_after` parameter in your next request with the
            latest response's `search_after` value to get the next page of
            results.
          in: query
          name: search_after
          schema:
            type: string
        - description: >-
            The `from` parameter is used to paginate through results.  


            To get the first page of results, omit this parameter. Afterward,
            include the `from` parameter in your next request with the latest
            response's `next` value to get the next page of results.
          in: query
          name: from
          schema:
            type: string
        - description: User defined tags used to filter search results
          explode: true
          in: query
          name: tags
          schema:
            items:
              type: string
            type: array
          style: form
        - description: User defined operator to apply to tags filter
          in: query
          name: tags_query_operator
          schema:
            type: string
        - description: >

            Type of activities to search through.


            *Expected values* : attachment, listing, ransomleak, forum_post,
            forum_topic, forum_profile, blog_post, seller, paste, leak,
            chat_message, domain, bot, stealer_log, infected_devices, driller,
            driller_forum_topic, driller_forum_post, driller_profile, cc, ccbin,
            financial_data, leaked_data, leaked_file, document, account, actor,
            forum_content, blog_content, profile, leaked_credential,
            valid_credential, invalid_credential, mitigated_credential,
            illicit_networks, open_web, domains, intelligence_object, leaks,
            social_media_account, social_media, source_code,
            source_code_secrets_np, source_code_secrets, source_code_files,
            secret, docker, stack_exchange, google, service, driller_host,
            buckets, bucket, bucket_object, whois, cookie, pii, experimental,
            lookalike_discovery, lookalike_title, lookalike_favicon,
            lookalike_screenshot, lookalike_ip_address, lookalike_dns,
            lookalike_whois_rdap, lookalike_ssl_certificate


            *Some search types contain others*

            - illicit_networks: stealer_log, bot, chat_message, financial_data,
            forum_profile, blog_post, seller, forum_topic, listing, forum_post,
            ransomleak

            - open_web: bucket, bucket_object, source_code_files,
            stack_exchange, source_code_secrets, docker, google, paste,
            social_media_account, service

            - leaks: invalid_credential, valid_credential, mitigated_credential,
            leak

            - domains: domain
          explode: true
          in: query
          name: types
          schema:
            items:
              enum:
                - attachment
                - listing
                - ransomleak
                - forum_post
                - forum_topic
                - forum_profile
                - blog_post
                - seller
                - paste
                - leak
                - chat_message
                - domain
                - bot
                - stealer_log
                - infected_devices
                - driller
                - driller_forum_topic
                - driller_forum_post
                - driller_profile
                - cc
                - ccbin
                - financial_data
                - leaked_data
                - leaked_file
                - document
                - account
                - actor
                - forum_content
                - blog_content
                - profile
                - leaked_credential
                - valid_credential
                - invalid_credential
                - mitigated_credential
                - illicit_networks
                - open_web
                - domains
                - intelligence_object
                - leaks
                - social_media_account
                - social_media
                - source_code
                - source_code_secrets_np
                - source_code_secrets
                - source_code_files
                - secret
                - docker
                - stack_exchange
                - google
                - service
                - driller_host
                - buckets
                - bucket
                - bucket_object
                - whois
                - cookie
                - pii
                - experimental
                - lookalike_discovery
                - lookalike_title
                - lookalike_favicon
                - lookalike_screenshot
                - lookalike_ip_address
                - lookalike_dns
                - lookalike_whois_rdap
                - lookalike_ssl_certificate
              type: string
            type: array
          style: form
        - description: Type of experimental activities to search through.
          explode: true
          in: query
          name: experimental_types
          schema:
            items:
              type: string
            type: array
          style: form
        - description: >-
            Triage state filter used when `event_actions` is not given;
            `default` excludes ignored and remediated events.
          in: query
          name: event_action
          schema:
            enum:
              - default
              - ignored
              - remediated
              - risk_score_edited
              - exclude_ignored
              - ignored_or_remediated
            type: string
        - description: Triage states to include; takes precedence over `event_action`.
          explode: true
          in: query
          name: event_actions
          schema:
            items:
              enum:
                - default
                - ignored
                - remediated
                - risk_score_edited
                - exclude_ignored
                - ignored_or_remediated
              type: string
            type: array
          style: form
        - description: >-
            Risk scores to include, from 1 (info) to 5 (critical); all risk
            scores when omitted.
          explode: true
          in: query
          name: risks
          schema:
            items:
              type: integer
            type: array
          style: form
        - description: 'Sort direction: `desc` (default) or `asc`.'
          in: query
          name: order
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
        - description: >-
            Date used to sort the results: `created` (default, estimated
            creation date), `indexed` (first collected), `updated` (last
            collected), `searchable`, `materialized` or
            `alertable-materialized`.
          in: query
          name: sort_by
          schema:
            default: created
            enum:
              - created
              - indexed
              - updated
              - alertable-materialized
              - materialized
              - searchable
            type: string
        - description: Not used by this operation.
          in: query
          name: use_global_policies
          schema:
            default: true
            type: boolean
        - description: The time zone used to compute the statistics.
          in: query
          name: time_zone
          schema:
            type: string
        - description: >-
            Query used to filter results. Search query uses the [Lucene
            query](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/query-dsl-query-string-query.html#query-string-syntax)
            syntax.
          in: query
          name: query
          schema:
            type: string
        - description: >-
            When true, only return events whose risk score was modified by the
            tenant.
          in: query
          name: has_modified_risk_score
          schema:
            default: false
            type: boolean
        - description: When true, only return events on which the tenant wrote notes.
          in: query
          name: has_notes
          schema:
            default: false
            type: boolean
        - description: Stealer log labels used to filter search results
          explode: true
          in: query
          name: labels
          schema:
            items:
              enum:
                - stealer_log_applications
                - stealer_log_access_types
                - stealer_log_pii
                - stealer_log_tenant_device
                - stealer_log_corporate_device
                - stealer_log_personal_device
                - stealer_log_high_privilege_device
                - forum_post_topics
                - forum_post_intents
                - chat_message_topics
              type: string
            type: array
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Search'
          description: Returns the search result(s).
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: Query is invalid.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The global search quota of the tenant is exhausted
            (`GLOBAL_SEARCH_LIMIT_REACHED`) or the query uses a field the caller
            is not allowed to search (`RESTRICTED_FIELD`).
      deprecated: true
components:
  schemas:
    Search:
      properties:
        items:
          description: Events matching the search.
          items:
            properties: {}
            type: object
          type: array
        nb_hits:
          description: Number of events matching the search.
          type: integer
        links:
          allOf:
            - $ref: '#/components/schemas/SearchLinks'
          description: Links related to this page of results.
          type: object
        search_after:
          description: >-
            Opaque cursor to pass as `from` or `search_after` to get the next
            page.
          type: string
      type: object
    HttpError:
      properties:
        message:
          description: Human-readable description of the error.
          type: string
        code:
          description: Machine-readable error code.
          type: string
      type: object
    SearchLinks:
      properties:
        next:
          description: URL of the next page of results; only set for GET requests.
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.