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

> Searches all leaked credentials collected by Flare, not only those matching the tenant's identifiers, by domain, email, keyword, secret or authentication domain. Requires the tenant to have access to global search and the caller to have the global search and credentials browser permissions, otherwise `403 FORBIDDEN` is returned.

`order` sets the sort direction and results are paginated with a cursor: pass the `next` value of a response as `from` in the following request with the same `query`, and stop when `next` is `null`. Depending on the caller's access, passwords in `hash` can be partially or fully masked.

Searches count against the global search quota. A search term counts as one search per batch of 100 results fetched, and repeating the same term and batch within 10 minutes is generally not counted again. When a quota applies, a page never crosses a batch of 100 results, so it can hold fewer items than `size`, and the `X-Flare-Global-Searches-Remaining` response header gives the number of searches left. When the quota is exhausted and enforced, `403 GLOBAL_SEARCH_LIMIT_REACHED` is returned.

A `400` is returned with the code `RESTRICTED_TERM` when the term is a restricted search term for the caller, or with the code reported by the credentials store when it rejects the query.

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

> [!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).

> [!NOTE]
>
> Flare supports searching in credentials via two endpoints:
>
> * The [Global Credentials Search endpoint ](https://api.docs.flare.io/api-reference/v4/endpoints/credentials/search-leaked-credentials.md): This endpoint counts towards your global search quota.
> * The [ASTP Credentials Search Endpoint ](https://api.docs.flare.io/api-reference/astp/endpoints/post-credentials-search.md): This endpoint does **not** count towards your search quota but requires ASTP to be enabled on your account. For more information about ASTP, contact your Customer Success Manager.

Returns a list of credentials matching the query provided.

```json Response Example theme={null}
{
    "items": [
        {
            "auth_domains": ["login.live.com"],
            "domain": "scatterholt.com",
            "hash": "B@dPassw0rd",
            "hash_type": null,
            "id": 33880703907,
            "identity_name": "ryan.howard@scatterholt.com",
            "imported_at": "2024-07-22T19:25:52.893439+00:00",
            "known_password_id": null,
            "source": {
                "breached_at": null,
                "description_en": "Collection of multiple combo lists (emails and passwords) exchanged on illicit networks.",
                "description_fr": "Collection de multiples listes \"combos\" (adresses courriel et mots de passe) \u00e9chang\u00e9es sur des r\u00e9seaux illicites.",
                "id": "combolists",
                "is_alert_enabled": true,
                "leaked_at": null,
                "name": "Combolists"
            },
            "source_id": "combolists"
        },
        {
            "auth_domains": ["www.facebook.com", "discord.com"],
            "domain": "scatterholt.com",
            "hash": "1qaz2wsx",
            "hash_type": "unknown",
            "id": 33880703906,
            "identity_name": "ryan.howard@scatterholt.com",
            "imported_at": "2024-07-22T19:25:52.893439+00:00",
            "known_password_id": null,
            "source": {
                "breached_at": null,
                "description_en": "Collection of multiple combo lists (emails and passwords) exchanged on illicit networks.",
                "description_fr": "Collection de multiples listes \"combos\" (adresses courriel et mots de passe) \u00e9chang\u00e9es sur des r\u00e9seaux illicites.",
                "id": "combolists",
                "is_alert_enabled": true,
                "leaked_at": null,
                "name": "Combolists"
            },
            "source_id": "combolists"
        }
    ],
    "next": "WyJjb20uc2NhdHRlcmhvbHQiLCAxNjczNjg4ODg4NV0"
}
```

## Paging

This endpoint supports the
[Flare standard paging pattern ](https://api.docs.flare.io/concepts/paging.md).

## Body Parameters

**size** `number`

Maximum size of the JSON object that will be returned (maximum 10 000)

**from** `string`

The `next` value from the last response.

**order** `string` (default: desc)

The order in which the results will be returned. (`asc` or `desc`)

**include** `string[]`

Additional fields to return. Available options:

* `known_password_id`: ID of the credential's password.
* `auth_domains`: for each credential, up to 100 hosts (domain only, e.g. `login.example.com`) where the credential was seen being used.

**query** `object`

One of the supported queries.

> [tab] Domain Query
>
> This query will match all credentials that contain the specified domain in the email address.
>
> ```json theme={null}
> {
>   "type": "domain",
>   "fqdn": "<string>"
> }
> ```

> [tab] Auth Domain Query
>
> This query will match the domain of the service that this credential might have been used to log in to.
>
> ```json theme={null}
> {
>   "type": "auth_domain",
>   "fqdn": "<string>"
> }
> ```

> [tab] Password Query
>
> This query will match all credentials that contain the specified password.
>
> ```json theme={null}
> {
>   "type": "secret",
>   "secret": "<string>"
> }
> ```

> [tab] Email Query
>
> This query will match all credentials for the exact email address.
>
> ```json theme={null}
> {
>   "type": "email",
>   "email": "<string>"
> }
> ```

> [tab] Keyword Query
>
> This query will match with the credential's username, which is the portion of the `identity_name` that precedes `@`.
>
> ```json theme={null}
> {
>   "type": "keyword",
>   "keyword": "<string>"
> }
> ```

**filters** `object`

**imported\_at** `object`

**gte** `string`

Matches values greater than or equal to the specified timestamp.

Format: ISO-8601

**lte** `string`

Matches values lesser than or equal to the specified timestamp.

Format: ISO-8601


## OpenAPI

````yaml firework-v4-openapi post /firework/v4/credentials/global/_search
openapi: 3.1.0
info:
  title: Firework API
  version: v4
servers:
  - url: https://api.flare.io
security:
  - BearerAuth: []
tags:
  - name: Audit Logs
    description: Audit trail of actions performed in the platform.
  - name: Credentials
    description: >-
      Leaked credentials: search across all sources or within a tenant, and
      remediate or ignore them.
  - name: Entities
    description: >-
      Threat intelligence entities such as actors, chat channels, forum threads
      and domains, and the relations between them.
  - name: Events
    description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
  - name: Identifiers
    description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
  - name: Matching Policies
    description: >-
      Matching policies refine which events match identifiers. Manage policies
      and their assignment to identifiers.
  - name: Sandbox
    description: File uploads and their sandbox analysis.
  - name: Threat Flow
    description: >-
      Threat Flow intelligence requests, generated reports and conversation
      summaries.
paths:
  /firework/v4/credentials/global/_search:
    post:
      tags:
        - Credentials
      summary: Search leaked credentials
      description: >-
        Searches all leaked credentials collected by Flare, not only those
        matching the tenant's identifiers, by domain, email, keyword, secret or
        authentication domain. Requires the tenant to have access to global
        search and the caller to have the global search and credentials browser
        permissions, otherwise `403 FORBIDDEN` is returned.


        `order` sets the sort direction and results are paginated with a cursor:
        pass the `next` value of a response as `from` in the following request
        with the same `query`, and stop when `next` is `null`. Depending on the
        caller's access, passwords in `hash` can be partially or fully masked.


        Searches count against the global search quota. A search term counts as
        one search per batch of 100 results fetched, and repeating the same term
        and batch within 10 minutes is generally not counted again. When a quota
        applies, a page never crosses a batch of 100 results, so it can hold
        fewer items than `size`, and the `X-Flare-Global-Searches-Remaining`
        response header gives the number of searches left. When the quota is
        exhausted and enforced, `403 GLOBAL_SEARCH_LIMIT_REACHED` is returned.


        A `400` is returned with the code `RESTRICTED_TERM` when the term is a
        restricted search term for the caller, or with the code reported by the
        credentials store when it rejects the query.
      operationId: credentials_global_search_credentials_global__search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialsQueryPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResults_Credential_str_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CredentialsQueryPayload:
      properties:
        query:
          oneOf:
            - $ref: '#/components/schemas/DomainQuery'
            - $ref: '#/components/schemas/EmailQuery'
            - $ref: '#/components/schemas/KeywordQuery'
            - $ref: '#/components/schemas/SecretQuery'
            - $ref: '#/components/schemas/AuthDomainQuery'
          title: Query
          description: What to search for; `type` selects the kind of criterion.
          discriminator:
            propertyName: type
            mapping:
              auth_domain: '#/components/schemas/AuthDomainQuery'
              domain: '#/components/schemas/DomainQuery'
              email: '#/components/schemas/EmailQuery'
              keyword: '#/components/schemas/KeywordQuery'
              secret: '#/components/schemas/SecretQuery'
        filters:
          $ref: '#/components/schemas/CredentialsQueryFilters'
          description: Optional filters narrowing the results.
        from:
          anyOf:
            - type: string
            - type: 'null'
          title: From
          description: >-
            Pagination cursor: pass the `next` value of the previous response to
            get the following page, omit it for the first page.
        size:
          type: integer
          maximum: 10000
          minimum: 1
          title: Size
          description: Maximum number of items to return.
          default: 10
        include:
          items:
            $ref: '#/components/schemas/IncludeOptions'
          type: array
          title: Include
          description: Optional data to add to each returned credential.
        order:
          $ref: '#/components/schemas/OrderType'
          description: Sort direction of the results.
          default: desc
      type: object
      required:
        - query
      title: CredentialsQueryPayload
    PaginatedResults_Credential_str_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Credential'
          type: array
          title: Items
          description: Results of the current page.
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
          description: >-
            Cursor to send in the next request to continue after this page, or
            `null` when no further page is available.
      type: object
      required:
        - items
        - next
      title: PaginatedResults[Credential, str]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DomainQuery:
      properties:
        type:
          type: string
          const: domain
          title: Type
        fqdn:
          type: string
          title: Fqdn
          description: Fully qualified domain name to search for.
      type: object
      required:
        - type
        - fqdn
      title: DomainQuery
    EmailQuery:
      properties:
        type:
          type: string
          const: email
          title: Type
        email:
          type: string
          title: Email
          description: Email address to search for.
      type: object
      required:
        - type
        - email
      title: EmailQuery
    KeywordQuery:
      properties:
        type:
          type: string
          const: keyword
          title: Type
        keyword:
          type: string
          title: Keyword
          description: Keyword to search for.
      type: object
      required:
        - type
        - keyword
      title: KeywordQuery
    SecretQuery:
      properties:
        type:
          type: string
          const: secret
          title: Type
        secret:
          type: string
          title: Secret
          description: Secret value to search for.
      type: object
      required:
        - type
        - secret
      title: SecretQuery
    AuthDomainQuery:
      properties:
        type:
          type: string
          const: auth_domain
          title: Type
        fqdn:
          type: string
          title: Fqdn
          description: Domain name of the site the credentials log in to.
      type: object
      required:
        - type
        - fqdn
      title: AuthDomainQuery
    CredentialsQueryFilters:
      properties:
        imported_at:
          $ref: '#/components/schemas/CredentialsDateFilter'
          description: Range on the time Flare imported the credential.
      type: object
      title: CredentialsQueryFilters
    IncludeOptions:
      type: string
      enum:
        - known_password_id
        - auth_domains
        - urls
      title: IncludeOptions
    OrderType:
      type: string
      enum:
        - asc
        - desc
      title: OrderType
    Credential:
      properties:
        id:
          type: integer
          title: Id
        identity_name:
          type: string
          title: Identity Name
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
        source_id:
          type: string
          title: Source Id
        imported_at:
          type: string
          title: Imported At
        hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Hash
        hash_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Hash Type
        source:
          anyOf:
            - $ref: '#/components/schemas/SourceV2'
            - type: 'null'
        known_password_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Known Password Id
        credential_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Credential Hash
        event_uid:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Uid
        auth_domains:
          items:
            type: string
          type: array
          title: Auth Domains
        urls:
          items:
            type: string
          type: array
          title: Urls
      type: object
      required:
        - id
        - identity_name
        - domain
        - source_id
        - imported_at
        - hash
        - hash_type
        - source
        - known_password_id
        - credential_hash
        - event_uid
      title: Credential
    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
    CredentialsDateFilter:
      properties:
        gte:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Gte
          description: Only return credentials imported at or after this time.
        lte:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Lte
          description: Only return credentials imported at or before this time.
      type: object
      title: CredentialsDateFilter
    SourceV2:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description_en:
          anyOf:
            - type: string
            - type: 'null'
          title: Description En
        description_fr:
          anyOf:
            - type: string
            - type: 'null'
          title: Description Fr
        breached_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Breached At
        leaked_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Leaked At
        is_alert_enabled:
          type: boolean
          title: Is Alert Enabled
        pii_tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Pii Tags
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
      type: object
      required:
        - id
        - name
        - description_en
        - description_fr
        - breached_at
        - leaked_at
        - is_alert_enabled
        - pii_tags
        - url
      title: SourceV2
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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