openapi: 3.0.3
info:
  title: FastNEAR API - V0 Account Staking
  version: 3.0.3
  description: Fetch staking pool account IDs for one account — pool IDs only, no block-height metadata.
paths:
  /v0/account/{account_id}/staking:
    get:
      description: Fetch staking pool account IDs for one account — pool IDs only, no block-height metadata.
      operationId: account_staking_v0
      parameters:
        - description: NEAR account ID to inspect.
          example: mob.near
          in: path
          name: account_id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              example:
                account_id: mob.near
                pools:
                  - zavodil.poolv1.near
              schema:
                $ref: "#/components/schemas/V0StakingResponse"
          description: Staking pool account IDs for the requested account
        "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 staking pool account IDs for an account
      tags:
        - staking
servers:
  - description: Mainnet
    url: https://api.fastnear.com
  - description: Testnet
    url: https://test.api.fastnear.com
security:
  - {}
  - BearerAuth: []
  - ApiKeyAuth: []
components:
  schemas:
    V0StakingResponse:
      additionalProperties: false
      properties:
        account_id:
          type: string
        pools:
          items:
            type: string
          type: array
      required:
        - account_id
        - pools
      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
