openapi: 3.0.3
info:
  title: FastNEAR API - V1 Public Key Lookup (All)
  version: 3.0.3
  description: Resolve a public key to every account that holds it — full-access and limited-access keys alike — via the V1 lookup-all path.
paths:
  /v1/public_key/{public_key}/all:
    get:
      description: Resolve a public key to every account that holds it — full-access and limited-access keys alike — via the V1 lookup-all path.
      operationId: lookup_by_public_key_all_v1
      parameters:
        - description: NEAR public key or access-key handle in `ed25519:...`, `secp256k1:...`, `ml-dsa-65:...`, or `ml-dsa-65-hash:...` form.
          example: ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT
          in: path
          name: public_key
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              example:
                account_ids:
                  - root.near
                public_key: ed25519:CCaThr3uokqnUs6Z5vVnaDcJdrfuTpYJHJWcAGubDjT
              schema:
                $ref: "#/components/schemas/PublicKeyLookupResponse"
          description: Matching account IDs for the supplied public key or access-key handle, including limited-access keys
        "400":
          content:
            application/json:
              schema:
                type: string
          description: Bad Request
        "403":
          content:
            text/plain:
              example: Invalid API key
              schema:
                type: string
          description: The supplied API key was not recognized.
        "500":
          content:
            application/json:
              schema:
                type: string
          description: Internal Server Error
      summary: Lookup all indexed accounts by public key
      tags:
        - public-key
servers:
  - description: Mainnet
    url: https://api.fastnear.com
  - description: Testnet
    url: https://test.api.fastnear.com
security:
  - {}
  - BearerAuth: []
  - ApiKeyAuth: []
components:
  schemas:
    PublicKeyLookupResponse:
      additionalProperties: false
      properties:
        account_ids:
          items:
            type: string
          type: array
        public_key:
          type: string
      required:
        - public_key
        - account_ids
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history.
      in: query
      name: apiKey
      type: apiKey
    BearerAuth:
      description: "FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs."
      scheme: bearer
      type: http
