openapi: 3.0.3
info:
  title: Organization
  description: |
    Access your organization's
    monitored firms, tracked wallets, transaction analytics, asset security data,
    and generated reports.

    ## Authentication

    Send your **Key** (`X-API-KEY`) and **Secret** (`X-API-SECRET`) from the
    [API & Usage](https://compliance.certik.com/settings/api-usage/keys) page. The secret is shown only once when the key is created.

    ```
    X-API-KEY: YOUR_API_KEY
    X-API-SECRET: YOUR_API_SECRET
    ```

    Use the same key and secret for AML and Organization endpoints. Requests
    use your organization's Compliance access. The threat feed is shared.
  version: 1.0.0
  contact:
    name: CertiK Support
    url: https://www.certik.com

servers:
  - url: https://api.compliance.certik.com/organization

security:
  - ApiKeyAuth: []
    ApiSecretAuth: []

# Declared order drives the reference sidebar; undeclared tags sort ahead of
# the paths that use them.
tags:
  - name: Firms
  - name: Wallets
  - name: Transactions
  - name: Tags
    description: >
      The tags your organization puts on wallets, firms, and assets. Use their names to filter and split wallet metrics.
  - name: Metrics
    description: >
      Daily numbers for your wallets, such as balances, transfers, and risk exposure. Start with `GET /metrics/catalog`.
  - name: AML
    description: >
      AML data comes from daily on-chain screening aggregates and covers only
      completed UTC days — a `date` later than yesterday (UTC) returns
      400. Daily-aggregate coverage starts 2026-06-25; a `date` before that
      returns 200 with zeroed or empty data rather than an error, since
      coverage may be backfilled later.

      Firm-scoped AML endpoints are restricted to firms your organization
      monitors — an unmonitored or unknown firm returns 404.

      Category volumes are not additive: the same transfer can be counted
      under more than one category, including a parent category and one of
      its subcategories (e.g. `CEFI` and `CEX` can report the same volume for
      the same funds). Use the summary endpoint's top-level `totalVolumeUsd`
      / `volumeWithRiskUsd` for day totals; use category rows only to
      compare categories against each other.
  - name: Assets
  - name: Reports
  - name: Threat Monitor

components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    ApiSecretAuth:
      type: apiKey
      in: header
      name: X-API-SECRET

  schemas:
    FirmMonitoredWallet:
      description: >
        Wallet linked to one monitored firm. The firm wallet list returns this
        shape. The organization wallet list returns MonitoredWallet entries.
      type: object
      properties:
        chain:
          type: string
          description: Chain identifier (e.g. ethereum, bsc)
          example: "ethereum"
        address:
          type: string
          description: On-chain address for this wallet on `chain`
          example: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
        tags:
          type: array
          items:
            type: string
          description: Labels applied to this wallet (e.g. sector or use case)
        addedAt:
          type: integer
          description: Unix timestamp (ms) when the wallet was added to monitoring
          example: 1774857716253
      required:
        - chain
        - address
        - tags
        - addedAt

    FirmSummary:
      type: object
      properties:
        firmId:
          type: string
          example: "abc123"
        firmName:
          type: string
          nullable: true
          example: "Binance"
        firmLogo:
          type: string
          nullable: true
          example: "https://cdn.certik.com/logos/binance.png"
        complianceStatus:
          type: string
          nullable: true
        businessImpact:
          type: string
          nullable: true
        addedAt:
          type: integer
          description: Unix timestamp (ms) when the firm was added to monitoring
          example: 1700000000000
        website:
          type: string
          nullable: true
        lastUpdatedAt:
          type: integer
          description: Unix timestamp (ms) of the last firm update, or when the firm was added
        rating:
          type: object
          nullable: true
          description: Overall score and letter grade from the Firms table
          required: [score, grade]
          properties:
            score:
              type: number
            grade:
              type: string
              enum: [A, B, C, D, F]
        sector:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        walletCount:
          type: integer
          minimum: 0
        assetCount:
          type: integer
          minimum: 0
        tokenCount:
          type: integer
          minimum: 0

    ListPage:
      type: object
      required: [totalCount, nextOffset]
      properties:
        totalCount:
          type: integer
          minimum: 0
          description: Number of matching entries across all pages
        nextOffset:
          type: integer
          nullable: true
          description: Use this value for offset in the next request. Null means the list is complete.

    FirmLinkedAsset:
      type: object
      required: [assetId, name, symbol, addedAt]
      properties:
        assetId:
          type: string
          description: Skynet project ID
        name:
          type: string
          nullable: true
        symbol:
          type: string
          nullable: true
        addedAt:
          type: integer
          description: Unix timestamp (ms) of the earliest visible link

    FirmLinkedToken:
      type: object
      required: [tokenId, chain, tokenAddress, name, symbol, logo, addedAt]
      properties:
        tokenId:
          type: string
        chain:
          type: string
          nullable: true
        tokenAddress:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        symbol:
          type: string
          nullable: true
        logo:
          type: string
          nullable: true
        addedAt:
          type: integer
          description: Unix timestamp (ms) of the earliest visible link

    FirmDetail:
      allOf:
        - $ref: "#/components/schemas/FirmSummary"
        - type: object
          properties:
            entityName:
              type: string
              nullable: true
            description:
              type: string
              nullable: true
            twitter:
              type: string
              nullable: true
            twitterAccountAge:
              type: integer
              nullable: true
            twitterActiveIndicator:
              type: string
              nullable: true
            twitterFollowerCount:
              type: integer
              nullable: true
            twitterTweetCount:
              type: integer
              nullable: true
            country:
              type: array
              items:
                type: string
            operatingCountries:
              type: array
              items:
                type: string
            labels:
              type: array
              items:
                type: string
            license:
              type: array
              nullable: true
              items:
                type: string
            breachExposure:
              type: string
              nullable: true
              description: Human-readable breach exposure band (derived from Skynet data)
            foundedYear:
              type: string
              nullable: true
              description: Year founded (string in Skynet data, often numeric)
            companySize:
              type: string
              nullable: true
            people:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  position:
                    type: string
                  linkedin:
                    type: string
                    nullable: true
            firmRatingAdjustment:
              type: object
              description: Category-level rating adjustments across all Skynet dimensions
            holdings:
              type: array
              items:
                type: object
                properties:
                  tokenId:
                    type: string
                    nullable: true
                  tokenName:
                    type: string
                    nullable: true
                  holdingAmount:
                    type: number
                  costBasis:
                    type: number
                    nullable: true

    Asset:
      description: >
        Skynet leaderboard asset payload returned by GET /assets/{assetId}.
      type: object
      properties:
        id:
          type: string
          example: "binance"
        name:
          type: string
          example: "BNB Chain"
        logo:
          type: string
          nullable: true
          description: URL to the project logo (Contentful CDN)
        tokenTickers:
          type: array
          items:
            type: string
        skynetScore:
          type: object
          properties:
            score:
              type: number
              nullable: true
            rank:
              type: integer
              nullable: true
            scoreCodeSecurity:
              type: number
              nullable: true
            scoreCommunity:
              type: number
              nullable: true
            scoreFundamental:
              type: number
              nullable: true
            scoreGovernance:
              type: number
              nullable: true
            scoreMarket:
              type: number
              nullable: true
            scoreOperation:
              type: number
              nullable: true
        price:
          type: number
          nullable: true
        marketCap:
          type: number
          nullable: true

    WalletTransferAnalytics:
      type: object
      nullable: true
      description: >
        Transfer flow aggregates for the wallet. Additional fields may be present.
      properties:
        numTransfers:
          type: integer
        numTransfers1d:
          type: integer
        totalInflow:
          type: number
        totalInflow1d:
          type: number
        totalOutflow:
          type: number
        totalOutflow1d:
          type: number
        totalNetflow:
          type: number
        totalNetflow1d:
          type: number

    WalletImportRow:
      description: |
        One wallet in an import payload. All fields are required. `chain_id` is
        authoritative; `blockchain` must agree with it.

        **Tags are derived from this row** — the payload has no tag field.
        Each boolean maps to a pair of predefined tags, and `control_model`
        maps to one:

        | Field                    | `true`           | `false`          |
        | ------------------------ | ---------------- | ---------------- |
        | `is_hot_wallet`          | Hot              | Cold             |
        | `is_client_asset_wallet` | Client Asset     | Non-Client Asset |
        | `is_omnibus_wallet`      | Omnibus          | Segregated       |
        | `control_model`          | (see that field) | (see that field) |

        The `false` column (counterpart tags) applies only while the request's
        `apply_counterpart_tags` is `true` (the default); with `false`, a
        `false` flag derives no tag.
      type: object
      required:
        - address
        - blockchain
        - chain_id
        - is_hot_wallet
        - is_client_asset_wallet
        - is_omnibus_wallet
        - control_model
      properties:
        address:
          type: string
          minLength: 1
          description: |
            On-chain address, in the format of the row's chain:

            | Chain (`chain_id`)                       | Format                                                   |
            | ---------------------------------------- | -------------------------------------------------------- |
            | EVM chains                               | `0x` followed by 40 hex characters. Any casing is accepted (EVM addresses are stored lower-cased). |
            | Bitcoin (`0`)                            | Mainnet Base58 (`1…` / `3…`) or Bech32 (`bc1…`)          |
            | TRON (`728126428`)                       | Base58, `T` followed by 33 characters                    |
            | Solana (`"solana"`, or `blockchain` `solana`) | Base58-encoded 32-byte public key                   |

            A malformed address on a supported chain fails the row with
            `invalid_address`. On any other chain the address is accepted as-is.
          example: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
        blockchain:
          type: string
          description: >
            Chain name — either the slug (`ethereum`, `bsc`, `polygon`,
            `arbitrum`, `optimism`, `base`, `avax`, `linea`, `plasma`,
            `bitcoin`, `tron`, `solana`) or its display name (`Ethereum`,
            `BNB Chain`, `Polygon`, `Arbitrum`, `Optimism`, `Base`,
            `Avalanche`, `Linea`, `Plasma`, `Bitcoin`, `TRON`, `Solana`). Must
            agree with `chain_id`; a mismatch fails the row with
            `chain_mismatch`.
          example: "ethereum"
        chain_id:
          oneOf:
            - type: integer
            - type: string
              nullable: true
              enum: [solana, null]
          description: >
            The authoritative chain selector. Supported: 0 Bitcoin · 1 Ethereum
            · 10 Optimism · 56 BNB Chain · 137 Polygon · 8453 Base · 9745 Plasma
            · 42161 Arbitrum · 43114 Avalanche · 59144 Linea · 728126428 TRON ·
            `"solana"` (Solana). For Solana, send `blockchain: "solana"` and
            set `chain_id` to `"solana"` or `null`.
          example: 1
        is_hot_wallet:
          type: boolean
          description: >
            `true` derives the "Hot" tag; `false` derives "Cold"
            (when `apply_counterpart_tags` is on).
        is_client_asset_wallet:
          type: boolean
          description: >
            `true` derives the "Client Asset" tag; `false` derives
            "Non-Client Asset" (when `apply_counterpart_tags` is on).
        is_omnibus_wallet:
          type: boolean
          description: >
            `true` derives the "Omnibus" tag; `false` derives "Segregated"
            (when `apply_counterpart_tags` is on).
        control_model:
          type: string
          description: |
            Custody model. Matched case-insensitively after trimming; both
            hyphen and no-hyphen spellings of the -sig models work:

            | Accepted value(s)             | Derived tag         |
            | ----------------------------- | ------------------- |
            | `single-sig`, `singlesig`     | Single-Sig          |
            | `multi-sig`, `multisig`       | Multi-Sig           |
            | `mpc`                         | MPC                 |
            | `third-party custodian`       | 3rd Party Custodian |
            | `smart-contract-controlled`   | Contract Controlled |

            An unrecognized value is **accepted** (the row does not fail) but
            derives no tag.
          example: "multi-sig"

    WalletImportError:
      description: One validation error on a single row. A row may carry several.
      type: object
      properties:
        field:
          type: string
          description: The row field the error is about.
          example: "chain_id"
        code:
          type: string
          description: |
            - `invalid_address` — `address` is empty or not valid for its chain.
            - `unsupported_chain` — `chain_id` is not a supported chain id.
            - `chain_mismatch` — `blockchain` does not match `chain_id`.
            - `invalid_field` — a boolean flag is not a boolean, or
              `control_model` is not a string.
          enum:
            - invalid_address
            - unsupported_chain
            - chain_mismatch
            - invalid_field
        message:
          type: string
          description: Human-readable explanation.
          example: "chain_id 999 is not supported. Supported chain ids: 0, 1, 10, 56, 137, 8453, 9745, 42161, 43114, 59144, 728126428."

    WalletImportFailure:
      description: A row that failed validation, with its effect on the wallet.
      type: object
      properties:
        index:
          type: integer
          description: Zero-based position of the row in the `wallets` array you sent.
          example: 2
        address:
          type: string
          nullable: true
          description: >
            The address the row claimed, or `null` when the address itself could
            not be parsed.
        linked:
          type: boolean
          nullable: true
          description: >
            Whether this wallet is linked to the firm **after** the request —
            answering "did my bad row delete my wallet?". `true`: still linked
            (it was already linked and was kept despite this row failing).
            `false`: not linked (the errors prevented linking it). `null`: the
            address was unreadable, so there is no wallet to report on.
        errors:
          type: array
          description: Every validation error on this row.
          items:
            $ref: "#/components/schemas/WalletImportError"

    WalletImportResult:
      type: object
      properties:
        summary:
          type: object
          description: Counts of what actually happened (matches the arrays below).
          properties:
            received:
              type: integer
              description: Number of rows in the request.
            linked:
              type: integer
              description: Wallets newly linked to the firm by this request.
            unlinked:
              type: integer
              description: Wallets removed from the firm (only possible in `sync` mode).
            skipped:
              type: integer
              description: >
                Valid rows that produced no new link — the wallet was already
                linked (its tags may have been refreshed in `sync` mode), or the
                row duplicated an earlier one in the same payload.
            failed:
              type: integer
              description: Rows that failed validation (see `failed[]`).
        linked:
          type: array
          description: The wallets newly linked by this request.
          items:
            $ref: "#/components/schemas/WalletRef"
        unlinked:
          type: array
          description: The wallets removed by this request.
          items:
            $ref: "#/components/schemas/WalletRef"
        failed:
          type: array
          description: One entry per row that failed validation.
          items:
            $ref: "#/components/schemas/WalletImportFailure"

    WalletRef:
      description: A wallet identified by chain and address.
      type: object
      properties:
        address:
          type: string
          example: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
        chain:
          type: string
          example: "ethereum"

    MonitoredWallet:
      description: >
        A unique on-chain wallet (by chain + address) linked to one or more
        monitored firms, with balances, risk, and activity — same enrichment as
        `/risk-management/wallets`.
      type: object
      properties:
        chain:
          type: string
          example: "ethereum"
        address:
          type: string
          example: "0x1234567890123456789012345678901234567890"
        firmIds:
          type: array
          items:
            type: string
          description: Monitored firm IDs that reference this wallet
        tags:
          type: array
          items:
            type: string
        totalBalance:
          type: number
          description: Aggregated USD balance where available
        riskLevel:
          type: string
          enum: [high, medium, low]
          description: SkyInsights wallet risk level ("none" is reported as low)
        riskScore:
          type: number
          description: Legacy 0–5 KYA score, kept for backward compatibility. Prefer riskRawScore.
        riskRawScore:
          type: number
          nullable: true
          minimum: 0
          maximum: 100
          description: SkyInsights 0–100 wallet risk score (same scale as AML Lookup); null when the wallet has not been assessed yet
        riskTags:
          type: array
          items:
            type: string
        latestTxTimestamp:
          type: string
          nullable: true
          description: Etherscan-style timestamp of the latest transaction
        transferAnalytics:
          $ref: "#/components/schemas/WalletTransferAnalytics"

    TagDefinition:
      description: One tag your organization uses.
      type: object
      required:
        - id
        - name
        - entityType
        - activeAssignmentCount
        - createdAt
      properties:
        id:
          type: string
          description: The tag id.
          example: "11111111-1111-4111-8111-111111111111"
        name:
          type: string
          description: The tag name. In `GET /metrics`, send it as `walletTags`, `firmTags`, or `assetTags`.
          example: "Hot"
        entityType:
          type: string
          enum: [wallet, asset, firm]
          description: What the tag is on, a wallet, an asset, or a firm.
          example: "wallet"
        activeAssignmentCount:
          type: number
          description: How many wallets, assets, or firms have this tag now.
          example: 4227
        createdAt:
          type: string
          format: date-time
          description: When the tag was made.
          example: "2026-09-01T10:12:00.000Z"

    WalletMetricCatalogEntry:
      description: One metric you can ask for in `GET /metrics`.
      type: object
      properties:
        key:
          type: string
          description: The name to send as `metric`.
          example: "balance_usd"
        label:
          type: string
          description: A short name to show to people.
          example: "Holding balance"
        unit:
          type: string
          enum: [usd, count]
          description: "`usd` for dollar amounts, `count` for numbers of things."
          example: "usd"
        kind:
          type: string
          enum: [level, flow]
          description: "`level` is a daily snapshot, like a balance; `flow` is a daily amount that adds up, like transfers."
          example: "level"
        description:
          type: string
          description: What the metric measures.
          example: "Total USD value the wallets held at the end of each day (UTC), counting only tagged assets when you use asset tags."
        endpoint:
          type: string
          description: Where to ask for this metric.
          example: "/metrics"
        source:
          type: string
          description: The daily data the metric comes from.
          example: "Daily end-of-day balance per wallet"
        grain:
          type: string
          description: "How detailed the daily data is: `wallet_day` means one number per wallet per day."
          example: "wallet_day"
        historyStart:
          type: string
          format: date
          nullable: true
          description: The first day with data, or `null` if there is none yet.
          example: "2026-09-02"
        latestDay:
          type: string
          format: date
          nullable: true
          description: The last complete day (UTC) with data, or `null` if there is none yet.
          example: "2026-09-23"
        includesPartialToday:
          type: boolean
          description: "`true` when numbers for today, which is not complete yet, are available."
          example: false
        supportsAssetTags:
          type: boolean
          description: "`true` when you can use asset tags with this metric."
          example: true
        assetTagFilter:
          type: object
          nullable: true
          description: The data dates when you use asset tags, or `null` if this metric does not take asset tags.
          properties:
            source:
              type: string
            grain:
              type: string
            historyStart:
              type: string
              format: date
              nullable: true
            latestDay:
              type: string
              format: date
              nullable: true
            includesPartialToday:
              type: boolean
        supportsGroupByAsset:
          type: boolean
          description: "`true` when you can use `groupBy=asset` for one line per asset."
          example: true
        supportsGroupByWallet:
          type: boolean
          description: "`true` when you can use `groupBy=wallet` for one line per wallet."
          example: true
        supportsCategories:
          type: boolean
          description: "`true` when you can choose risk categories with `categories`."
          example: false
        categoriesAdditive:
          type: boolean
          description: "Risk metrics only. Always `false`: do not add categories together. Each wallet counts once per day, using its largest chosen category, so totals can be slightly below the exact figure. Each name counts only that category. Spelling does not matter, so Risky Escrow and Riskyescrow are the same category."
          example: false

    WalletMetricPoint:
      type: object
      properties:
        date:
          type: string
          format: date
          description: The day (UTC).
          example: "2026-09-23"
        value:
          type: number
          nullable: true
          description: "The value on that day, in USD rounded to cents or as a whole count. Days with no data yet are empty (null); days with data but no activity are 0."
          example: 2916534541.83

    WalletMetricSummary:
      description: Ready-made numbers for a line.
      type: object
      properties:
        latest:
          type: number
          nullable: true
          description: "For balances, the value on the last complete day with data; for activity, the value on the last complete day in the range (0 if nothing happened, `null` if that day has no data yet)."
          example: 2916534541.83
        latestDate:
          type: string
          format: date
          nullable: true
          description: The day the `latest` value comes from, or `null` if the range has no complete day with data.
          example: "2026-09-23"
        periodTotal:
          type: number
          nullable: true
          description: "The sum of all days with data for `flow` metrics; `null` for `level` metrics, because balances do not add up. Computed before rounding, so it can differ by a few cents from the sum of the rounded daily values."
          example: null

    WalletMetricSeries:
      description: One line of results, for one wallet tag, firm tag, firm, asset tag, asset, or wallet.
      type: object
      properties:
        key:
          type: string
          description: "The wallet tag id, firm tag id, firm id, asset tag id, asset id (such as `bitcoin`), wallet as `chain:address`, `__other__`, `untagged`, or `all`."
          example: "11111111-1111-4111-8111-111111111111"
        label:
          type: string
          description: The name to show to people, such as the wallet tag, firm, or asset name (the asset id when the name is unknown), or a short wallet address.
          example: "Hot"
        points:
          type: array
          description: One value for each day in the range.
          items:
            $ref: "#/components/schemas/WalletMetricPoint"
        summary:
          $ref: "#/components/schemas/WalletMetricSummary"

    WalletMetricsResponse:
      type: object
      properties:
        metric:
          type: string
          description: The metric you asked for.
        unit:
          type: string
          enum: [usd, count]
          description: "`usd` for dollar amounts, `count` for numbers of things."
        kind:
          type: string
          enum: [level, flow]
          description: "`level` is a daily snapshot, like a balance; `flow` is a daily amount that adds up."
        groupBy:
          type: string
          enum: [wallet_tag, firm_tag, firm, asset_tag, asset, wallet, org]
          description: How the results are split into lines.
        from:
          type: string
          format: date
          description: The first day in the results.
        to:
          type: string
          format: date
          description: The last day in the results.
        membershipMode:
          type: string
          enum: [current_tags_applied_to_history]
          description: "Always `current_tags_applied_to_history`: today's wallet tags apply to every day."
        categories:
          type: array
          description: Risk metrics only. The risk categories included in the numbers.
          items:
            type: string
        categoriesAdditive:
          type: boolean
          description: "Risk metrics only. Always `false`, because one transfer can have several categories. Each wallet counts once per day, using its largest chosen category, so totals can be slightly below the exact figure. Each name counts only that category. Spelling does not matter, so Risky Escrow and Riskyescrow are the same category."
        series:
          type: array
          description: >
            One line per wallet tag, firm tag, firm, or asset tag, or a single
            line for all wallets. With `groupBy=asset` or `groupBy=wallet`, the
            largest lines come first and the last line, `__other__`, adds up the rest.
          items:
            $ref: "#/components/schemas/WalletMetricSeries"
        totals:
          type: object
          properties:
            distinct:
              type: array
              description: >
                Counts every wallet your filters select, each wallet once.
                With `groupBy=wallet_tag`, untagged wallets are added only with
                `includeUntaggedWallets=true`. With `groupBy=asset_tag`, each
                asset is counted once. With `groupBy=asset` or `groupBy=wallet`,
                it is the sum of all lines, including `__other__`. For `assets_held`,
                each asset is counted once.
              items:
                $ref: "#/components/schemas/WalletMetricPoint"
            summary:
              $ref: "#/components/schemas/WalletMetricSummary"
        overlap:
          type: object
          nullable: true
          description: How many items are in more than one selected tag, or `null` when results are not split by tag.
          properties:
            walletsInMultipleSelectedTags:
              type: number
              description: The number of wallets that have two or more of the selected wallet tags.
            walletsInMultipleSelectedFirmTags:
              type: number
              description: The number of wallets whose firms have two or more of the selected firm tags.
            assetsInMultipleSelectedAssetTags:
              type: number
              description: The number of assets that have two or more of the selected asset tags.
        freshness:
          type: object
          properties:
            latestDay:
              type: string
              format: date
              nullable: true
              description: The last complete day (UTC) that has data, or `null` if there is none yet.
            includesPartialToday:
              type: boolean
              description: "`true` when the results include today, which is not complete and can still change."

    TransactionAnalyticsSummary:
      description: >
        Aggregate transaction metrics for all organization wallets, aligned with
        the dashboard's **Monitored Transactions** section.
      type: object
      required:
        - timePeriod
        - totalTransactions
        - totalVolume
        - riskTransactions
        - riskVolume
      properties:
        timePeriod:
          type: string
          enum: [ONE_DAY, SEVEN_DAYS, THIRTY_DAYS]
          description: Rolling window for the aggregates
        totalTransactions:
          type: number
          description: Count of inbound and outbound transactions
        totalVolume:
          type: number
          description: Normalized economic value (USD)
        riskTransactions:
          type: number
          description: Transactions with a risk level other than none or a risk score above zero
        riskVolume:
          type: number
          description: USD volume for risky transactions

    Report:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          enum: [Scheduled, On-Demand]
        status:
          type: string
          enum: [Pending, Completed, Failed]
        entity_type:
          type: string
          enum: [Assets, Firms]
        firms:
          type: array
          items:
            type: string
          description: Firm IDs included in this report
        assets:
          type: array
          items:
            type: string
        mode:
          type: string
          enum: [Snapshot, Historical]
        created_by:
          type: string
        added_at:
          type: integer
          description: Unix timestamp (ms)

    IncidentSkynetProfile:
      description: >
        The Skynet asset (a.k.a. "asset" in the enterprise product) matched to a
        security incident. Present only when the incident is matched to an asset.
      type: object
      properties:
        skynet_id:
          type: string
          description: >
            Skynet asset identifier. May be a bare project id (e.g.
            `euler-finance`) or path-prefixed (`exchanges/upbit`,
            `wallets/metamask`). Empty when the incident is matched only by URL.
          example: "euler-finance"
        profile_url:
          type: string
          nullable: true
          description: >
            Absolute URL to the asset's page in this app, on the current domain
            (`https://compliance.certik.com/risk-management/assets/{skynet_id}`). `null` for exchange and
            wallet matches (which have no in-app asset page) and for url-only
            matches.
          example: "https://compliance.certik.com/risk-management/assets/euler-finance"
        asset_type:
          type: string
          enum: [project, exchange, wallet]
          description: Type of the matched asset, derived from `skynet_id`
          example: "project"
      required:
        - skynet_id
        - profile_url
        - asset_type

    SecurityIncident:
      description: >
        A Web3 security incident from CertiK's threat intelligence feed. Incidents
        matched to a monitored asset carry a non-null `skynet_profile`.
      type: object
      properties:
        id:
          type: string
          example: "incident-12345"
        incident_name:
          type: string
          example: "Euler Finance Exploit"
        amount:
          type: number
          description: Funds lost, in USD
          example: 197000000
        date:
          type: string
          description: Incident date
          example: "2023-03-13"
        incident_type:
          type: string
          example: "Exploit"
        links:
          type: array
          items:
            type: string
          description: Source / report links
        chains:
          type: array
          items:
            type: string
          description: Chains involved (e.g. ethereum, bsc)
        tags:
          type: array
          items:
            type: string
        project_type:
          type: string
          example: "project"
        project_name:
          type: string
          example: "Euler Finance"
        is_customer:
          type: boolean
          description: Whether the affected project is a CertiK customer
        attack_vector:
          type: string
          nullable: true
          example: "Flash Loan"
        attack_techniques:
          type: array
          items:
            type: string
        skynet_profile:
          allOf:
            - $ref: "#/components/schemas/IncidentSkynetProfile"
          nullable: true
          description: >
            Matched Skynet asset, or `null` when the incident has no matched asset.
      required:
        - id
        - incident_name
        - amount
        - date
        - incident_type
        - links
        - chains
        - tags
        - project_type
        - project_name
        - is_customer
        - attack_techniques
        - skynet_profile

    Error:
      type: object
      properties:
        error:
          type: string

    AmlCategoryVolume:
      description: Volume and transaction count for one AML category within a summary day.
      type: object
      properties:
        category:
          type: string
          description: >
            Usually a canonical category key from `GET /aml/categories`, but
            it can also be a raw vendor label — a subcategory (e.g. `CEX`
            under `CEFI`) or a value not yet mapped — so callers must not
            assume every value is a member of that list.
          example: "HACK"
        volumeUsd:
          type: number
          example: 42000
        txnCount:
          type: number
          example: 3

    AmlSummary:
      description: >
        Daily AML flow summary for a firm. A day with no on-chain activity
        returns a zeroed summary with an empty `categories` array, not a 404.
      type: object
      properties:
        totalVolumeUsd:
          type: number
          description: Total USD volume (inflow + outflow) for the day.
          example: 1850000
        txnCount:
          type: number
          description: Total transaction count for the day.
          example: 47
        inflowUsd:
          type: number
          example: 1100000
        outflowUsd:
          type: number
          example: 750000
        netFlowUsd:
          type: number
          description: "`inflowUsd` minus `outflowUsd`."
          example: 350000
        volumeWithRiskUsd:
          type: number
          description: >
            Subset of `totalVolumeUsd` from transactions that touched a
            counterparty carrying at least one risk category.
          example: 95000
        volumeWithRiskTxnCount:
          type: number
          description: >
            Subset of `txnCount` from transactions that touched a counterparty
            carrying at least one risk category.
          example: 4
        inflowWithRiskUsd:
          type: number
          description: >
            Subset of `inflowUsd` from transactions that touched a
            counterparty carrying at least one risk category.
          example: 60000
        outflowWithRiskUsd:
          type: number
          description: >
            Subset of `outflowUsd` from transactions that touched a
            counterparty carrying at least one risk category.
          example: 35000
        netFlowWithRiskUsd:
          type: number
          description: "`inflowWithRiskUsd` minus `outflowWithRiskUsd`."
          example: 25000
        categories:
          type: array
          description: >
            Volume and transaction count broken down by category. These rows
            are NOT additive — the same transfer can be counted under more
            than one category, including under both a parent category and
            one of its subcategories. Use `totalVolumeUsd` /
            `volumeWithRiskUsd` above for day totals; use these rows only to
            compare categories against each other.
          items:
            $ref: "#/components/schemas/AmlCategoryVolume"

    AmlExposureCategory:
      description: >
        Category-level flow for one day of an exposure trend. `volumeUsd` is
        the value for the request's `direction` (incoming + outgoing for
        `ALL`); `incomingUsd`/`outgoingUsd` are always the unfiltered values.
      type: object
      properties:
        category:
          type: string
          description: >
            Usually a canonical category key from `GET /aml/categories`, but
            it can also be a raw vendor label — a subcategory (e.g. `CEX`
            under `CEFI`) or a value not yet mapped — so callers must not
            assume every value is a member of that list.
          example: "SCAM"
        incomingUsd:
          type: number
          example: 12000
        outgoingUsd:
          type: number
          example: 8000
        volumeUsd:
          type: number
          example: 20000

    AmlExposureDay:
      description: >
        One day of an exposure trend. Present even when no rows match the
        request's filters — `categories` is just empty — so the day series
        returned by `GET /firms/{firmId}/aml/exposure` has no gaps.
      type: object
      properties:
        date:
          type: string
          format: date
          example: "2026-08-05"
        categories:
          type: array
          description: >
            Category-level flow for the day. NOT additive — the same
            transfer can be counted under more than one category, including
            under both a parent category and one of its subcategories. A
            request filtered by a parent `category` also returns rows for
            any of its subcategories, so this array can still contain more
            than one distinct `category` value, and those rows may overlap.
          items:
            $ref: "#/components/schemas/AmlExposureCategory"

    AmlCounterparty:
      description: >
        A counterparty a firm transacted with on a given day, with its AML
        categories, transfer/transaction breakdown, and net flow. Sorted by
        `totalVolumeUsd` descending in the endpoint's response.
      type: object
      properties:
        chainKey:
          type: string
          example: "eth"
        address:
          type: string
          example: "0x06fd4ba7973a0d39a91734bbc35bc2bcaa99e3b0"
        entityNames:
          type: array
          items:
            type: string
          example: ["Binance"]
        categories:
          type: array
          items:
            type: string
          example: ["Cefi", "CEX"]
        levels:
          type: array
          description: >
            Deduplicated before being returned — the upstream data repeats a
            level once per screening hit, which carries no extra meaning.
          items:
            type: string
          example: []
        status:
          type: string
          nullable: true
          example: "SUCCESS"
        transferCount:
          type: number
          example: 2
        transferVolumeUsd:
          type: number
          example: 816455.3846325568
        transactionCount:
          type: number
          example: 0
        transactionVolumeUsd:
          type: number
          example: 0
        totalCount:
          type: number
          example: 2
        totalVolumeUsd:
          type: number
          example: 816455.3846325568
        inCount:
          type: number
          example: 2
        outCount:
          type: number
          example: 0
        inVolumeUsd:
          type: number
          example: 816455.3846325568
        outVolumeUsd:
          type: number
          example: 0
        netFlowUsd:
          type: number
          example: 816455.3846325568
        screeningIngestedAt:
          type: string
          format: date-time
          nullable: true
          example: "2026-07-26T05:58:43.885Z"

    AmlTransaction:
      description: >
        A single transaction between a firm's monitored wallets and one named
        counterparty on a given day. `direction` is relative to the firm —
        `IN` means the firm's wallet received the funds.
      type: object
      properties:
        id:
          type: string
          example: "tx_9f3a2b1c"
        timestamp:
          type: string
          format: date-time
          example: "2026-08-10T14:22:31.000Z"
        sourceWallet:
          type: string
          example: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
        chain:
          type: string
          example: "eth"
        direction:
          type: string
          enum: [IN, OUT]
          example: "OUT"
        tokenAddress:
          type: string
          nullable: true
          example: "0x1111111111111111111111111111111111111111"
        tokenSymbol:
          type: string
          nullable: true
          example: "USDC"
        tokenName:
          type: string
          nullable: true
          example: "USD Coin"
        tokenLogo:
          type: string
          nullable: true
          example: "https://cdn.certik.com/tokens/usdc.png"
        amount:
          type: number
          example: 15000
        valueUsd:
          type: number
          example: 15000
        txHash:
          type: string
          example: "0x7d1f3c2e4b5a6d7c8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d"
      required:
        - id
        - timestamp
        - sourceWallet
        - chain
        - direction
        - amount
        - valueUsd
        - txHash

    AmlCategoryInfo:
      description: >
        A canonical AML category — the reference data for the `category`
        query parameter accepted by the other AML endpoints. `key` is the
        stable identifier; read it from here rather than hardcoding it.
      type: object
      properties:
        key:
          type: string
          example: "HACK"
        label:
          type: string
          description: English display name.
          example: "Hack"
        risk:
          type: boolean
          description: Whether this category signals risk (vs. a neutral entity type).
          example: true
        subcategories:
          type: array
          description: >
            Finer-grained vendor labels that fold up into this category key.
          items:
            type: string
          example: ["Malware", "Ransomware", "Contract Exploit"]
      required:
        - key
        - label
        - risk
        - subcategories

  parameters:
    PageLimit:
      name: limit
      in: query
      description: Maximum entries in this page
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 100
    PageOffset:
      name: offset
      in: query
      description: Entries to skip. Use nextOffset from the previous response for the next page.
      schema:
        type: integer
        minimum: 0
        maximum: 9007199254740991
        default: 0

  responses:
    InvalidPage:
      description: Invalid limit or offset
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Forbidden:
      description: The organization does not have access to this endpoint
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: Invalid API key
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: Firm not found
    NotFoundAsset:
      description: Asset not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: Asset not found
    MethodNotAllowed:
      description: HTTP method not supported
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    BadRequest:
      description: The request's query parameters failed validation
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: "date must be in YYYY-MM-DD format"

paths:
  /firms:
    get:
      summary: List monitored firms
      description: >
        Returns firms your organization monitors. Each firm includes its rating,
        sector, tags, last update, and counts of linked wallets, assets, and tokens.
        Use the firm resource endpoints to list those entries.
      operationId: listFirms
      tags:
        - Firms
      responses:
        "200":
          description: Firms retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  firms:
                    type: array
                    items:
                      $ref: "#/components/schemas/FirmSummary"
              example:
                firms:
                  - firmId: "strategy"
                    firmName: "Strategy"
                    firmLogo: "https://images.ctfassets.net/jqfm0se0f03r/5wqjV6c5mUUni4m219jzcx/ec76396283cab1c12f96d3c1c8df4f36/strategy.jpg"
                    complianceStatus: "Fully_Compliant"
                    businessImpact: "Medium"
                    addedAt: 1764805329593
                    lastUpdatedAt: 1768132799337
                    rating: { score: 85, grade: B }
                    sector: []
                    tags: []
                    walletCount: 3
                    assetCount: 2
                    tokenCount: 1
                  - firmId: "coinbase-ventures"
                    firmName: "Coinbase Ventures"
                    firmLogo: "https://images.ctfassets.net/jqfm0se0f03r/73MqjVDkhEkGczC3cRcxAQ/34f92230a920d4cc5f65f4ee41f04cb6/coinbase-ventures.png"
                    complianceStatus: "Fully_Compliant"
                    businessImpact: "Critical"
                    addedAt: 1768132799337
                    lastUpdatedAt: 1768132799337
                    rating: { score: 85, grade: B }
                    sector: []
                    tags: []
                    walletCount: 3
                    assetCount: 2
                    tokenCount: 1
        "401":
          $ref: "#/components/responses/Unauthorized"

  /firms/{firmId}:
    get:
      summary: Get firm details
      description: >
        Returns full details for a single monitored firm, combining your
        organization's internal metadata with CertiK's complete firm data
        (ratings, holdings, people, social stats, and more).

        The firm must be in your organization's monitored list — requesting
        a firm you don't monitor returns 404.
      operationId: getFirm
      tags:
        - Firms
      parameters:
        - name: firmId
          in: path
          required: true
          schema:
            type: string
          example: "coinbase-ventures"
      responses:
        "200":
          description: Firm retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  firm:
                    $ref: "#/components/schemas/FirmDetail"
              example:
                firm:
                  firmName: "Coinbase Ventures"
                  firmId: "coinbase-ventures"
                  firmLogo: "https://images.ctfassets.net/jqfm0se0f03r/73MqjVDkhEkGczC3cRcxAQ/34f92230a920d4cc5f65f4ee41f04cb6/coinbase-ventures.png"
                  entityName: "Coinbase Global, Inc."
                  description: "Coinbase Ventures seeks to invest in early-stage companies operating in the cryptocurrency and blockchain technology sectors"
                  website: "https://www.coinbase.com/ventures"
                  twitter: "https://x.com/cbventures"
                  twitterAccountAge: 1341
                  twitterActiveIndicator: "Moderately Active"
                  twitterFollowerCount: 138992
                  twitterTweetCount: 315
                  country:
                    - "United States of America"
                  operatingCountries:
                    - "United States of America"
                  sector:
                    - "Venture Capital"
                  labels:
                    - "Crypto Exchange"
                    - "Crypto Projects Venture"
                  complianceStatus: "Fully_Compliant"
                  license: null
                  breachExposure: "Low"
                  businessImpact: "Critical"
                  addedAt: 1768132799337
                  holdings:
                    - tokenId: "linea"
                      tokenName: "Linea"
                      holdingAmount: 10802000000
                      costBasis: null
                    - tokenId: "ethereum"
                      tokenName: "Ethereum"
                      holdingAmount: 56
                      costBasis: null
                  lastUpdatedAt: 1768132799337
                  rating: { score: 85, grade: B }
                  tags: []
                  walletCount: 3
                  assetCount: 2
                  tokenCount: 1
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"

  /firms/{firmId}/wallets:
    get:
      summary: List wallets for a firm
      operationId: listFirmWallets
      description: Returns unique wallets for a monitored firm, in chain and address order.
      tags: [Firms]
      parameters:
        - name: firmId
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/PageLimit"
        - $ref: "#/components/parameters/PageOffset"
      responses:
        "200":
          description: Firm wallets page
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ListPage"
                  - type: object
                    required: [wallets]
                    properties:
                      wallets:
                        type: array
                        items:
                          $ref: "#/components/schemas/FirmMonitoredWallet"
        "400":
          $ref: "#/components/responses/InvalidPage"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
    post:
      summary: Import wallets for a firm
      description: |
        Bulk-links (and, in `sync` mode, unlinks) on-chain wallets on a monitored
        firm. Built for a repeatable programmatic sync — e.g. a nightly job that
        POSTs your current wallet inventory — so it is **partial-success** and
        **idempotent**, not all-or-nothing.

        The `firmId` in the path must be a firm your organization monitors;
        otherwise the request returns `404` (never `403`, so you cannot probe
        which firm ids exist in other orgs).

        ### Per-row validation (partial success)

        Every row in `wallets` is validated **independently**. Rows that pass are
        applied; rows that fail are returned in `failed` with per-field error
        details — a single bad row never rejects the whole request. See
        `WalletImportError` for the error codes.

        ### Modes

        | `mode`          | Links new wallets | Unlinks wallets absent from the payload | Updates tags on already-linked wallets |
        | --------------- | :---------------: | :-------------------------------------: | :------------------------------------: |
        | `add` (default) |        yes        |                  **no**                 |                 **no**                 |
        | `sync`          |        yes        |                   yes                   |                   yes                  |

        - **`add`** is purely additive: it links wallets it doesn't already have
          and leaves every existing wallet — membership and tags — untouched.
        - **`sync`** treats the payload as the firm's *complete desired* wallet
          list: it links new wallets, unlinks any currently-linked wallet the
          payload doesn't mention, and refreshes tags on already-linked wallets.
          Pass `sync` only when the payload is authoritative.

        ### Unlinking is protected against bad data (`sync` only)

        A wallet is unlinked **only** when no row claims its address. A row that
        *fails* validation but still has a readable `address` counts as claiming
        that wallet, so a typo in some other column can never delete a real
        wallet. Only a wallet that is entirely absent — or named solely by a row
        whose `address` itself is unreadable — is unlinked.

        An **empty** `wallets` array is a valid `sync` request that unlinks every
        wallet on the firm (there is nothing to protect them). In `add` mode an
        empty array is rejected with `400` as a probable mistake.

        ### Tags

        Tags are **derived from the row's flags and `control_model`** (see
        `WalletImportRow`) — the payload has no free-form tag field. Each flag
        maps to a pair: `true` → Hot / Client Asset / Omnibus,
        `false` → Cold / Non-Client Asset / Segregated. Set
        `apply_counterpart_tags` to `false` to tag only `true` flags.

        The predefined import tags are: Hot, Cold, Client Asset, Non-Client
        Asset, Omnibus, Segregated, Single-Sig, Multi-Sig, MPC, 3rd Party
        Custodian, Contract Controlled.
        Any that are missing from your organization's wallet tags are created
        on import. On a `sync` tag refresh, only these import tags are
        reconciled; any other tags applied to the wallet in the CertiK UI are
        **preserved**.

        ### Deduplication & no-ops

        - A wallet named more than once in one payload (duplicate rows, or the
          same address in different letter-casing) is stored **once**.
        - A request that changes nothing (every wallet already present with the
          same tags) is a **no-op**: it writes nothing and does not bump the
          firm's "last updated" timestamp.

        ### Effects beyond wallet membership

        A request that changes membership or tags updates the firm's **Last
        Updated** surface. The next daily rating run will incorporate wallet
        changes; this endpoint does not trigger an immediate rating recompute.

        ### Limits

        - Up to **5000** wallet rows per request (`400` beyond that).
        - Request body up to **10 MB**.
      operationId: importFirmWallets
      tags:
        - Firms
      parameters:
        - name: firmId
          in: path
          required: true
          description: Id of a firm your organization monitors.
          schema:
            type: string
          example: "coinbase-ventures"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - wallets
              properties:
                mode:
                  type: string
                  enum: [add, sync]
                  default: add
                  description: >
                    `add` (default) links only and never touches existing
                    wallets. `sync` treats the payload as the firm's complete
                    wallet list — it also unlinks wallets the payload omits and
                    refreshes tags on already-linked wallets.
                apply_counterpart_tags:
                  type: boolean
                  default: true
                  description: >
                    When `true` (default), a `false` flag derives its
                    counterpart tag (Cold, Non-Client Asset, Segregated).
                    When `false`, only `true` flags derive tags.
                wallets:
                  type: array
                  minItems: 0
                  maxItems: 5000
                  description: >
                    The wallets to apply. May be empty only in `sync` mode (to
                    unlink everything).
                  items:
                    $ref: "#/components/schemas/WalletImportRow"
            examples:
              addNew:
                summary: add — link two new wallets, leave everything else alone
                value:
                  mode: "add"
                  wallets:
                    - address: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
                      blockchain: "ethereum"
                      chain_id: 1
                      is_hot_wallet: true
                      is_client_asset_wallet: false
                      is_omnibus_wallet: false
                      control_model: "multi-sig"
                    - address: "0x61193aec68c90f8ad52365ef3973e57f5519e109"
                      blockchain: "bsc"
                      chain_id: 56
                      is_hot_wallet: false
                      is_client_asset_wallet: true
                      is_omnibus_wallet: false
                      control_model: "mpc"
              syncDesiredState:
                summary: sync — declare the firm's full wallet list
                value:
                  mode: "sync"
                  wallets:
                    - address: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
                      blockchain: "ethereum"
                      chain_id: 1
                      is_hot_wallet: true
                      is_client_asset_wallet: false
                      is_omnibus_wallet: false
                      control_model: "single-sig"
              syncWipe:
                summary: sync — empty list unlinks every wallet on the firm
                value:
                  mode: "sync"
                  wallets: []
      responses:
        "200":
          description: >
            The request was processed. Any rows that failed validation are in
            `failed`; every valid row was applied. Counts in `summary` and the
            `linked`/`unlinked` arrays reflect what was **actually persisted**.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WalletImportResult"
              example:
                summary:
                  received: 4
                  linked: 1
                  unlinked: 1
                  skipped: 1
                  failed: 1
                linked:
                  - address: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
                    chain: "ethereum"
                unlinked:
                  - address: "0x61193aec68c90f8ad52365ef3973e57f5519e109"
                    chain: "bsc"
                failed:
                  - index: 2
                    address: "0x61193aec68c90f8ad52365ef3973e57f5519e109"
                    linked: true
                    errors:
                      - field: "chain_id"
                        code: "unsupported_chain"
                        message: "chain_id 999 is not supported. Supported chain ids: 0, 1, 10, 56, 137, 8453, 9745, 42161, 43114, 59144, 728126428."
        "400":
          description: >
            The request itself is unusable and nothing was written. Causes:
            invalid JSON; `wallets` is not an array; more than 5000 rows; an
            unknown `mode`; `apply_counterpart_tags` is not a boolean; or an
            empty `wallets` array in `add` mode. (A body
            over 4 MiB is rejected by the server with `413` before the handler
            runs.)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                error: "wallets must be an array"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          description: >
            The organization lacks access to Firms or this API key does not have wallet import access.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                error: "This API key cannot import wallets"
        "404":
          $ref: "#/components/responses/NotFound"

  /firms/{firmId}/assets:
    get:
      summary: List assets for a firm
      operationId: listFirmAssets
      description: Returns unique assets for a monitored firm, in asset ID order.
      tags: [Firms]
      parameters:
        - name: firmId
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/PageLimit"
        - $ref: "#/components/parameters/PageOffset"
      responses:
        "200":
          description: Firm assets page
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ListPage"
                  - type: object
                    required: [assets]
                    properties:
                      assets:
                        type: array
                        items:
                          $ref: "#/components/schemas/FirmLinkedAsset"
        "400":
          $ref: "#/components/responses/InvalidPage"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"

  /firms/{firmId}/tokens:
    get:
      summary: List tokens for a firm
      operationId: listFirmTokens
      description: Returns unique tokens for a monitored firm, in token ID order.
      tags: [Firms]
      parameters:
        - name: firmId
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/PageLimit"
        - $ref: "#/components/parameters/PageOffset"
      responses:
        "200":
          description: Firm tokens page
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ListPage"
                  - type: object
                    required: [tokens]
                    properties:
                      tokens:
                        type: array
                        items:
                          $ref: "#/components/schemas/FirmLinkedToken"
        "400":
          $ref: "#/components/responses/InvalidPage"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"

  /firms/{firmId}/aml/summary:
    get:
      summary: Get firm AML daily summary
      description: >
        AML flow summary for a monitored firm on a single UTC day: total
        volume, transaction count, inflow/outflow/net flow, and the
        risk-touched subset of each, broken down by category.

        A day with no on-chain activity returns a zeroed summary with an
        empty `categories` array, not a `404`.
      operationId: getFirmAmlSummary
      tags:
        - AML
      parameters:
        - name: firmId
          in: path
          required: true
          description: Id of a firm your organization monitors.
          schema:
            type: string
          example: "yzilabs"
        - name: date
          in: query
          required: true
          description: >
            UTC day to summarize, `YYYY-MM-DD`. Must not be after yesterday
            (UTC), or the request is rejected with 400.
            Daily-aggregate coverage begins 2026-06-25; a date before that
            returns 200 with a zeroed summary rather than an error.
          schema:
            type: string
            format: date
          example: "2026-07-30"
      responses:
        "200":
          description: Summary retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  firmId:
                    type: string
                  date:
                    type: string
                    format: date
                  summary:
                    $ref: "#/components/schemas/AmlSummary"
              example:
                firmId: "yzilabs"
                date: "2026-07-30"
                summary:
                  totalVolumeUsd: 1299208.3440012897
                  txnCount: 21
                  inflowUsd: 1035699.649058127
                  outflowUsd: 263508.6949431628
                  netFlowUsd: 772190.9541149641
                  volumeWithRiskUsd: 220959.264039868
                  volumeWithRiskTxnCount: 1
                  inflowWithRiskUsd: 220959.264039868
                  outflowWithRiskUsd: 0
                  netFlowWithRiskUsd: 220959.264039868
                  categories:
                    - category: "CEFI"
                      volumeUsd: 1035699.649058127
                      txnCount: 2
                    - category: "CEX"
                      volumeUsd: 1035699.649058127
                      txnCount: 2
                    - category: "SANCTIONED"
                      volumeUsd: 220959.264039868
                      txnCount: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /firms/{firmId}/aml/exposure:
    get:
      summary: Get firm AML exposure trend
      description: >
        Gap-free daily series of AML category exposure for a monitored firm
        over a date range, optionally filtered to one category and/or one
        flow direction.

        `direction` sets each row's `volumeUsd` to that direction's value
        (incoming + outgoing for `ALL`) and drops rows where it is `0`;
        `incomingUsd`/`outgoingUsd` are always unfiltered. Days with no
        matching rows still appear in `days`, with an empty `categories`
        array, so the series never has date gaps.

        The range is capped at 92 days — a longer span returns `400`.

        Categories are raw screening labels and overlap (Sanction is part of Sanctioned, Mixer of Mixing), so adding them counts the same volume more than once.
      operationId: getFirmAmlExposure
      tags:
        - AML
      parameters:
        - name: firmId
          in: path
          required: true
          description: Id of a firm your organization monitors.
          schema:
            type: string
          example: "coinbase-ventures"
        - name: from
          in: query
          required: false
          description: >
            Start of the range (UTC day), `YYYY-MM-DD`. Defaults to 30 days
            before `to`.
          schema:
            type: string
            format: date
          example: "2026-07-12"
        - name: to
          in: query
          required: false
          description: >
            End of the range (UTC day), `YYYY-MM-DD`. Defaults to yesterday
            (UTC).
          schema:
            type: string
            format: date
          example: "2026-08-10"
        - name: category
          in: query
          required: false
          description: >
            Restrict to a single AML category. See `GET /aml/categories`.
            Filtering by a parent category also returns rows tagged with any
            of its subcategories (e.g. `category=SANCTION` matches a row
            stored as `OFAC`), so a filtered response's `days[].categories`
            can contain more than one distinct `category` value — and, since
            category volumes are not additive, those rows may overlap.
          schema:
            type: string
            enum:
              - SANCTIONED
              - SANCTION
              - TERRORIST_FINANCING
              - CHILD_ABUSE
              - HACK
              - SCAM
              - RANSOMWARE
              - DARKWEB
              - MIXING
              - MIXER
              - LAUNDERING
              - ILLEGAL_ACTIVITY
              - NO_KYC_EXCHANGE
              - GAMBLING
              - BLOCKED
              - BLACKLISTED
              - UNREGISTERED_VASP
              - RISKY_ESCROW
              - CEFI
              - INFRA
              - DAPP
              - TOKEN
              - WALLET
              - ORGANIZATION
              - INDIVIDUAL
              - BOT
              - VICTIM
          example: "HACK"
        - name: direction
          in: query
          required: false
          schema:
            type: string
            enum: [ALL, IN, OUT]
            default: ALL
          description: >
            `ALL` sums incoming and outgoing into `volumeUsd` (default). `IN`
            or `OUT` restricts `volumeUsd` to that direction and drops rows
            where it is `0`.
          example: "ALL"
      responses:
        "200":
          description: Exposure trend retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  firmId:
                    type: string
                  from:
                    type: string
                    format: date
                  to:
                    type: string
                    format: date
                  direction:
                    type: string
                    enum: [ALL, IN, OUT]
                  category:
                    type: string
                    nullable: true
                    description: The requested category filter, or `null` when unfiltered.
                  days:
                    type: array
                    items:
                      $ref: "#/components/schemas/AmlExposureDay"
              example:
                firmId: "coinbase-ventures"
                from: "2026-07-12"
                to: "2026-08-10"
                direction: "ALL"
                category: null
                days:
                  - date: "2026-08-09"
                    categories:
                      - category: "HACK"
                        incomingUsd: 0
                        outgoingUsd: 12000
                        volumeUsd: 12000
                  - date: "2026-08-10"
                    categories: []
        "400":
          description: >
            The requested `[from, to]` range exceeds 92 days, or `from`/`to`
            is not a valid `YYYY-MM-DD` date.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                error: "date range cannot exceed 92 days"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /firms/{firmId}/aml/counterparties:
    get:
      summary: List firm AML counterparties
      description: >
        Counterparties a monitored firm transacted with on a single UTC day,
        with each counterparty's AML categories, transfer/transaction
        breakdown, and net flow. Sorted by `totalVolumeUsd` descending.

        Feeds `GET /firms/{firmId}/aml/transactions`: pass a row's `chainKey`
        as `chain` and `address` as `counterparty`.

        The query caps out at **1000 rows** per firm/day. When
        `page.truncated` is `true`, `page.total` is that cap, not the true
        total — add a `category`, or `riskOnly=true`, to narrow it down.

        Each counterparty's `categories` mixes risk factors (such as Sanctioned or Mixing) with screening labels that overlap them (such as Sanction or Mixer).
      operationId: listFirmAmlCounterparties
      tags:
        - AML
      parameters:
        - name: firmId
          in: path
          required: true
          description: Id of a firm your organization monitors.
          schema:
            type: string
          example: "jingdong-coinlink-technology"
        - name: date
          in: query
          required: true
          description: >
            UTC day, `YYYY-MM-DD`. Must not be after yesterday (UTC), or
            the request is rejected with 400. Daily-aggregate coverage begins
            2026-06-25; a date before that returns 200 with an empty result
            rather than an error.
          schema:
            type: string
            format: date
          example: "2026-07-30"
        - name: category
          in: query
          required: false
          description: >
            Restrict to counterparties carrying this category. Optional —
            omitting it returns every screened counterparty for that day,
            ranked by `totalVolumeUsd` descending.
          schema:
            type: string
            enum:
              - SANCTIONED
              - SANCTION
              - TERRORIST_FINANCING
              - CHILD_ABUSE
              - HACK
              - SCAM
              - RANSOMWARE
              - DARKWEB
              - MIXING
              - MIXER
              - LAUNDERING
              - ILLEGAL_ACTIVITY
              - NO_KYC_EXCHANGE
              - GAMBLING
              - BLOCKED
              - BLACKLISTED
              - UNREGISTERED_VASP
              - RISKY_ESCROW
              - CEFI
              - INFRA
              - DAPP
              - TOKEN
              - WALLET
              - ORGANIZATION
              - INDIVIDUAL
              - BOT
              - VICTIM
          example: "SANCTIONED"
        - name: riskOnly
          in: query
          required: false
          description: >
            When `true`, keeps only counterparties carrying at least one risk
            category.
          schema:
            type: boolean
            default: false
          example: true
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: Maximum counterparties to return. Defaults to 50, capped at 200.
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of counterparties to skip (offset). Defaults to 0.
      responses:
        "200":
          description: Counterparties retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  firmId:
                    type: string
                  date:
                    type: string
                    format: date
                  counterparties:
                    type: array
                    items:
                      $ref: "#/components/schemas/AmlCounterparty"
                  page:
                    type: object
                    properties:
                      total:
                        type: integer
                      skip:
                        type: integer
                      limit:
                        type: integer
                      hasMore:
                        type: boolean
                      truncated:
                        type: boolean
                        description: >
                          `true` when the underlying query hit its 1000-row
                          cap for this firm/day — `total` is that cap, not
                          the true grand total. Add a `category`, or use
                          `riskOnly=true`, to narrow the query and see the
                          rest.
                    required:
                      - total
                      - skip
                      - limit
                      - hasMore
                      - truncated
              example:
                firmId: "jingdong-coinlink-technology"
                date: "2026-07-30"
                counterparties:
                  - chainKey: "eth"
                    address: "0x06fd4ba7973a0d39a91734bbc35bc2bcaa99e3b0"
                    entityNames:
                      - "Binance"
                    categories:
                      - "Cefi"
                      - "CEX"
                    levels: []
                    status: "SUCCESS"
                    transferCount: 2
                    transferVolumeUsd: 816455.3846325568
                    transactionCount: 0
                    transactionVolumeUsd: 0
                    totalCount: 2
                    totalVolumeUsd: 816455.3846325568
                    inCount: 2
                    outCount: 0
                    inVolumeUsd: 816455.3846325568
                    outVolumeUsd: 0
                    netFlowUsd: 816455.3846325568
                    screeningIngestedAt: "2026-07-26T05:58:43.885Z"
                page:
                  total: 1
                  skip: 0
                  limit: 50
                  hasMore: false
                  truncated: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /firms/{firmId}/aml/transactions:
    get:
      summary: List firm AML counterparty transactions
      description: >
        Individual transactions between a monitored firm's wallets and one
        named counterparty on a single UTC day. `direction` is relative to
        the firm — `IN` means the firm's wallet received the funds.

        The query caps out at **1000 rows** per firm/counterparty/day. When
        `page.truncated` is `true`, `page.total` is that cap, not the true
        total, and the response holds the 1000 most recent rows — narrow
        `date` or `counterparty` to see the rest.
      operationId: listFirmAmlCounterpartyTransactions
      tags:
        - AML
      parameters:
        - name: firmId
          in: path
          required: true
          description: Id of a firm your organization monitors.
          schema:
            type: string
          example: "jingdong-coinlink-technology"
        - name: date
          in: query
          required: true
          description: >
            UTC day, `YYYY-MM-DD`. Must not be after yesterday (UTC), or
            the request is rejected with 400. Daily-aggregate coverage begins
            2026-06-25; a date before that returns 200 with an empty result
            rather than an error.
          schema:
            type: string
            format: date
          example: "2026-07-30"
        - name: chain
          in: query
          required: true
          description: >
            Chain of the counterparty, e.g. from `chainKey` on
            `GET /firms/{firmId}/aml/counterparties`.
          schema:
            type: string
          example: "eth"
        - name: counterparty
          in: query
          required: true
          description: >
            Address of the counterparty, e.g. from `address` on
            `GET /firms/{firmId}/aml/counterparties`.
          schema:
            type: string
          example: "0x06fd4ba7973a0d39a91734bbc35bc2bcaa99e3b0"
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: Maximum transactions to return. Defaults to 50, capped at 200.
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of transactions to skip (offset). Defaults to 0.
      responses:
        "200":
          description: Transactions retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  firmId:
                    type: string
                  date:
                    type: string
                    format: date
                  chain:
                    type: string
                  counterparty:
                    type: string
                  transactions:
                    type: array
                    items:
                      $ref: "#/components/schemas/AmlTransaction"
                  page:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: >
                          Total matching transactions, or the 1000-row cap
                          when `truncated` is `true`.
                      skip:
                        type: integer
                      limit:
                        type: integer
                      hasMore:
                        type: boolean
                      truncated:
                        type: boolean
                        description: >
                          `true` when the underlying query hit its 1000-row
                          cap for this firm/counterparty/day — `total` is that
                          cap, not the true grand total. Narrow `date` or
                          `counterparty` to see the rest.
                    required:
                      - total
                      - skip
                      - limit
                      - hasMore
                      - truncated
              example:
                firmId: "jingdong-coinlink-technology"
                date: "2026-07-30"
                chain: "eth"
                counterparty: "0x06fd4ba7973a0d39a91734bbc35bc2bcaa99e3b0"
                transactions:
                  - id: "tx_9f3a2b1c"
                    timestamp: "2026-08-10T14:22:31.000Z"
                    sourceWallet: "0xe470a5c333daa8403d9547f5c0ccb5ce300b8dcf"
                    chain: "eth"
                    direction: "OUT"
                    tokenAddress: "0x1111111111111111111111111111111111111111"
                    tokenSymbol: "USDC"
                    tokenName: "USD Coin"
                    tokenLogo: "https://cdn.certik.com/tokens/usdc.png"
                    amount: 15000
                    valueUsd: 15000
                    txHash: "0x7d1f3c2e4b5a6d7c8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d"
                page:
                  total: 6
                  skip: 0
                  limit: 50
                  hasMore: false
                  truncated: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /aml/categories:
    get:
      summary: List AML categories
      description: >
        Every canonical AML category — the reference data behind the
        `category` query parameter on the other AML endpoints. `key` is the
        stable identifier; read it from here rather than hardcoding category
        keys.
      operationId: listAmlCategories
      tags:
        - AML
      responses:
        "200":
          description: Categories retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  categories:
                    type: array
                    items:
                      $ref: "#/components/schemas/AmlCategoryInfo"
              example:
                categories:
                  - key: "SANCTIONED"
                    label: "Sanctioned"
                    risk: true
                    subcategories: []
                  - key: "HACK"
                    label: "Hack"
                    risk: true
                    subcategories:
                      - "Malware"
                      - "Ransomware"
                      - "Private Key Compromise"
                      - "Contract Exploit"
                  - key: "CEFI"
                    label: "CeFi"
                    risk: false
                    subcategories:
                      - "CEX"
                      - "Instant Swap"
                      - "OTC"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /wallets:
    get:
      summary: List organization wallets
      description: >
        Returns one page of wallets across the firms your key can access, including the
        organization's own firm. A wallet appears once per chain and address.
        Results use stable chain and address order. Follow nextOffset to get all pages.
      operationId: listWallets
      tags:
        - Wallets
      parameters:
        - $ref: "#/components/parameters/PageLimit"
        - $ref: "#/components/parameters/PageOffset"
      responses:
        "200":
          description: Wallets retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ListPage"
                  - type: object
                    required: [wallets, truncated]
                    properties:
                      wallets:
                        type: array
                        items:
                          $ref: "#/components/schemas/MonitoredWallet"
                      truncated:
                        type: boolean
                        description: True when another page is available
              example:
                totalCount: 1
                nextOffset: null
                truncated: false
                wallets:
                  - chain: "ethereum"
                    address: "0x1234567890123456789012345678901234567890"
                    firmIds:
                      - "coinbase-ventures"
                    tags:
                      - "Treasury"
                    totalBalance: 125000.5
                    riskLevel: "low"
                    riskScore: 1
                    riskRawScore: 12
                    riskTags: []
                    latestTxTimestamp: "1710000000"
                    transferAnalytics: null
        "400":
          $ref: "#/components/responses/InvalidPage"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"

  /transactions/summary:
    get:
      summary: Transaction analytics summary
      description: >
        Returns **Total Transactions**, **Total Volume**, **Risk Transactions**,
        and **Risk Volume** across all monitored-firm wallets for your organization,
        for the selected time window.
      operationId: getTransactionAnalyticsSummary
      tags:
        - Transactions
      parameters:
        - name: timePeriod
          in: query
          required: false
          schema:
            type: string
            enum: [ONE_DAY, SEVEN_DAYS, THIRTY_DAYS]
            default: SEVEN_DAYS
          description: Rolling window (defaults to past 7 days)
      responses:
        "200":
          description: Summary retrieved successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionAnalyticsSummary"
              example:
                timePeriod: "SEVEN_DAYS"
                totalTransactions: 1240
                totalVolume: 5829103.42
                riskTransactions: 88
                riskVolume: 142003.15
        "401":
          $ref: "#/components/responses/Unauthorized"

  /assets/{assetId}:
    get:
      summary: Get asset by ID
      description: >
        Returns Skynet scores and market data for a monitored asset.
      operationId: getAsset
      tags:
        - Assets
      parameters:
        - name: assetId
          in: path
          required: true
          schema:
            type: string
          example: "binance"
      responses:
        "200":
          description: Asset retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  asset:
                    $ref: "#/components/schemas/Asset"
              example:
                asset:
                  id: "binance"
                  name: "BNB Chain"
                  logo: "https://images.ctfassets.net/jqfm0se0f03r/19Qm4qKq6ZWGKW8cErMrfO/d652ec7300be4109736439ca02f1dc36/bnb-icon4_2x.png"
                  tokenTickers:
                    - "BNB"
                    - "BUSD"
                    - "BIDR"
                    - "BGBP"
                  skynetScore:
                    score: 95.45
                    rank: 5
                    scoreCodeSecurity: 94.26
                    scoreCommunity: 98
                    scoreFundamental: 96.3
                    scoreGovernance: 92.66999816894531
                    scoreMarket: 96
                    scoreOperation: 94.69000244140625
                  price: 607.1789009371031
                  marketCap: 82733737833
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFoundAsset"

  /metrics/catalog:
    get:
      summary: See which metrics are available
      description: >
        Lists every metric you can ask for, with its unit, its kind, and the
        days that have data. It also lists your risk categories and example
        requests you can copy.
      operationId: getMetricCatalog
      tags:
        - Metrics
      responses:
        "200":
          description: The list of metrics.
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    description: Every metric you can ask for.
                    items:
                      $ref: "#/components/schemas/WalletMetricCatalogEntry"
                  riskCategories:
                    type: array
                    description: The risk categories in your data. Use them in `categories`.
                    items:
                      type: object
                      properties:
                        category:
                          type: string
                          description: The category name.
                        defaultSelected:
                          type: boolean
                          description: "`true` when this category counts if you do not choose categories."
                  riskCategoryGroups:
                    type: array
                    description: Ready-made category groups, the same ones the dashboard uses. Pass a group's `categories` in `categories`.
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          enum: [aml, incident, defi]
                          description: The group id.
                        label:
                          type: string
                          description: The name to show to people.
                        categories:
                          type: array
                          description: The categories in the group.
                          items:
                            type: string
                  examples:
                    type: array
                    description: Example requests you can copy. They use your own tag names.
                    items:
                      type: object
                      properties:
                        description:
                          type: string
                          description: What the request gives you.
                        path:
                          type: string
                          description: The request to send.
              example:
                metrics:
                  - key: "balance_usd"
                    label: "Holding balance"
                    unit: "usd"
                    kind: "level"
                    description: "Total USD value the wallets held at the end of each day (UTC), counting only tagged assets when you use asset tags."
                    endpoint: "/metrics"
                    source: "Daily end-of-day balance per wallet"
                    grain: "wallet_day"
                    historyStart: "2026-09-02"
                    latestDay: "2026-09-23"
                    includesPartialToday: false
                    supportsAssetTags: true
                    assetTagFilter:
                      source: "Daily end-of-day balance per wallet and asset"
                      grain: "wallet_asset_day"
                      historyStart: "2026-09-15"
                      latestDay: "2026-09-23"
                      includesPartialToday: false
                    supportsGroupByAsset: true
                    supportsGroupByWallet: true
                    supportsCategories: false
                  - key: "inflow_usd"
                    label: "Inflow"
                    unit: "usd"
                    kind: "flow"
                    description: "USD value the wallets received each day from token and coin transfers."
                    endpoint: "/metrics"
                    source: "Daily transfer and transaction totals per wallet"
                    grain: "wallet_day"
                    historyStart: "2026-08-18"
                    latestDay: "2026-09-23"
                    includesPartialToday: false
                    supportsAssetTags: true
                    assetTagFilter:
                      source: "Daily transfer totals per wallet and asset"
                      grain: "wallet_asset_day"
                      historyStart: "2026-03-19"
                      latestDay: "2026-09-23"
                      includesPartialToday: true
                    supportsGroupByAsset: true
                    supportsGroupByWallet: true
                    supportsCategories: false
                  - key: "risk_exposure_usd"
                    label: "Risk exposure"
                    unit: "usd"
                    kind: "flow"
                    description: "USD moved to or from addresses in the chosen risk categories each day. Each wallet counts once per day, using its largest category, so the total can be slightly below the exact figure."
                    endpoint: "/metrics"
                    source: "Daily activity with addresses flagged as risky, per wallet and risk category"
                    grain: "wallet_category_day"
                    historyStart: "2026-07-16"
                    latestDay: "2026-09-23"
                    includesPartialToday: false
                    supportsAssetTags: false
                    assetTagFilter: null
                    supportsGroupByAsset: false
                    supportsGroupByWallet: true
                    supportsCategories: true
                    categoriesAdditive: false
                riskCategories:
                  - category: "Blocked"
                    defaultSelected: true
                  - category: "Cefi"
                    defaultSelected: false
                  - category: "OFAC"
                    defaultSelected: false
                  - category: "Sanctioned"
                    defaultSelected: true
                  - category: "Scam"
                    defaultSelected: true
                riskCategoryGroups:
                  - key: "aml"
                    label: "AML exposure"
                    categories:
                      [
                        "Sanctioned",
                        "Sanction",
                        "OFAC",
                        "FATF Blacklist",
                        "EU",
                        "UN",
                        "HMT",
                        "CN",
                        "DFAT",
                        "NBCTF",
                        "FinCEN",
                        "MAS",
                        "MOF",
                        "Trésor",
                        "FCDO",
                        "Illegal Activity",
                        "Terrorism",
                        "Child Abuse",
                        "Darknet",
                        "Blackmail",
                        "Money Laundering",
                        "Drug",
                        "Cyber Crime",
                        "Gambling",
                        "Risky Escrow",
                        "Human Trafficking",
                        "Laundering",
                        "Terrorist Financing",
                        "Blocked",
                        "Frozen",
                        "Unfrozen",
                        "Mixing",
                        "Mixer",
                        "Contract Mixer",
                        "Custodial Mixer",
                        "Privacy Pool",
                        "Coinjoin",
                        "Scam",
                        "Phishing",
                        "Rugpull",
                        "Ponzi",
                        "Fake Token",
                        "Impersonation",
                        "Investment Fraud",
                        "Giveaway Scam",
                        "Social Media Scam",
                        "Sextortion",
                        "Honeypot",
                      ]
                  - key: "incident"
                    label: "Incident exposure"
                    categories:
                      [
                        "Hack",
                        "Malware",
                        "Ransomware",
                        "Private Key Compromise",
                        "Unauthorized Access",
                        "Contract Exploit",
                        "Social Engineering",
                        "Supply Chain Attack",
                        "DNS Hijack",
                        "Wallet Clipper",
                      ]
                  - key: "defi"
                    label: "DeFi engagement"
                    categories: ["DEX", "Bridge", "Dapp"]
                examples:
                  - description: "Daily balance for each wallet tag over the last 30 days"
                    path: "/metrics?metric=balance_usd&walletTags=3rd%20Party%20Custodian&walletTags=Cold&days=30"
                  - description: "Daily total balance for each firm"
                    path: "/metrics?metric=balance_usd&groupBy=firm"
                  - description: "Balance per asset: daily balance of your 10 largest assets, with the rest in Other assets"
                    path: "/metrics?metric=balance_usd&groupBy=asset&days=30"
                  - description: "Daily risk exposure for each wallet tag"
                    path: "/metrics?metric=risk_exposure_usd&walletTags=3rd%20Party%20Custodian&walletTags=Cold"
                  - description: "Daily balance for each firm tag"
                    path: "/metrics?metric=balance_usd&firmTags=Brokerage&firmTags=CeFi"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /metrics:
    get:
      summary: Get metrics
      description: |
        Get daily numbers for your wallets, such as balances, money in and out, or risk exposure. You can split them by wallet tag, firm tag, firm, asset tag, asset, or wallet, or get one total.

        **Organization, firm, or wallet level**

        - Organization: `?metric=balance_usd&groupBy=org` gives one daily line for your whole organization. You get this when you do not add `groupBy`.
        - Firm: `?metric=balance_usd&groupBy=firm` gives one daily line for each firm. For one firm only, add `firms=`, for example `?metric=balance_usd&groupBy=firm&firms=Bybit`. You can also use `firmIds=` with the firm id.
        - Wallet: `?metric=balance_usd&groupBy=wallet` gives your 10 largest wallets and one "Other" line. Change this with `limit`.
        - The wallet count metrics `monitored_wallets` and `wallets_with_balance` cannot be split by wallet.
        - A wallet linked to more than one firm counts in each of those firms. So the firm lines can add up to more than the organization total.

        **Quick start**

        - `?metric=balance_usd&walletTags=Hot&walletTags=Cold&days=30` gives the daily balance of each wallet tag for the last 30 days.
        - `?metric=balance_usd&firmTags=Exchange&firmTags=Regulated` gives the daily balance of the wallets of each firm tag.
        - `?metric=balance_usd&groupBy=firm` gives the daily balance of each firm.
        - `?metric=risk_exposure_usd&walletTags=Hot` gives the money that moved to or from risky addresses each day.
        - `?metric=balance_usd&groupBy=asset&days=30` gives the daily balance of your 10 largest assets, such as Bitcoin and Tether, and one line for all other assets.

        Replace spaces in names with %20. Balances show the value on each day; activity metrics show what happened that day and also a total for the period.

        **Good to know**

        - Tags apply to all past days: a wallet or firm tagged today counts on every day.
        - A wallet in two of the selected tags counts in both lines. `totals.distinct` shows the selected tags together, each wallet counted once.
        - Risk categories overlap, so do not add them up. A category with no data for your wallets gives 0.
        - `groupBy=asset` and `groupBy=wallet` show the 10 largest lines (change this with `limit`) and put the rest in one "Other" line. Balances rank by the last day, activity by the total for the period.
        - When you choose assets (`assets`, `assetIds`) or wallets (`wallets`), each one gets its own line and there is no Other line. Tokens with no known asset always go into Other assets. An asset with no known name shows its id.
        - Add `format=csv` to get a spreadsheet file.
        - Data is complete up to yesterday (UTC). Days with no data yet are empty (null); days with data but no activity are 0.
        - You can ask for up to 366 days.
      operationId: getWalletMetrics
      tags:
        - Metrics
      parameters:
        - name: metric
          in: query
          required: true
          description: What to measure. See `GET /metrics/catalog` for what each one means.
          example: balance_usd
          schema:
            type: string
            enum:
              - balance_usd
              - wallets_with_balance
              - monitored_wallets
              - inflow_usd
              - outflow_usd
              - netflow_usd
              - incoming_transfers
              - outgoing_transfers
              - transfers
              - transactions
              - incoming_transactions
              - outgoing_transactions
              - risk_exposure_usd
              - risk_inflow_usd
              - risk_outflow_usd
              - risk_events
              - assets_held
        - name: walletTags
          in: query
          required: false
          description: Wallet tag names, separated by commas. Capital letters do not matter. For a name with a comma, repeat `walletTags=`.
          example: "Hot,Cold"
          schema:
            type: string
        - name: groupBy
          in: query
          required: false
          description: "How to split results into lines. Default: by the tags, assets, or wallets you give; otherwise `org`, one line for your whole organization. `none` still works as an older name for `org`."
          example: firm
          schema:
            type: string
            enum: [wallet_tag, firm_tag, firm, asset_tag, asset, wallet, org]
        - name: days
          in: query
          required: false
          description: How many days to show, ending yesterday (UTC). From 1 to 366. Default is 30.
          example: 30
          schema:
            type: integer
            minimum: 1
            maximum: 366
        - name: from
          in: query
          required: false
          description: The first day to show, as `YYYY-MM-DD`. Use instead of `days`.
          example: "2026-09-01"
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: false
          description: The last day to show, as `YYYY-MM-DD`. Default is yesterday (UTC).
          example: "2026-09-23"
          schema:
            type: string
            format: date
        - name: firmTags
          in: query
          required: false
          description: Firm tag names, separated by commas. Capital letters do not matter. For a name with a comma, repeat `firmTags=`.
          example: "Exchange,Regulated"
          schema:
            type: string
        - name: firms
          in: query
          required: false
          description: Firm names, separated by commas. Only these firms count. For a name with a comma, repeat `firms=`.
          example: "Bybit"
          schema:
            type: string
        - name: assetTags
          in: query
          required: false
          description: Asset tag names, separated by commas. Only these assets count. Works with balance, transfer, and assets_held metrics.
          example: "Stablecoin"
          schema:
            type: string
        - name: assets
          in: query
          required: false
          description: Asset names, symbols, or ids, separated by commas. Only these assets count. Works with balance, transfer, and assets_held metrics.
          example: "Bitcoin,USDT"
          schema:
            type: string
        - name: wallets
          in: query
          required: false
          description: "Wallets as `chain:address`, separated by commas. Only these wallets count."
          example: "eth:0x28c6c06298d514db089934071355e5743bf21d60"
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: "With `groupBy=asset` or `groupBy=wallet`: lines before the Other line, 1 to 50. Not with `assets` or `wallets`."
          example: 10
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 10
        - name: categories
          in: query
          required: false
          description: "Risk metrics only. Categories to include; any known category works. Default: `defaultSelected: true` categories in `GET /metrics/catalog`. Each wallet counts once per day, using its largest chosen category, so totals can be slightly below the exact figure. Each name counts only that category; spelling and spaces do not matter (Terrorist Financing = TerroristFinancing, Risky Escrow = Riskyescrow)."
          example: "Scam,Sanctioned"
          schema:
            type: string
        - name: format
          in: query
          required: false
          description: "`json` (default) or `csv` for a spreadsheet file with one row per day."
          example: csv
          schema:
            type: string
            enum: [json, csv]
            default: json
        - name: includeUntaggedWallets
          in: query
          required: false
          description: Add a line for wallets with none of the selected wallet tags.
          example: true
          schema:
            type: boolean
            default: false
        - name: walletTagIds
          in: query
          required: false
          description: Wallet tag ids, if you prefer ids to names. Do not send with `walletTags`.
          example: "11111111-1111-4111-8111-111111111111"
          schema:
            type: string
        - name: firmTagIds
          in: query
          required: false
          description: Firm tag ids, if you prefer ids to names. Do not send with `firmTags`.
          schema:
            type: string
        - name: firmIds
          in: query
          required: false
          description: Firm ids, if you prefer ids to names. Do not send with `firms`.
          schema:
            type: string
        - name: assetTagIds
          in: query
          required: false
          description: Asset tag ids, if you prefer ids to names. Do not send with `assetTags`.
          schema:
            type: string
        - name: assetIds
          in: query
          required: false
          description: Asset ids, such as `bitcoin`, if you prefer ids to names. Do not send with `assets`.
          example: "bitcoin,tether"
          schema:
            type: string
      responses:
        "200":
          description: The daily numbers you asked for.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WalletMetricsResponse"
              examples:
                balanceByWalletTag:
                  summary: "Balance by wallet tag: ?metric=balance_usd&walletTags=Hot&walletTags=Treasury&days=2"
                  value:
                    metric: "balance_usd"
                    unit: "usd"
                    kind: "level"
                    groupBy: "wallet_tag"
                    from: "2026-09-22"
                    to: "2026-09-23"
                    membershipMode: "current_tags_applied_to_history"
                    series:
                      - key: "11111111-1111-4111-8111-111111111111"
                        label: "Hot"
                        points:
                          - date: "2026-09-22"
                            value: 2994170951.39
                          - date: "2026-09-23"
                            value: 2916534541.83
                        summary:
                          latest: 2916534541.83
                          latestDate: "2026-09-23"
                          periodTotal: null
                      - key: "22222222-2222-4222-8222-222222222222"
                        label: "Treasury"
                        points:
                          - date: "2026-09-22"
                            value: 628217279.27
                          - date: "2026-09-23"
                            value: 695176617.25
                        summary:
                          latest: 695176617.25
                          latestDate: "2026-09-23"
                          periodTotal: null
                    totals:
                      distinct:
                        - date: "2026-09-22"
                          value: 3622388230.66
                        - date: "2026-09-23"
                          value: 3611711159.08
                      summary:
                        latest: 3611711159.08
                        latestDate: "2026-09-23"
                        periodTotal: null
                    overlap:
                      walletsInMultipleSelectedTags: 0
                    freshness:
                      latestDay: "2026-09-23"
                      includesPartialToday: false
                balanceByFirmTag:
                  summary: "Balance by firm tag: ?metric=balance_usd&firmTags=Venture%20Capital&firmTags=Regulated&days=2"
                  value:
                    metric: "balance_usd"
                    unit: "usd"
                    kind: "level"
                    groupBy: "firm_tag"
                    from: "2026-09-22"
                    to: "2026-09-23"
                    membershipMode: "current_tags_applied_to_history"
                    series:
                      - key: "33333333-3333-4333-8333-333333333333"
                        label: "Venture Capital"
                        points:
                          - date: "2026-09-22"
                            value: 6060795.53
                          - date: "2026-09-23"
                            value: 4910115.44
                        summary:
                          latest: 4910115.44
                          latestDate: "2026-09-23"
                          periodTotal: null
                      - key: "44444444-4444-4444-8444-444444444444"
                        label: "Regulated"
                        points:
                          - date: "2026-09-22"
                            value: 82053302776.44
                          - date: "2026-09-23"
                            value: 80677468814.14
                        summary:
                          latest: 80677468814.14
                          latestDate: "2026-09-23"
                          periodTotal: null
                    totals:
                      distinct:
                        - date: "2026-09-22"
                          value: 82053341453.76
                        - date: "2026-09-23"
                          value: 80677506573.61
                      summary:
                        latest: 80677506573.61
                        latestDate: "2026-09-23"
                        periodTotal: null
                    overlap:
                      walletsInMultipleSelectedFirmTags: 4
                    freshness:
                      latestDay: "2026-09-23"
                      includesPartialToday: false
                balanceByAsset:
                  summary: "Balance per asset: ?metric=balance_usd&groupBy=asset&limit=2&days=2"
                  value:
                    metric: "balance_usd"
                    unit: "usd"
                    kind: "level"
                    groupBy: "asset"
                    from: "2026-09-22"
                    to: "2026-09-23"
                    membershipMode: "current_tags_applied_to_history"
                    series:
                      - key: "bitcoin"
                        label: "Bitcoin (BTC)"
                        points:
                          - date: "2026-09-22"
                            value: 50987437883.95
                          - date: "2026-09-23"
                            value: 49881224968.73
                        summary:
                          latest: 49881224968.73
                          latestDate: "2026-09-23"
                          periodTotal: null
                      - key: "tether"
                        label: "Tether USD (USDT)"
                        points:
                          - date: "2026-09-22"
                            value: 21809784077.84
                          - date: "2026-09-23"
                            value: 21616722195.89
                        summary:
                          latest: 21616722195.89
                          latestDate: "2026-09-23"
                          periodTotal: null
                      - key: "__other__"
                        label: "Other assets"
                        points:
                          - date: "2026-09-22"
                            value: 23572593323.69
                          - date: "2026-09-23"
                            value: 22931370585.61
                        summary:
                          latest: 22931370585.61
                          latestDate: "2026-09-23"
                          periodTotal: null
                    totals:
                      distinct:
                        - date: "2026-09-22"
                          value: 96369815285.48
                        - date: "2026-09-23"
                          value: 94429317750.23
                      summary:
                        latest: 94429317750.23
                        latestDate: "2026-09-23"
                        periodTotal: null
                    overlap: null
                    freshness:
                      latestDay: "2026-09-23"
                      includesPartialToday: false
                riskByWalletTag:
                  summary: "Risk exposure by wallet tag: ?metric=risk_exposure_usd&walletTags=Treasury&includeUntaggedWallets=true&days=2"
                  value:
                    metric: "risk_exposure_usd"
                    unit: "usd"
                    kind: "flow"
                    groupBy: "wallet_tag"
                    from: "2026-09-22"
                    to: "2026-09-23"
                    membershipMode: "current_tags_applied_to_history"
                    categories: ["Blocked", "Sanctioned", "Scam"]
                    categoriesAdditive: false
                    series:
                      - key: "22222222-2222-4222-8222-222222222222"
                        label: "Treasury"
                        points:
                          - date: "2026-09-22"
                            value: 143625546.26
                          - date: "2026-09-23"
                            value: 83848639.49
                        summary:
                          latest: 83848639.49
                          latestDate: "2026-09-23"
                          periodTotal: 227474185.75
                      - key: "untagged"
                        label: "Untagged"
                        points:
                          - date: "2026-09-22"
                            value: 26329022.23
                          - date: "2026-09-23"
                            value: 91338007.71
                        summary:
                          latest: 91338007.71
                          latestDate: "2026-09-23"
                          periodTotal: 117667029.94
                    totals:
                      distinct:
                        - date: "2026-09-22"
                          value: 169954568.49
                        - date: "2026-09-23"
                          value: 175186647.2
                      summary:
                        latest: 175186647.2
                        latestDate: "2026-09-23"
                        periodTotal: 345141215.69
                    overlap:
                      walletsInMultipleSelectedTags: 0
                    freshness:
                      latestDay: "2026-09-23"
                      includesPartialToday: false
            text/csv:
              schema:
                type: string
              example: |
                date,Venture Capital,Regulated,Total
                2026-09-22,6060795.53,82053302776.44,82053341453.76
                2026-09-23,4910115.44,80677468814.14,80677506573.61
        "400":
          description: Something in the request is wrong. The message says what and how to fix it.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                error: 'No wallet tag is named "Warm". Your wallet tags are: Cold, Hot, Treasury. To send a name that contains a comma, put it in its own walletTags= parameter.'
        "401":
          $ref: "#/components/responses/Unauthorized"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /reports:
    get:
      summary: List reports
      description: >
        Returns all reports generated for your organization.
        Optionally filter by firm using the `firmId` query parameter.

        Download URLs are not included in this response — use
        `GET /reports/{reportId}/download` to get a signed URL.
      operationId: listReports
      tags:
        - Reports
      parameters:
        - name: firmId
          in: query
          required: false
          schema:
            type: string
          description: Filter reports to those associated with a specific firm
          example: "abc123"
      responses:
        "200":
          description: Reports retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  reports:
                    type: array
                    items:
                      $ref: "#/components/schemas/Report"
        "401":
          $ref: "#/components/responses/Unauthorized"

  /reports/{reportId}/download:
    get:
      summary: Download report
      description: >
        Returns a time-limited signed URL for downloading a report PDF.
        The URL expires after 1 hour. The report must belong to your organization.
      operationId: downloadReport
      tags:
        - Reports
      parameters:
        - name: reportId
          in: path
          required: true
          schema:
            type: string
          example: "rpt_abc123"
      responses:
        "200":
          description: Signed download URL generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    description: Signed download URL, valid for 1 hour
                  expiresAt:
                    type: string
                    format: date-time
                    description: ISO 8601 expiry timestamp
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"

  /tags:
    get:
      summary: List your tags
      description: >
        Lists the tags your organization uses on wallets, assets, and firms.
        In `GET /metrics`, send wallet tag names as `walletTags`, firm
        tag names as `firmTags`, and asset tag names as `assetTags`.
      operationId: listTags
      tags:
        - Tags
      parameters:
        - name: entityType
          in: query
          required: false
          description: "Show only one kind of tag: `wallet`, `asset`, or `firm`."
          example: wallet
          schema:
            type: string
            enum: [wallet, asset, firm]
      responses:
        "200":
          description: Your tags.
          content:
            application/json:
              schema:
                type: object
                properties:
                  tags:
                    type: array
                    items:
                      $ref: "#/components/schemas/TagDefinition"
              example:
                tags:
                  - id: "11111111-1111-4111-8111-111111111111"
                    name: "Hot"
                    entityType: "wallet"
                    activeAssignmentCount: 4227
                    createdAt: "2026-09-01T10:12:00.000Z"
        "400":
          description: The tag type is wrong. The message says what to send.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                error: '"token" is not a tag type. Use entityType=wallet, asset or firm, or leave it out to list all tags.'
        "401":
          $ref: "#/components/responses/Unauthorized"
        "405":
          $ref: "#/components/responses/MethodNotAllowed"

  /threat-monitor/incidents:
    get:
      summary: List security incidents
      description: >
        Returns a paginated list of Web3 security incidents tracked by CertiK's
        threat intelligence feed (the data shown on the Intelligence → Threat
        page, `/intelligence/threat`). This is global threat intelligence — it
        is not scoped to your organization.

        Incidents are ordered newest-first by incident date. Results are paged
        with `skip` and `limit`. `limit` defaults to 50 and is capped at 200, so
        a request with no parameters returns the 50 most recent incidents. Use
        `page.total` and `page.hasMore` to drive paging.

        Each incident that is matched to a monitored asset carries a
        `skynet_profile` object identifying that asset; unmatched incidents have
        `skynet_profile: null`.
      operationId: listSecurityIncidents
      tags:
        - Threat Monitor
      parameters:
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of incidents to skip (offset). Defaults to 0.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: Maximum incidents to return. Defaults to 50, capped at 200.
      responses:
        "200":
          description: Security incidents retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  incidents:
                    type: array
                    items:
                      $ref: "#/components/schemas/SecurityIncident"
                  page:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: Total incidents available across all pages
                      limit:
                        type: integer
                        description: Effective page size, after the cap is applied
                      hasMore:
                        type: boolean
                        description: Whether more incidents exist after this page
                    required:
                      - total
                      - limit
                      - hasMore
              example:
                incidents:
                  - id: "incident-12345"
                    incident_name: "Euler Finance Exploit"
                    amount: 197000000
                    date: "2023-03-13"
                    incident_type: "Exploit"
                    links:
                      - "https://twitter.com/eulerfinance/status/1635383260838952961"
                    chains:
                      - "ethereum"
                    tags:
                      - "DeFi"
                    project_type: "project"
                    project_name: "Euler Finance"
                    is_customer: false
                    attack_vector: "Flash Loan"
                    attack_techniques:
                      - "Donation Attack"
                    skynet_profile:
                      skynet_id: "euler-finance"
                      profile_url: "https://compliance.certik.com/risk-management/assets/euler-finance"
                      asset_type: "project"
                  - id: "incident-67890"
                    incident_name: "Unknown Protocol Rug Pull"
                    amount: 1200000
                    date: "2022-11-05"
                    incident_type: "Rug Pull"
                    links: []
                    chains:
                      - "bsc"
                    tags: []
                    project_type: "project"
                    project_name: "Unknown Protocol"
                    is_customer: false
                    attack_vector: null
                    attack_techniques: []
                    skynet_profile: null
                page:
                  total: 2143
                  limit: 50
                  hasMore: true
        "401":
          $ref: "#/components/responses/Unauthorized"

  /metrics/wallets:
    get:
      summary: Get wallet metrics (legacy path)
      description: Accepts the same parameters and returns the same response as GET /metrics.
      operationId: getWalletMetricsLegacy
      deprecated: true
      tags: [Metrics]
      externalDocs:
        description: Wallet metrics parameters and examples
        url: https://docs.compliance.certik.com/en/api-documentation/client/metrics/
      responses:
        "200":
          description: Wallet metrics
        "401":
          $ref: "#/components/responses/Unauthorized"
