openapi: 3.0.3
info:
  title: Demo API
  version: 0.1.0
  description: >
    # Definitions


    Over this documentation we use several technical terms.


    **User** – a person, which can log into the system using their email and
    password.

    A User can have access to multiple accounts – Miners, Operators and Pool.


    **Miner** – an account for mining. Several Users can access one account.


    # Authorization


    <SecurityDefinitions />


    # Authentication


    We use Ory Kratos as an authentication service. If you are building
    user-facing service,

    you must provide user with an authentication interface.


    For details on how to build your own UI, you can see Ory Kratos 

    [Bring Your Own UI
    doc](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-overview).
servers:
  - url: https://bestpool.demo.miningpool.ru/api/backend/v0.1
    description: User-facing server, accepts client-server session authentication
  - url: https://api.demo.miningpool.ru/v0.1
    description: Server for server-to-server integration, accepts API token
tags:
  - name: User
  - name: Miners
  - name: Workers
  - name: Wallets
  - name: Pools
  - name: Operators
  - name: Charts
  - name: Mining Stats
  - name: Invites
  - name: Accounting
  - name: Hashrate Transfers
  - name: Public Info
  - name: Watcher Links
  - name: Platform
paths:
  /accounting/reward/rates:
    get:
      x-beta: true
      summary: 🧪 Reward rates list
      tags:
        - Accounting
      parameters:
        - $ref: '#/components/parameters/date_from'
        - $ref: '#/components/parameters/date_to'
        - $ref: '#/components/parameters/currency'
      responses:
        '200':
          description: Rates list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatesList'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /accounting/workflows:
    get:
      summary: List of completed workflows for the date
      description: >
        Retrieve a list of completed workflows for a specified date, optionally
        filtered by workflow type.

        The response may include empty array if no workflows are completed for
        the date yet.
      tags:
        - Accounting
      security:
        - user_session_mobile: []
        - user_session_web: []
        - api_key: []
      parameters:
        - $ref: '#/components/parameters/created_date'
        - $ref: '#/components/parameters/workflow_type'
      responses:
        '200':
          description: List of workflows completed on the specified date
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CompletedWorkflow'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /accounts/{account_id}/balance:
    get:
      summary: Miner donor account balance
      description: >-
        Retrieves the balance of the account used for virtual hashrate
        compensations associated with the miner donor.
      tags:
        - Accounts
      security:
        - user_session_mobile:
            - account:accounts_balance
        - user_session_web:
            - account:accounts_balance
        - api_key:
            - account:accounts_balance
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          description: Account balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AmountSingleCurrency'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners:
    post:
      summary: Miner self-registration
      tags:
        - Miners
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_name
              properties:
                account_name:
                  example: Superminer123
                  type: string
                  minLength: 3
                  maxLength: 32
                  pattern: ^\w{3,32}$
      responses:
        '200':
          description: Miner full model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerFullModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}:
    get:
      summary: Miner details
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:read
        - user_session_mobile:
            - miner:read
        - api_key:
            - miner:read
        - watcher_token:
            - miner:read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerFullModel'
          description: Miner full model
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Request Miner deletion
      description: >
        Sends a request to delete Miner account. These requests are processed
        manually,

        so the account is not deleted right away.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:delete
        - user_session_mobile:
            - miner:delete
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '204':
          description: Miner deleted
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/access:
    get:
      summary: List miner access rules
      description: Get a list of users who have access to the miner
      tags:
        - Miners
      parameters:
        - $ref: '#/components/parameters/miner_id'
      security:
        - user_session_web:
            - miner:permissions_read
        - user_session_mobile:
            - miner:permissions_read
        - api_key:
            - miner:permissions_read
      responses:
        '200':
          description: List of miner access rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/MinerAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Modify user access to the miner
      description: This method changes specified user access permissions for the miner.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:permissions_update
        - user_session_mobile:
            - miner:permissions_update
        - api_key:
            - miner:permissions_update
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - roles
              properties:
                email:
                  type: string
                  format: email
                roles:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/MinerAccessRole'
      responses:
        '200':
          description: Miner access rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Invite user to access the miner
      description: This method invites specified user to access the miner.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:permissions_create
        - user_session_mobile:
            - miner:permissions_create
        - api_key:
            - miner:permissions_create
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - roles
              properties:
                email:
                  type: string
                  format: email
                roles:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/MinerAccessRole'
      responses:
        '200':
          description: Miner access rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Revoke access to the miner
      description: This method revokes access to the miner for the specified user.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:permissions_delete
        - user_session_mobile:
            - miner:permissions_delete
        - api_key:
            - miner:permissions_delete
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
      responses:
        '204':
          description: Access revoked
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/lookup-by-email:
    get:
      x-beta: true
      summary: 🧪 List miners by email
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - pool:miners_lookup
        - user_session_mobile:
            - pool:miners_lookup
        - api_key:
            - pool:miners_lookup
      parameters:
        - in: query
          name: email
          required: true
          schema:
            type: string
            format: email
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/MinerFullModel'
                  pagination:
                    $ref: '#/components/schemas/_pagination'
          description: List of miners
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /miners/lookup-by-account-name:
    get:
      summary: Get Miner ID by it's account name
      tags:
        - Miners
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      parameters:
        - in: query
          description: Account name
          name: name
          required: true
          schema:
            type: string
            example: Superminer123
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - account_name
                properties:
                  id:
                    type: string
                    format: uuid
                  account_name:
                    $ref: '#/components/schemas/AccountName'
          description: Miner ID and account name
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/title:
    put:
      description: Rename the Miner
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:notes_update
        - user_session_mobile:
            - miner:notes_update
        - api_key:
            - miner:notes_update
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
              properties:
                title:
                  example: LLC 'Super Miner'
                  type: string
      responses:
        '200':
          description: Title.
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    example: LLC 'Super Miner'
                    type: string
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      description: Delete Miner's title
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:notes_delete
        - user_session_mobile:
            - miner:notes_delete
        - api_key:
            - miner:notes_delete
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '204':
          description: Title deleted
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/payments:
    get:
      summary: List Miner payments
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:payments_list
        - user_session_mobile:
            - miner:payments_list
        - api_key:
            - miner:payments_list
        - watcher_token:
            - miner:payments_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/tx_type'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of payments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/payments/export:
    get:
      summary: Export Miner Payments to CSV
      description: >
        Creates a CSV-file with Miner Payments for the specified period.

        The file is attached to the response, so the browser should open the
        file save dialog automatically.


        Works only on periods less than or equal to 90 days.


        All the date-time strings are returned in the UTC timezone.


        File structure example:


        | created_at | effective_at | type | currency | amount | status |
        hashrate | rate | tx_hash |

        | ---------- | ------------ | ---- | -------- | ------ | ------ |
        -------- | ---- | ------- |

        | 2023-01-02 02:00:00 | 2023-01-01 00:00:00 | reward | BTC | 0.00472423
        | completed | 827415935642814097 |
        0.000000000000000002192399084736862074189141067444586110763013383 |  |

        | 2023-01-02 14:00:20 | 2023-01-02 14:00:20 | payout | BTC | 0.00472423
        | completed |  |  |
        97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9 |
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:payments_list
        - user_session_mobile:
            - miner:payments_list
        - api_key:
            - miner:payments_list
        - watcher_token:
            - miner:payments_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/tx_type'
        - $ref: '#/components/parameters/datetime_from'
        - $ref: '#/components/parameters/datetime_to'
      responses:
        '200':
          description: Report file
          headers:
            Content-Disposition:
              $ref: '#/components/headers/Payments-Export-Content-Disposition'
          content:
            text/csv:
              schema:
                type: string
                contentMediaType: text/csv
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/balance:
    get:
      summary: Current Miner balance
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:balances_read
        - user_session_mobile:
            - miner:balances_read
        - api_key:
            - miner:balances_read
        - watcher_token:
            - miner:balances_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: Current balance in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/earned-today:
    get:
      summary: Miner earnings for today
      deprecated: true
      description: Use /miners/{miner_id}/processing-earnings instead
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:balances_read
        - user_session_mobile:
            - miner:balances_read
        - api_key:
            - miner:balances_read
        - watcher_token:
            - miner:balances_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: Miner earnings for today in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/processing-earnings:
    get:
      summary: Miner earnings in processing
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:balances_read
        - user_session_mobile:
            - miner:balances_read
        - api_key:
            - miner:balances_read
        - watcher_token:
            - miner:balances_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: Earnings being processed for 2 days in all currencies
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessingAmounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/earned-all-time:
    get:
      summary: Miner earnings for all time
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:balances_read
        - user_session_mobile:
            - miner:balances_read
        - api_key:
            - miner:balances_read
        - watcher_token:
            - miner:balances_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: Miner earnings for all time in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/referrals:
    get:
      summary: List referrals invited by the miner
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:referrals_list
        - user_session_mobile:
            - miner:referrals_list
        - api_key:
            - miner:referrals_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of referrals
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfReferrals'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/profit-sharings:
    get:
      summary: List miner's active profit sharings
      description: |
        Returns a list of active profit sharings for which the miner is a donor.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner(donor):profit_sharings_list
        - user_session_mobile:
            - miner(donor):profit_sharings_list
        - api_key:
            - miner(donor):profit_sharings_list
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/include_future'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProfitSharing'
          description: List of miner's profit sharings
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/profit-sharings/{miner_recipient_id}:
    get:
      summary: List history of profit sharings between two miners
      description: >
        Returns a list of profit sharings for which the miner is a donor and the
        other miner is a recipient.

        The list is paginated and sorted in reverse chronological order.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner(donor):profit_sharings_read
        - user_session_mobile:
            - miner(donor):profit_sharings_read
        - api_key:
            - miner(donor):profit_sharings_read
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - pagination
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProfitSharing'
                  pagination:
                    $ref: '#/components/schemas/_pagination'
          description: List of profit sharings
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Create a new profit sharing between two miners
      description: |
        Creates a new profit sharing between two miners.
        The profit sharing will become active since 00:00 UTC of the next day.
        The current profit sharing will be deactivated at the same time.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner(donor):profit_sharings_update
        - user_session_mobile:
            - miner(donor):profit_sharings_update
        - api_key:
            - miner(donor):profit_sharings_update
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rate
                - type
              properties:
                rate:
                  $ref: '#/components/schemas/FlatRateValue'
                type:
                  type: string
                  enum:
                    - profit_sharing
                    - referral
      responses:
        '201':
          description: The profit sharing is created
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Delete a profit sharing between two miners
      description: |
        Deactivates the current profit sharing between two miners.
        The profit sharing will be deactivated since 00:00 UTC of the next day.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner(donor):profit_sharings_delete
        - user_session_mobile:
            - miner(donor):profit_sharings_delete
        - api_key:
            - miner(donor):profit_sharings_delete
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
      responses:
        '204':
          description: The profit sharing is deleted
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/virtual-mining-limit:
    post:
      summary: Set virtual mining limit
      description: >-
        Set the maximum virtual hashrate compensation amount per day for a miner
        donor, measured in hashes.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:virtual_hashrate_limit_update
        - user_session_mobile:
            - miner:virtual_hashrate_limit_update
        - api_key:
            - miner:virtual_hashrate_limit_update
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - limit
              properties:
                limit:
                  type: string
                  format: decimal
                  description: Positive number or zero
                  example: '100000000000000.00'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualHashrateLimits'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/virtual-mining-boost-limit:
    post:
      summary: Set virtual mining boost limit
      description: >-
        Set the maximum boost hashrate compensation amount per day for a miner
        donor, measured in hashes.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:virtual_hashrate_limit_update
        - user_session_mobile:
            - miner:virtual_hashrate_limit_update
        - api_key:
            - miner:virtual_hashrate_limit_update
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - limit
              properties:
                limit:
                  type: string
                  format: decimal
                  description: Positive number or zero
                  example: '100000000000000.00'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualHashrateLimits'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/hashrate-per-day:
    get:
      summary: Get donor hashrate per day
      description: >
        Retrieve the hashrate per day for a specific miner donor on a given
        date.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:hashrate_per_day_read
        - user_session_mobile:
            - miner:hashrate_per_day_read
        - api_key:
            - miner:hashrate_per_day_read
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: ../components/parameters/date.yaml
      responses:
        '200':
          description: Donor hashrate per day
          content:
            application/json:
              schema:
                type: object
                properties:
                  hashrate_per_day:
                    type: string
                    format: decimal
                    description: Hashrate per day.
                    example: '100000000000000.00'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/workers:
    get:
      summary: List Miner Workers
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:workers_list
        - user_session_mobile:
            - miner:workers_list
        - api_key:
            - miner:workers_list
        - watcher_token:
            - miner:workers_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/list_of_worker_statuses'
        - $ref: '#/components/parameters/list_workers_sort_by'
        - $ref: '#/components/parameters/sort_direction'
        - $ref: '#/components/parameters/worker_behavior'
        - $ref: '#/components/parameters/name_query'
      responses:
        '200':
          description: List of worker short models.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWorkers'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/workers/boundary:
    get:
      summary: List Hashrate Transfers created by Miner
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner:workers_boundary_list
        - user_session_mobile:
            - miner:workers_boundary_list
        - api_key:
            - miner:workers_boundary_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/list_of_boundary_worker_statuses'
        - $ref: '#/components/parameters/list_boundary_workers_sort_by'
        - $ref: '#/components/parameters/sort_direction'
      responses:
        '200':
          description: List of boundary workers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfBoundaryWorkers'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/workers/statuses:
    get:
      summary: Workers statistics
      description: Shows how many workers are in the corresponding status at the moment.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:workers_list
        - user_session_mobile:
            - miner:workers_list
        - api_key:
            - miner:workers_list
        - watcher_token:
            - miner:workers_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/list_of_worker_statuses'
        - $ref: '#/components/parameters/list_workers_sort_by'
        - $ref: '#/components/parameters/sort_direction'
        - $ref: '#/components/parameters/worker_behavior'
        - $ref: '#/components/parameters/name_query'
      responses:
        '200':
          description: Workers' status statitstics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkerStatusesStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/workers/boundary/statuses:
    get:
      summary: Boundary Workers status statitstics
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner:workers_boundary_list
        - user_session_mobile:
            - miner:workers_boundary_list
        - api_key:
            - miner:workers_boundary_list
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
      responses:
        '200':
          description: Boundary workers' status statitstics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoundaryWorkerStatusesStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/workers/daily-stats:
    get:
      summary: Daily hashrate report for all Workers
      description: >
        Generates report for hashrate and rejectrate for all the Workers
        connected to the

        Miner's account.
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:workers_list
        - user_session_mobile:
            - miner:workers_list
        - api_key:
            - miner:workers_list
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/date_from'
        - $ref: '#/components/parameters/date_to'
      responses:
        '200':
          description: Daily mining statistics for all miner wokers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkerStatsList'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/recipients:
    post:
      summary: Add a new miner to the pool as a donor recipient
      description: This method creates a new miner and sends invitation link.
      tags:
        - Hashrate Transfers
        - Invites
      security:
        - user_session_web:
            - miner:recipients_create
        - user_session_mobile:
            - miner:recipients_create
        - api_key:
            - miner:recipients_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_name
                - email
              properties:
                account_name:
                  $ref: '#/components/schemas/AccountName'
                email:
                  type: string
                  format: email
      responses:
        '200':
          description: Miner full model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerFullModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/workers/boundary/stats:
    get:
      summary: Boundary Workers hashrate statistics
      description: >
        Get summarized Mining Stats for the boundary workers for which the miner
        is

        a donor.
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner:virtual_mining_charts_read
        - user_session_mobile:
            - miner:virtual_mining_charts_read
        - api_key:
            - miner:virtual_mining_charts_read
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
      responses:
        '200':
          description: Mining stats.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiningStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/workers/boundary/daily-stats:
    get:
      summary: Daily hashrate report for all Donor Boundary Workers
      description: >
        Generates report with hashrate and rejectrate for all the Hashrate
        Transfers of the

        Boundary type created by the Miner.
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner:workers_boundary_list
        - user_session_mobile:
            - miner:workers_boundary_list
        - api_key:
            - miner:workers_boundary_list
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/date_from'
        - $ref: '#/components/parameters/date_to'
      responses:
        '200':
          description: Daily mining statistics for all donated workers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkerStatsList'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/plan:
    get:
      summary: Miner tariff plan
      deprecated: true
      description: |
        Method is deprecated. Use `GET /miners/{miner_id}/fees` instead.
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:plans_read
        - user_session_mobile:
            - miner:plans_read
        - api_key:
            - miner:plans_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: The current and the future tariff plans.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureTariffPlan'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update Miner tariff plan.
      deprecated: true
      description: |
        Method is deprecated. Use `POST /miners/{miner_id}/fees` instead.
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:plans_update
        - user_session_mobile:
            - miner:plans_update
        - api_key:
            - miner:plans_update
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rate
              properties:
                rate:
                  $ref: '#/components/schemas/FlatRateValue'
      responses:
        '200':
          description: The current and the future tariff plans.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureTariffPlan'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/fees:
    get:
      summary: Miner->pool commission changes
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:plans_read
        - user_session_mobile:
            - miner:plans_read
        - api_key:
            - miner:plans_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: >-
            Schedule of miner->pool commission changes sorted the valid_until
            field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfTariffCommissions'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Update miner->pool commission schedule
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:plans_update
        - user_session_mobile:
            - miner:plans_update
        - api_key:
            - miner:plans_update
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCommissionSchedule'
      responses:
        '201':
          description: The schedule of miner->pool commission updated.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/fees/current:
    get:
      summary: Get current miner->pool commission
      tags:
        - Pools
      security:
        - user_session_web:
            - miner:plans_read
        - user_session_mobile:
            - miner:plans_read
        - api_key:
            - miner:plans_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: Current miner->pool commission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TariffCommission'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/referrer-codes:
    get:
      summary: List miner's referrer codes
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:read
        - user_session_mobile:
            - miner:read
        - api_key:
            - miner:read
      parameters:
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ReferrerCodePolicy'
          description: List of miner's referrer codes
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/mining-report:
    get:
      summary: Get monthly mining report for the miner
      tags:
        - Miners
      security:
        - user_session_web:
            - miner:reports_read
        - user_session_mobile:
            - miner:reports_read
        - api_key:
            - miner:reports_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/year'
        - $ref: '#/components/parameters/month'
        - $ref: '#/components/parameters/currency'
      responses:
        '200':
          description: Mining report for the provided month and year
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiningReport'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/virtual-mining-fees/{miner_recipient_id}:
    get:
      summary: Recipient->donor commission changes
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner(donor):virtual_mining_plans_read
        - user_session_mobile:
            - miner(donor):virtual_mining_plans_read
        - api_key:
            - miner(donor):virtual_mining_plans_read
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: >-
            Schedule of recipient->donor commission changes sorted the
            valid_until field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfTariffCommissions'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Update recipient->donor commission schedule
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner(donor):virtual_mining_plans_update
        - user_session_mobile:
            - miner(donor):virtual_mining_plans_update
        - api_key:
            - miner(donor):virtual_mining_plans_update
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCommissionSchedule'
      responses:
        '201':
          description: The schedule of recipient->donor commission updated.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/virtual-mining-fees/{miner_recipient_id}/current:
    get:
      summary: Get current recipient->donor commission
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner(donor):virtual_mining_plans_read
        - user_session_mobile:
            - miner(donor):virtual_mining_plans_read
        - api_key:
            - miner(donor):virtual_mining_plans_read
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
      responses:
        '200':
          description: Current recipient->donor commission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TariffCommission'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/virtual-mining-plan/{miner_recipient_id}:
    get:
      summary: Tariff plan for Hashrate Transfers
      deprecated: true
      description: >
        Method is deprecated. Use `GET
        /miners/{miner_donor_id}/virtual-mining-fees/{miner_recipient_id}`
        instead.
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner(donor):virtual_mining_plans_read
        - user_session_mobile:
            - miner(donor):virtual_mining_plans_read
        - api_key:
            - miner(donor):virtual_mining_plans_read
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
      responses:
        '200':
          description: The current and the future tariff plans for virtual mining.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureTariffPlan'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update tariff plan for Hashrate Transfers
      deprecated: true
      description: >
        Method is deprecated. Use `POST
        /miners/{miner_donor_id}/virtual-mining-fees/{miner_recipient_id}`
        instead.
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner(donor):virtual_mining_plans_update
        - user_session_mobile:
            - miner(donor):virtual_mining_plans_update
        - api_key:
            - miner(donor):virtual_mining_plans_update
      parameters:
        - $ref: '#/components/parameters/miner_donor_id'
        - $ref: '#/components/parameters/miner_recipient_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rate
              properties:
                rate:
                  $ref: '#/components/schemas/FlatRateValue'
      responses:
        '200':
          description: The current and the future tariff plans for virtual mining.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureTariffPlan'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/current:
    get:
      summary: Current Pool public info.
      description: Get the current pool info and configuration.
      tags:
        - Pools
      parameters:
        - $ref: '#/components/parameters/pool_host'
      responses:
        '200':
          description: Pool configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoolPublicModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}:
    get:
      summary: Private Pool info.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:read
        - user_session_mobile:
            - pool:read
        - api_key:
            - pool:read
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Pool full model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoolPrivateModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/access:
    get:
      summary: List pool access rules
      description: Get a list of users who have access to the pool
      tags:
        - Pools
      parameters:
        - $ref: '#/components/parameters/pool_id'
      security:
        - user_session_web:
            - pool:permissions_read
        - user_session_mobile:
            - pool:permissions_read
        - api_key:
            - pool:permissions_read
      responses:
        '200':
          description: List of pool access rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PoolAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Modify user access to the pool
      description: This method changes specified user access permissions for the pool.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:permissions_update
        - user_session_mobile:
            - pool:permissions_update
        - api_key:
            - pool:permissions_update
      parameters:
        - $ref: '#/components/parameters/pool_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - roles
              properties:
                email:
                  type: string
                  format: email
                roles:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/PoolAccessRole'
      responses:
        '200':
          description: Pool access rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoolAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Invite user to access the pool
      description: This method invites specified user to access the pool.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:permissions_create
        - user_session_mobile:
            - pool:permissions_create
        - api_key:
            - pool:permissions_create
      parameters:
        - $ref: '#/components/parameters/pool_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - roles
              properties:
                email:
                  type: string
                  format: email
                roles:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/PoolAccessRole'
      responses:
        '200':
          description: Pool access rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoolAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Revoke access to the pool
      description: This method revokes access to the pool for the specified user.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:permissions_delete
        - user_session_mobile:
            - pool:permissions_delete
        - api_key:
            - pool:permissions_delete
      parameters:
        - $ref: '#/components/parameters/pool_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
      responses:
        '204':
          description: Access revoked
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/payments:
    get:
      summary: List pool payments.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:payments_list
        - user_session_mobile:
            - pool:payments_list
        - api_key:
            - pool:payments_list
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/tx_type'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of payments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/payments/export:
    get:
      summary: Export list of the pool's payments as CSV file.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:payments_list
        - user_session_mobile:
            - pool:payments_list
        - api_key:
            - pool:payments_list
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/tx_type'
        - $ref: '#/components/parameters/datetime_from'
        - $ref: '#/components/parameters/datetime_to'
      responses:
        '200':
          description: List of payments
          headers:
            Content-Disposition:
              $ref: '#/components/headers/Payments-Export-Content-Disposition'
          content:
            text/csv:
              schema:
                type: string
                example: >
                  created_at,effective_at,type,currency,amount,status,hashrate,rate,tx_hash
                  2023-01-02 02:00:00,2023-01-01
                  00:00:00,reward,BTC,0.00472423,completed,827415935642814097,0.000000000000000002192399084736862074189141067444586110763013383
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/balance:
    get:
      summary: Pool account balance.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:balances_read
        - user_session_mobile:
            - pool:balances_read
        - api_key:
            - pool:balances_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Current balance in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/earned-today:
    get:
      summary: Pool earnings for today.
      deprecated: true
      description: Use /pools/{pool_id}/processing-earnings instead
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:balances_read
        - user_session_mobile:
            - pool:balances_read
        - api_key:
            - pool:balances_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Pool earnings for today in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/processing-earnings:
    get:
      summary: Pool earnings being processed
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:balances_read
        - user_session_mobile:
            - pool:balances_read
        - api_key:
            - pool:balances_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Earnings being processed for 2 days in all currencies
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessingAmounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/earned-all-time:
    get:
      summary: Pool earnings for all time.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:balances_read
        - user_session_mobile:
            - pool:balances_read
        - api_key:
            - pool:balances_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Pool earnings for all time in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/earned-from-miner/{miner_id}:
    get:
      summary: Pool earnings from the specific miner for all time.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:read
            - miner:balances_read
        - user_session_mobile:
            - pool:read
            - miner:balances_read
        - api_key:
            - pool:read
            - miner:balances_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: >-
            Pool earnings from the specific miner for all time in all
            currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/charts:
    get:
      summary: Chart for the whole pool.
      tags:
        - Pools
        - Charts
      security:
        - user_session_web:
            - pool:charts_read
        - user_session_mobile:
            - pool:charts_read
        - api_key:
            - pool:charts_read
      parameters:
        - $ref: '#/components/parameters/period'
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Data points.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleChart'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/stats:
    get:
      tags:
        - Pools
        - Mining Stats
      summary: Get Mining Stats for the entire pool.
      description: Only pool owner, pool accountant and pool admin can call this method.
      security:
        - user_session_web:
            - pool:charts_read
        - user_session_mobile:
            - pool:charts_read
        - api_key:
            - pool:charts_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Summarized Mining Stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiningStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/operators:
    get:
      summary: List operators of the pool.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:operators_list
        - user_session_mobile:
            - pool:operators_list
        - api_key:
            - pool:operators_list
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of operators.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfOperatorPoolModels'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/miners:
    get:
      summary: List miners of the pool
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:miners_list
        - user_session_mobile:
            - pool:miners_list
        - api_key:
            - pool:miners_list
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/name_query'
      responses:
        '200':
          description: List of miners.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfMinerPoolModels'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Invite miner to the pool
      tags:
        - Pools
        - Invites
      security:
        - user_session_web:
            - pool:miners_create
        - user_session_mobile:
            - pool:miners_create
        - api_key:
            - pool:miners_create
      parameters:
        - $ref: '#/components/parameters/pool_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_name
                - email
                - rate
              properties:
                account_name:
                  $ref: '#/components/schemas/AccountName'
                title:
                  type: string
                  example: LLC 'Super Miner'
                email:
                  type: string
                  format: email
                rate:
                  $ref: '#/components/schemas/FlatRateValue'
      responses:
        '200':
          description: Miner full model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerFullModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/workers:
    get:
      summary: List workers of the pool.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:workers_list
        - user_session_mobile:
            - pool:workers_list
        - api_key:
            - pool:workers_list
        - user_session_web:
            - pool:workers_list
            - pool:workers_notes_list
        - user_session_mobile:
            - pool:workers_list
            - pool:workers_notes_list
        - api_key:
            - pool:workers_list
            - pool:workers_notes_list
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/list_of_worker_statuses'
        - $ref: '#/components/parameters/list_workers_sort_by'
        - $ref: '#/components/parameters/sort_direction'
        - $ref: '#/components/parameters/worker_behavior'
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/name_query'
      responses:
        '200':
          description: List of workers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWorkers'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/workers/statuses:
    get:
      summary: Workers' status statistics.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:workers_list
        - user_session_mobile:
            - pool:workers_list
        - api_key:
            - pool:workers_list
      parameters:
        - $ref: '#/components/parameters/pool_id'
      responses:
        '200':
          description: Workers' status statistics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkerStatusesStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pools/{pool_id}/users:
    get:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 List users in the pool
      security:
        - user_session_web:
            - pool:users_list
        - user_session_mobile:
            - pool:users_list
        - api_key:
            - pool:users_list
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/email_query'
        - name: active
          required: false
          in: query
          schema:
            type: bool
          description: Show only active/inactive users. True by default.
        - $ref: '#/components/parameters/list_users_sort_by'
        - $ref: '#/components/parameters/sort_direction'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfUsersShortModels'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/users/{user_id}:
    get:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 Get user's details
      security:
        - user_session_web:
            - pool:users_read
        - user_session_mobile:
            - pool:users_read
        - api_key:
            - pool:users_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserFullModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

    delete:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 Completely delete user
      security:
        - user_session_web:
            - pool:users_delete
        - user_session_mobile:
            - pool:users_delete
        - api_key:
            - pool:users_delete
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
      responses:
        '204':
          description: User deleted
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/users/{user_id}/deletion-request:
    get:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 Get user's deletion request
      security:
        - user_session_web:
            - pool:users_deletion_requests_read
        - user_session_mobile:
            - pool:users_deletion_requests_read
        - api_key:
            - pool:users_deletion_requests_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
      responses:
        '200':
          description: Deletion request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityDeletionRequest'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/users/{user_id}/sessions:
    get:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 List user's sessions
      security:
        - user_session_web:
            - pool:users_sessions_read
        - user_session_mobile:
            - pool:users_sessions_read
        - api_key:
            - pool:users_sessions_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
        - name: active
          required: false
          in: query
          schema:
            type: bool
          description: Show only active/inactive sessions. True by default.
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of user's sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfUserSessions'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/sessions/{session_id}:
    delete:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 Deactivate user's session
      security:
        - user_session_web:
            - pool:users_sessions_delete
        - user_session_mobile:
            - pool:users_sessions_delete
        - api_key:
            - pool:users_sessions_delete
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/session_id'
      responses:
        '204':
          description: Session deactivated
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/users/{user_id}/2fa/reset:
    post:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 Reset user's 2FA
      security:
        - user_session_web:
            - pool:users_2fa_delete
        - user_session_mobile:
            - pool:users_2fa_delete
        - api_key:
            - pool:users_2fa_delete
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - totp
                    - lookup_secret
                  description: Type of 2FA to reset
      responses:
        '204':
          description: 2FA reset
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/users/{user_id}/invites:
    get:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 List user's invites
      security:
        - user_session_web:
            - pool:users_invites_read
        - user_session_mobile:
            - pool:users_invites_read
        - api_key:
            - pool:users_invites_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of user's invites
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfUserInvites'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

    post:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 Send a new invite to user
      security:
        - user_session_web:
            - pool:users_invites_create
        - user_session_mobile:
            - pool:users_invites_create
        - api_key:
            - pool:users_invites_create
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
      responses:
        '200':
          description: Invite created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInvite'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /pools/{pool_id}/users/{user_id}/permissions:
    get:
      x-beta: true
      tags:
        - Pools
      summary: 🧪 List user's permissions
      security:
        - user_session_web:
            - pool:users_permissions_read
        - user_session_mobile:
            - pool:users_permissions_read
        - api_key:
            - pool:users_permissions_read
      parameters:
        - $ref: '#/components/parameters/pool_id'
        - $ref: '#/components/parameters/user_id'
      responses:
        '200':
          description: List of user's permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfUserPermissions'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /operators/{operator_id}:
    get:
      summary: Info about the operator.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:read
        - user_session_mobile:
            - operator:read
        - api_key:
            - operator:read
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Operator full model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatorFullModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/set-default-operator-fee-for-miners:
    post:
      summary: Update default operator fee for miners
      description: >-
        This method updates default operator fee for miners. The new value will
        be applied only to new miners. All existing miners will retain the old
        fee value.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:permissions_update
        - user_session_mobile:
            - operator:permissions_update
        - api_key:
            - operator:permissions_update
      parameters:
        - $ref: '#/components/parameters/operator_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fee
              properties:
                fee:
                  type: string
                  format: decimal
                  example: '0.005'
      responses:
        '200':
          description: The newly set default operator fee value
          content:
            application/json:
              schema:
                type: object
                required:
                  - fee
                properties:
                  fee:
                    type: string
                    format: decimal
                    example: '0.005'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/access:
    get:
      summary: List operator access rules
      description: Get a list of users who have access to the operator
      tags:
        - Operators
      parameters:
        - $ref: '#/components/parameters/operator_id'
      security:
        - user_session_web:
            - operator:permissions_read
        - user_session_mobile:
            - operator:permissions_read
        - api_key:
            - operator:permissions_read
      responses:
        '200':
          description: List of operator access rules
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OperatorAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Modify user access to the operator
      description: This method changes specified user access permissions for the operator.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:permissions_update
        - user_session_mobile:
            - operator:permissions_update
        - api_key:
            - operator:permissions_update
      parameters:
        - $ref: '#/components/parameters/operator_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - roles
              properties:
                email:
                  type: string
                  format: email
                roles:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/OperatorAccessRole'
      responses:
        '200':
          description: Operator access rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatorAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Invite user to access the operator
      description: This method invites specified user to access the operator.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:permissions_create
        - user_session_mobile:
            - operator:permissions_create
        - api_key:
            - operator:permissions_create
      parameters:
        - $ref: '#/components/parameters/operator_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - roles
              properties:
                email:
                  type: string
                  format: email
                roles:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/OperatorAccessRole'
      responses:
        '200':
          description: Operator access rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatorAccess'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Revoke access to the operator
      description: This method revokes access to the operator for the specified user.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:permissions_delete
        - user_session_mobile:
            - operator:permissions_delete
        - api_key:
            - operator:permissions_delete
      parameters:
        - $ref: '#/components/parameters/operator_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
      responses:
        '204':
          description: Access revoked
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/payments:
    get:
      summary: List operator payments.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:payments_list
        - user_session_mobile:
            - operator:payments_list
        - api_key:
            - operator:payments_list
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/tx_type'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of payments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/payments/export:
    get:
      summary: Export list of the operator's payments as CSV file.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:payments_list
        - user_session_mobile:
            - operator:payments_list
        - api_key:
            - operator:payments_list
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/tx_type'
        - $ref: '#/components/parameters/datetime_from'
        - $ref: '#/components/parameters/datetime_to'
      responses:
        '200':
          description: List of payments
          headers:
            Content-Disposition:
              $ref: '#/components/headers/Payments-Export-Content-Disposition'
          content:
            text/csv:
              schema:
                type: string
                example: >
                  created_at,effective_at,type,currency,amount,status,hashrate,rate,tx_hash
                  2023-01-02 02:00:00,2023-01-01
                  00:00:00,reward,BTC,0.00472423,completed,827415935642814097,0.000000000000000002192399084736862074189141067444586110763013383
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/balance:
    get:
      summary: Current operator balance.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:balances_read
        - user_session_mobile:
            - operator:balances_read
        - api_key:
            - operator:balances_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Current balance in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/earned-today:
    get:
      summary: Operator earnings for today.
      deprecated: true
      description: Use /operators/{operator_id}/processing-earnings instead
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:balances_read
        - user_session_mobile:
            - operator:balances_read
        - api_key:
            - operator:balances_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Operator earnings for today in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/processing-earnings:
    get:
      summary: Operator earnings being processed
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:balances_read
        - user_session_mobile:
            - operator:balances_read
        - api_key:
            - operator:balances_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Earnings being processed for 2 days in all currencies
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessingAmounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/earned-all-time:
    get:
      summary: Operator earnings for all time.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:balances_read
        - user_session_mobile:
            - operator:balances_read
        - api_key:
            - operator:balances_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Operator earnings for all time in all currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/earned-from-miner/{miner_id}:
    get:
      summary: Operator earnings from the specific miner for all time.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:balances_read
            - miner:balances_read
        - user_session_mobile:
            - operator:balances_read
            - miner:balances_read
        - api_key:
            - operator:balances_read
            - miner:balances_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: >-
            Operator earnings from the specific miner for all time in all
            currencies.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Amounts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/miners:
    get:
      summary: List miners managed by operator
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:miners_list
        - user_session_mobile:
            - operator:miners_list
        - api_key:
            - operator:miners_list
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/name_query'
      responses:
        '200':
          description: List of miners.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfMinerPoolModels'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Add a miner managed by operator
      tags:
        - Operators
        - Invites
      security:
        - user_session_web:
            - operator:miners_create
        - user_session_mobile:
            - operator:miners_create
        - api_key:
            - operator:miners_create
      parameters:
        - $ref: '#/components/parameters/operator_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_name
                - email
                - rate
              properties:
                account_name:
                  $ref: '#/components/schemas/AccountName'
                email:
                  type: string
                  format: email
                rate:
                  $ref: '#/components/schemas/FlatRateValue'
      responses:
        '200':
          description: Created miner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MinerFullModel'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/workers:
    get:
      summary: List workers managed by the operator.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:workers_list
        - user_session_mobile:
            - operator:workers_list
        - api_key:
            - operator:workers_list
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/list_of_worker_statuses'
        - $ref: '#/components/parameters/list_workers_sort_by'
        - $ref: '#/components/parameters/sort_direction'
        - $ref: '#/components/parameters/worker_behavior'
        - $ref: '#/components/parameters/name_query'
      responses:
        '200':
          description: List of workers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWorkers'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/workers/statuses:
    get:
      summary: Workers statistics
      description: Shows how many workers are in the corresponding status at the moment.
      tags:
        - Operators
      security:
        - user_session_web:
            - operator:workers_list
        - user_session_mobile:
            - operator:workers_list
        - api_key:
            - operator:workers_list
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Workers' status statistics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkerStatusesStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/chart:
    get:
      summary: Chart for the operator.
      tags:
        - Operators
        - Charts
      security:
        - user_session_web:
            - operator:charts_read
        - user_session_mobile:
            - operator:charts_read
        - api_key:
            - operator:charts_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/period'
      responses:
        '200':
          description: Data Points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleChart'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/stats:
    get:
      tags:
        - Operators
        - Mining Stats
      summary: Get Mining Stats for the operator.
      security:
        - user_session_web:
            - operator:charts_read
        - user_session_mobile:
            - operator:charts_read
        - api_key:
            - operator:charts_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
      responses:
        '200':
          description: Summarized Mining Stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiningStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/miners/{miner_id}/fees:
    get:
      summary: Miner->operator commission changes
      tags:
        - Operators
      security:
        - user_session_web:
            - miner:operator_plans_read
        - user_session_mobile:
            - miner:operator_plans_read
        - api_key:
            - miner:operator_plans_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: >-
            Schedule of miner->operator commission changes sorted the
            valid_until field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfTariffCommissions'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Update miner->operator commission schedule
      tags:
        - Operators
      security:
        - user_session_web:
            - miner:operator_plans_update
        - user_session_mobile:
            - miner:operator_plans_update
        - api_key:
            - miner:operator_plans_update
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCommissionSchedule'
      responses:
        '201':
          description: The schedule of miner->operator commission updated.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/miners/{miner_id}/fees/current:
    get:
      summary: Get current miner->operator commission
      tags:
        - Operators
      security:
        - user_session_web:
            - miner:operator_plans_read
        - user_session_mobile:
            - miner:operator_plans_read
        - api_key:
            - miner:operator_plans_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: Current miner->operator commission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TariffCommission'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /operators/{operator_id}/miners/{miner_id}/plan:
    get:
      summary: Operator tariff plan for the miner
      deprecated: true
      description: >
        Method is deprecated. Use `GET
        /operators/{operator_id}/miners/{miner_id}/fees` instead.
      tags:
        - Operators
      security:
        - user_session_web:
            - miner:operator_plans_read
        - user_session_mobile:
            - miner:operator_plans_read
        - api_key:
            - miner:operator_plans_read
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/miner_id'
      responses:
        '200':
          description: The current and the future tariff plans.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureTariffPlan'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update operator's tariff plan for the miner
      deprecated: true
      description: >
        Method is deprecated. Use `POST
        /operators/{operator_id}/miners/{miner_id}/fees` instead.
      tags:
        - Operators
      security:
        - user_session_web:
            - miner:operator_plans_update
        - user_session_mobile:
            - miner:operator_plans_update
        - api_key:
            - miner:operator_plans_update
      parameters:
        - $ref: '#/components/parameters/operator_id'
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rate
              properties:
                rate:
                  $ref: '#/components/schemas/FlatRateValue'
      responses:
        '200':
          description: The current and the future tariff plans.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureTariffPlan'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /workers/boundary:
    post:
      summary: Create a new boundary worker
      tags:
        - Hashrate Transfers
      security:
        - api_key:
            - miner(donor):workers_boundary_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - recipient_miner_id
                - donor_miner_id
                - hashrate
              properties:
                name:
                  type: string
                  example: MyBoundaryWorker
                  description: |-
                    Supported characters: 
                      - English letters: a-z, A-Z
                      - Digits: 0-9
                      - Special symbols: _- %$#@!^&*()[]{}<>/\\'"~
                  minLength: 3
                  maxLength: 64
                  pattern: ^[\w\-%$#@!\^&\*\(\)\[\]\{\}\<\>\/\\\'\"~]{3,64}$
                recipient_miner_id:
                  type: string
                  format: uuid
                donor_miner_id:
                  type: string
                  format: uuid
                hashrate:
                  type: string
                  format: decimal
                  example: '100000000000000'
                  description: >-
                    Hashrate in hashes per second. Example: 100000000000000
                    means 100 TH/s. Must be not less than 4294967296.
      responses:
        '200':
          description: The created boundary worker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoundaryWorker'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /workers/boundary/{worker_id}:
    get:
      summary: Get the boundary worker
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - worker:boundary_read
        - user_session_mobile:
            - worker:boundary_read
        - api_key:
            - worker:boundary_read
      parameters:
        - $ref: '#/components/parameters/worker_id'
      responses:
        '200':
          description: The boundary worker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoundaryWorker'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update the boundary worker hashrate
      tags:
        - Hashrate Transfers
      security:
        - api_key:
            - worker:boundary_update
      parameters:
        - $ref: '#/components/parameters/worker_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - hashrate
              properties:
                hashrate:
                  type: string
                  format: decimal
                  example: '100000000000000'
                  description: >-
                    Hashrate in hashes per second. Example: 100000000000000
                    means 100 TH/s. Must be not less than 4294967296.
      responses:
        '200':
          description: The updated boundary worker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoundaryWorker'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Disconnect the boundary worker
      tags:
        - Hashrate Transfers
      security:
        - api_key:
            - worker:boundary_delete
      parameters:
        - $ref: '#/components/parameters/worker_id'
      responses:
        '204':
          description: The boundary worker was disconnected successfully.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /workers/boundary/{worker_id}/boost:
    put:
      summary: Update the boundary worker boost hashrate
      tags:
        - Hashrate Transfers
      security:
        - api_key:
            - worker:boundary_update
      parameters:
        - $ref: '#/components/parameters/worker_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - hashrate
              properties:
                hashrate:
                  type: string
                  format: decimal
                  example: '100000000000000'
                  description: >-
                    Hashrate in hashes per second. Example: 100000000000000
                    means 100 TH/s. Must be not less than 4294967296.
      responses:
        '200':
          description: The updated boundary worker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoundaryWorker'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /workers/random-name:
    get:
      description: Generate a random name for a worker.
      tags:
        - Workers
      responses:
        '200':
          description: The random name.
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    example: AwesomePangolin
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /wallets/{wallet_id}/address:
    get:
      summary: Wallet address
      description: |
        Method is deprecated. Use `GET /wallets/{wallet_id}/addresses` instead.
      deprecated: true
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_read
        - user_session_mobile:
            - miner(wallet_owner):wallets_read
        - api_key:
            - miner(wallet_owner):wallets_read
        - user_session_web:
            - pool(wallet_owner):wallets_read
        - user_session_mobile:
            - pool(wallet_owner):wallets_read
        - api_key:
            - pool(wallet_owner):wallets_read
        - user_session_web:
            - operator(wallet_owner):wallets_read
        - user_session_mobile:
            - operator(wallet_owner):wallets_read
        - api_key:
            - operator(wallet_owner):wallets_read
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      responses:
        '200':
          description: The current and the future wallet addresses.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureWalletAddress'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      tags:
        - Wallets
      summary: Update wallet address
      description: |
        Method is deprecated. Use `POST /wallets/{wallet_id}/addresses` instead.
      deprecated: true
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_update
        - user_session_mobile:
            - miner(wallet_owner):wallets_update
        - api_key:
            - miner(wallet_owner):wallets_update
        - user_session_web:
            - pool(wallet_owner):wallets_update
        - user_session_mobile:
            - pool(wallet_owner):wallets_update
        - api_key:
            - pool(wallet_owner):wallets_update
        - user_session_web:
            - operator(wallet_owner):wallets_update
        - user_session_mobile:
            - operator(wallet_owner):wallets_update
        - api_key:
            - operator(wallet_owner):wallets_update
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - address
              properties:
                address:
                  description: Wallet address.
                  example: d8f7f55e689126db5521f8f725aaeba8436fcf60
                  type: string
      responses:
        '200':
          description: The current and the future wallet addresses.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureWalletAddress'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /wallets/{wallet_id}/addresses:
    get:
      summary: Wallet address changes
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_read
        - user_session_mobile:
            - miner(wallet_owner):wallets_read
        - api_key:
            - miner(wallet_owner):wallets_read
        - user_session_web:
            - pool(wallet_owner):wallets_read
        - user_session_mobile:
            - pool(wallet_owner):wallets_read
        - api_key:
            - pool(wallet_owner):wallets_read
        - user_session_web:
            - operator(wallet_owner):wallets_read
        - user_session_mobile:
            - operator(wallet_owner):wallets_read
        - api_key:
            - operator(wallet_owner):wallets_read
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      responses:
        '200':
          description: >-
            The list of wallet address changes sorted by the valid_until field
            descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWalletAddresses'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      tags:
        - Wallets
      summary: Change wallet address
      description: |
        Invalidates the current address and creates a new one.
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_update
        - user_session_mobile:
            - miner(wallet_owner):wallets_update
        - api_key:
            - miner(wallet_owner):wallets_update
        - user_session_web:
            - pool(wallet_owner):wallets_update
        - user_session_mobile:
            - pool(wallet_owner):wallets_update
        - api_key:
            - pool(wallet_owner):wallets_update
        - user_session_web:
            - operator(wallet_owner):wallets_update
        - user_session_mobile:
            - operator(wallet_owner):wallets_update
        - api_key:
            - operator(wallet_owner):wallets_update
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - address
              properties:
                address:
                  description: Wallet address
                  example: mubUpE11SXEuyM7EhSYEcnptbwvfcV72Nx
                  type: string
      responses:
        '200':
          description: >-
            The list of wallet address changes sorted by the valid_until field
            descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWalletAddresses'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /wallets/{wallet_id}/min-payment:
    get:
      summary: Wallet min payment
      deprecated: true
      description: >
        Method is deprecated. Use `GET /wallets/{wallet_id}/min-payments`
        instead.
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_read
        - user_session_mobile:
            - miner(wallet_owner):wallets_read
        - api_key:
            - miner(wallet_owner):wallets_read
        - user_session_web:
            - pool(wallet_owner):wallets_read
        - user_session_mobile:
            - pool(wallet_owner):wallets_read
        - api_key:
            - pool(wallet_owner):wallets_read
        - user_session_web:
            - operator(wallet_owner):wallets_read
        - user_session_mobile:
            - operator(wallet_owner):wallets_read
        - api_key:
            - operator(wallet_owner):wallets_read
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      responses:
        '200':
          description: The current and the future wallet min payments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureWalletMinPayment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update wallet min payment
      deprecated: true
      description: >
        Method is deprecated. Use `POST /wallets/{wallet_id}/min-payments`
        instead.
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_update
        - user_session_mobile:
            - miner(wallet_owner):wallets_update
        - api_key:
            - miner(wallet_owner):wallets_update
        - user_session_web:
            - pool(wallet_owner):wallets_update
        - user_session_mobile:
            - pool(wallet_owner):wallets_update
        - api_key:
            - pool(wallet_owner):wallets_update
        - user_session_web:
            - operator(wallet_owner):wallets_update
        - user_session_mobile:
            - operator(wallet_owner):wallets_update
        - api_key:
            - operator(wallet_owner):wallets_update
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
              properties:
                amount:
                  type: string
                  format: decimal
                  description: Minimal value is 0.001.
                  example: 0.01
      responses:
        '200':
          description: The current and the future wallet min payments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAndFutureWalletMinPayment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /wallets/{wallet_id}/min-payments:
    get:
      summary: Wallet min payment changes
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_read
        - user_session_mobile:
            - miner(wallet_owner):wallets_read
        - api_key:
            - miner(wallet_owner):wallets_read
        - user_session_web:
            - pool(wallet_owner):wallets_read
        - user_session_mobile:
            - pool(wallet_owner):wallets_read
        - api_key:
            - pool(wallet_owner):wallets_read
        - user_session_web:
            - operator(wallet_owner):wallets_read
        - user_session_mobile:
            - operator(wallet_owner):wallets_read
        - api_key:
            - operator(wallet_owner):wallets_read
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      responses:
        '200':
          description: >-
            The list of wallet min payment changes sorted by the valid_until
            field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWalletMinPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Change wallet min payment
      description: |
        Invalidates the current min payment and creates a new one.
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_update
        - user_session_mobile:
            - miner(wallet_owner):wallets_update
        - api_key:
            - miner(wallet_owner):wallets_update
        - user_session_web:
            - pool(wallet_owner):wallets_update
        - user_session_mobile:
            - pool(wallet_owner):wallets_update
        - api_key:
            - pool(wallet_owner):wallets_update
        - user_session_web:
            - operator(wallet_owner):wallets_update
        - user_session_mobile:
            - operator(wallet_owner):wallets_update
        - api_key:
            - operator(wallet_owner):wallets_update
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
              properties:
                amount:
                  type: string
                  format: decimal
                  description: Minimal value is 0.001.
                  example: 0.01
      responses:
        '200':
          description: >-
            The list of wallet min payment changes sorted by the valid_until
            field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWalletMinPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /wallets/{wallet_id}/max-payments:
    get:
      summary: Wallet max payment changes
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_read
        - user_session_mobile:
            - miner(wallet_owner):wallets_read
        - api_key:
            - miner(wallet_owner):wallets_read
        - user_session_web:
            - pool(wallet_owner):wallets_read
        - user_session_mobile:
            - pool(wallet_owner):wallets_read
        - api_key:
            - pool(wallet_owner):wallets_read
        - user_session_web:
            - operator(wallet_owner):wallets_read
        - user_session_mobile:
            - operator(wallet_owner):wallets_read
        - api_key:
            - operator(wallet_owner):wallets_read
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      responses:
        '200':
          description: >-
            The list of wallet max payment changes sorted by the valid_until
            field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWalletMaxPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Change wallet max payment
      description: |
        Invalidates the current max payment and creates a new one.
      tags:
        - Wallets
      security:
        - user_session_web:
            - miner(wallet_owner):wallets_update
        - user_session_mobile:
            - miner(wallet_owner):wallets_update
        - api_key:
            - miner(wallet_owner):wallets_update
        - user_session_web:
            - pool(wallet_owner):wallets_update
        - user_session_mobile:
            - pool(wallet_owner):wallets_update
        - api_key:
            - pool(wallet_owner):wallets_update
        - user_session_web:
            - operator(wallet_owner):wallets_update
        - user_session_mobile:
            - operator(wallet_owner):wallets_update
        - api_key:
            - operator(wallet_owner):wallets_update
      parameters:
        - $ref: '#/components/parameters/wallet_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
              properties:
                amount:
                  type: string
                  format: decimal
                  nullable: true
                  description: Maximal value. Can be null to reset to default.
                  example: 100
      responses:
        '200':
          description: >-
            The list of wallet max payment changes sorted by the valid_until
            field descending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfWalletMaxPayments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/charts:
    get:
      summary: Mining charts for multiple Miners
      description: >
        Gets charts for the list of specified miners.


        Please note that the list of ids is limited by browser request address
        length.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:miners_list
            - pool:charts_read
        - user_session_mobile:
            - pool:miners_list
            - pool:charts_read
        - api_key:
            - pool:miners_list
            - pool:charts_read
        - user_session_web:
            - miner:charts_read
        - user_session_mobile:
            - miner:charts_read
        - api_key:
            - miner:charts_read
        - watcher_token:
            - miner:charts_read
      parameters:
        - $ref: '#/components/parameters/period'
        - $ref: '#/components/parameters/list_of_ids'
      responses:
        '200':
          description: Data Points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipleCharts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_donor_id}/workers/boundary/charts:
    get:
      summary: Summary chart for all workers for which the miner is a donor
      tags:
        - Hashrate Transfers
      security:
        - user_session_web:
            - miner:virtual_mining_charts_read
        - user_session_mobile:
            - miner:virtual_mining_charts_read
        - api_key:
            - miner:virtual_mining_charts_read
      parameters:
        - $ref: '#/components/parameters/period'
        - $ref: '#/components/parameters/miner_donor_id'
      responses:
        '200':
          description: Data Points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleChart'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /workers/charts:
    get:
      summary: Charts for the list of workers.
      tags:
        - Workers
        - Charts
      security:
        - user_session_web:
            - pool:workers_list
            - pool:charts_read
        - user_session_mobile:
            - pool:workers_list
            - pool:charts_read
        - api_key:
            - pool:workers_list
            - pool:charts_read
        - user_session_web:
            - worker:charts_read
        - user_session_mobile:
            - worker:charts_read
        - api_key:
            - worker:charts_read
        - watcher_token:
            - worker:charts_read
      parameters:
        - $ref: '#/components/parameters/period'
        - $ref: '#/components/parameters/list_of_ids'
      responses:
        '200':
          description: Data Points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipleCharts'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/stats:
    get:
      summary: Mining stats for multiple Miners
      description: >
        Gets stats for the list of specified miners.


        Please note that the list of ids is limited by browser request address
        length.
      tags:
        - Pools
      security:
        - user_session_web:
            - pool:charts_read
            - pool:miners_list
        - user_session_mobile:
            - pool:charts_read
            - pool:miners_list
        - api_key:
            - pool:charts_read
            - pool:miners_list
        - user_session_web:
            - miner:charts_read
        - user_session_mobile:
            - miner:charts_read
        - api_key:
            - miner:charts_read
        - watcher_token:
            - miner:charts_read
      parameters:
        - $ref: '#/components/parameters/list_of_ids'
      responses:
        '200':
          description: Summarized Mining Stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipleMiningStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/statuses:
    get:
      summary: Worker statuses for multiple Miners
      description: >
        Gets worker status statistics for the list of specified miners. Returns
        aggregated counts

        of workers for each status (stable, off, unavailable, removed).


        This endpoint is useful for bulk operations when you need to display the
        health status

        of multiple miners at once without fetching detailed worker information.


        If no miner IDs are provided, returns statuses for all miners owned by
        the requesting user.
      tags:
        - Mining Stats
      security:
        - user_session_web:
            - miner:workers_list
        - user_session_mobile:
            - miner:workers_list
        - api_key:
            - miner:workers_list
        - watcher_token:
            - miner:workers_list
      parameters:
        - name: id
          in: query
          description: >
            List of miner IDs to get statuses for. If not provided, returns
            statuses

            for all miners owned by the requesting user.
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: true
        - name: limit
          in: query
          description: Maximum number of miners to return (default 500)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 500
        - name: offset
          in: query
          description: Number of miners to skip for pagination
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
      responses:
        '200':
          description: Worker Status Statistics for Miners
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfMinersStatuses'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /workers/stats:
    get:
      tags:
        - Workers
        - Mining Stats
      summary: Get Mining Stats for the list of Workers.
      security:
        - user_session_web:
            - pool:charts_read
            - pool:workers_list
        - user_session_mobile:
            - pool:charts_read
            - pool:workers_list
        - api_key:
            - pool:charts_read
            - pool:workers_list
        - user_session_web:
            - worker:charts_read
        - user_session_mobile:
            - worker:charts_read
        - api_key:
            - worker:charts_read
        - watcher_token:
            - worker:charts_read
      parameters:
        - $ref: '#/components/parameters/list_of_ids'
      responses:
        '200':
          description: Summarized Mining Stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipleMiningStats'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /pool/public/stats:
    get:
      x-beta: true
      summary: 🧪 Anonymous Pool stats
      tags:
        - Public Info
      responses:
        '200':
          description: Pool stats
          content:
            application/json:
              schema:
                type: object
                properties:
                  hashrate:
                    $ref: '#/components/schemas/HashRate'
                  miners:
                    type: integer
                    description: Number of hardware workers connected to the pool.
                    example: 3000
                  fee:
                    type: string
                    format: decimal
                    description: Pool fee in parts (0.01 = 1%).
                    example: '0.009'
                  minpay:
                    type: string
                    format: decimal
                    description: Minimum payout amount.
                    example: '0.0001'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /identity:
    get:
      summary: Current user details
      description: Shows information about the current logged-in user.
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      responses:
        '200':
          description: Identity info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Identity'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /identity/status:
    put:
      summary: Change User status
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - status
              properties:
                status:
                  $ref: '#/components/schemas/UserStatus'
      responses:
        '200':
          description: User status
          content:
            application/json:
              schema:
                required:
                  - status
                properties:
                  status:
                    $ref: '#/components/schemas/UserStatus'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /identity/language:
    put:
      summary: Switch user language
      description: >
        Changes user language in Identity object. Does not affect server
        response language, 

        but affects notifications. Also, client applications can use the
        language value

        to change translation.
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - language
              properties:
                language:
                  $ref: '#/components/schemas/Language'
      responses:
        '200':
          description: User language
          content:
            application/json:
              schema:
                required:
                  - language
                properties:
                  language:
                    $ref: '#/components/schemas/Language'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/delete-request:
    post:
      x-beta: true
      summary: 🧪 Request to delete identity
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: Deletion request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityDeletionRequest'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: >+
        _**This method is unstable** and could be a subject of change in the
        future._

  /identity/{identity_id}/navigation:
    get:
      summary: Current navigation info
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: Navigation info
          content:
            application/json:
              schema:
                type: object
                required:
                  - accounts
                properties:
                  accounts:
                    type: array
                    maxItems: 5
                    items:
                      $ref: '#/components/schemas/NavigationItem'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update navigation info
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
        - api_key: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - navigation
              properties:
                accounts:
                  type: array
                  maxItems: 5
                  items:
                    $ref: '#/components/schemas/NavigationItem'
      responses:
        '200':
          description: Navigation info
          content:
            application/json:
              schema:
                type: object
                required:
                  - accounts
                properties:
                  accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/NavigationItem'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/watchers:
    get:
      summary: Get user's bookmarked watchers
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: List of bookmarked watchers with permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - token
                        - permissions
                        - active
                      properties:
                        token:
                          $ref: '#/components/schemas/WatcherToken'
                        active:
                          type: boolean
                        permissions:
                          type: array
                          items:
                            - $ref: '#/components/schemas/MinerPermission'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    post:
      summary: Add a watcher to user's bookmarks
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
              properties:
                token:
                  $ref: '#/components/schemas/WatcherToken'
      responses:
        '201':
          description: Watcher was added to user's bookmarks
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/watchers/{watcher_token}:
    delete:
      summary: Delete a watcher from user's bookmarks
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
        - $ref: '#/components/parameters/watcher_token'
      responses:
        '204':
          description: Watcher was deleted from user's bookmarks
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/telegram/invites:
    post:
      summary: Create a telegram invite for user
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: Active telegram invite
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelegramInvite'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/telegram/invites/current:
    get:
      summary: Get user's current telegram invite
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: Active telegram invite
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelegramInvite'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/telegram/chats:
    delete:
      summary: Disconnect user from a telegram chat
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '204':
          description: Chat disconnected
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/telegram/chats/current:
    get:
      summary: Get user's current telegram chat
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: Active telegram chat
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelegramChat'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /identity/{identity_id}/notifications/preferences:
    get:
      summary: Get user's notifications preferences
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      responses:
        '200':
          description: User's notifications preferences
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationsPreferences'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    put:
      summary: Update user's notifications preferences
      tags:
        - User
      security:
        - user_session_web: []
        - user_session_mobile: []
      parameters:
        - $ref: '#/components/parameters/identity_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateNotificationsPreferences'
      responses:
        '200':
          description: User's notifications preferences updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationsPreferences'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /invites/accept:
    post:
      summary: Accept invitation
      tags:
        - Invites
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteAcceptance'
      responses:
        '200':
          description: Redirection link to set new password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedirectionLink'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/watchers:
    get:
      tags:
        - Miners
        - Watcher Links
      summary: List miner's watcher links
      security:
        - user_session_web:
            - miner:watchers_read
        - user_session_mobile:
            - miner:watchers_read
        - api_key:
            - miner:watchers_read
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Miner's watcher links
          content:
            aplication/json:
              schema:
                $ref: '#/components/schemas/ListOfWatchers'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
    post:
      tags:
        - Miners
        - Watcher Links
      summary: Create miner's watcher link
      security:
        - user_session_web:
            - miner:watchers_create
        - user_session_mobile:
            - miner:watchers_create
        - api_key:
            - miner:watchers_create
      parameters:
        - $ref: '#/components/parameters/miner_id'
      requestBody:
        required: true
        content:
          aplication/json:
            schema:
              type: object
              properties:
                extra_permissions:
                  type: array
                  items:
                    type: string
                    enum:
                      - accountant
                title:
                  type: string
                  example: My new awesome watcher link
                  description: If empty, will be generated automatically.
                  minLength: 1
                  maxLength: 300
      responses:
        '200':
          description: Created watcher link
          content:
            aplication/json:
              schema:
                $ref: '#/components/schemas/Watcher'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /miners/{miner_id}/watchers/{watcher_id}:
    delete:
      tags:
        - Miners
        - Watcher Links
      summary: Delete miner's watcher link
      security:
        - user_session_web:
            - miner:watchers_delete
        - user_session_mobile:
            - miner:watchers_delete
        - api_key:
            - miner:watchers_delete
      parameters:
        - $ref: '#/components/parameters/miner_id'
        - $ref: '#/components/parameters/watcher_id'
      responses:
        '204':
          description: Watcher link was deleted successfully
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /watchers/{watcher_token}:
    get:
      tags:
        - Watcher Links
      summary: Get permissions by watcher token
      parameters:
        - $ref: '#/components/parameters/watcher_token'
      responses:
        '200':
          description: Watcher permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  permissions:
                    type: array
                    items:
                      - $ref: '#/components/schemas/MinerPermission'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
security:
  - api_key: []
  - user_session_web: []
  - user_session_mobile: []
  - watcher_token: []
  - internal_api_key: []
components:
  securitySchemes:
    api_key:
      description: |
        Standard bearer authorization.
        API key can be requested through pool support.
      type: http
      scheme: bearer
    user_session_web:
      description: >
        User session is created after successful authentication. Cookie is used

        to store and pass around the session ID. Cookie is set with http-only
        and secure flags,

        so you won't be able to read it with on-page javascript.
      type: apiKey
      in: cookie
      name: ory_session_wizardlyedisonbvrtb4rj3h
    user_session_mobile:
      description: >
        User session is created after successful authentication. Mobile app uses

        token, which is stored on the mobile app side and sent to server using
        header.
      type: apiKey
      in: header
      name: X-Session-Token
    watcher_token:
      description: >
        Watcher token has limited access to only the methods required to view
        certain pages.

        Watcher tokens are easily issued and revoked, so they are not usable for
        anything else

        except watcher links.
      type: apiKey
      in: header
      name: X-Watcher-Token
    internal_api_key:
      description: >
        Internal server-to-server API key is used to access the API for various
        platform internal integrations.
      type: apiKey
      in: header
      name: X-Headframe-API-Key
  parameters:
    date_from:
      name: from
      in: query
      schema:
        type: string
        format: date
        example: '2023-03-14'
    date_to:
      name: to
      in: query
      schema:
        type: string
        format: date
        example: '2023-04-14'
    currency:
      name: currency
      in: query
      schema:
        type: string
        enum:
          - BTC
    created_date:
      name: created_date
      in: query
      required: true
      schema:
        type: string
        format: date
        example: '2023-03-14'
    workflow_type:
      name: type
      description: Workflow type
      in: query
      required: false
      schema:
        type: string
        format: string
        enum:
          - reward
          - payout
        example: reward
    account_id:
      name: account_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    miner_id:
      name: miner_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 10
        minimum: 1
        maximum: 100
    offset:
      name: offset
      in: query
      schema:
        type: integer
        default: 0
    tx_type:
      name: type
      in: query
      schema:
        description: Transaction type.
        type: array
        items:
          type: string
          enum:
            - reward
            - payout
            - profit_sharing
            - virtual_mining_transfer
            - virtual_mining_reward
            - virtual_mining_topup
            - transfer
    datetime_from:
      name: from
      in: query
      schema:
        type: string
        format: datetime
        example: '2023-01-01T00:00:00Z'
    datetime_to:
      name: to
      in: query
      schema:
        type: string
        format: datetime
        example: '2023-01-01T00:00:00Z'
    miner_donor_id:
      name: miner_donor_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    include_future:
      name: include_future
      in: query
      required: false
      description: Includes future profit sharings in the response.
      schema:
        type: boolean
    miner_recipient_id:
      name: miner_recipient_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    list_of_worker_statuses:
      description: If empty, then return all workers except removed ones.
      name: status
      in: query
      required: false
      explode: true
      style: form
      schema:
        type: array
        items:
          type: string
          enum:
            - stable
            - unavailable
            - 'off'
            - removed
    list_workers_sort_by:
      name: sort-by
      in: query
      required: false
      schema:
        type: string
        enum:
          - default
          - worker_name
          - name_similarity
          - hash_rate_15m
          - hash_rate_1h
          - hash_rate_24h
          - reject_pct_15m
        default: default
    sort_direction:
      name: sort-direction
      in: query
      required: false
      schema:
        type: string
        enum:
          - asc
          - desc
        default: asc
    worker_behavior:
      name: behavior
      in: query
      required: false
      explode: true
      style: form
      schema:
        type: array
        items:
          type: string
          enum:
            - hardware
            - boundary
    name_query:
      name: name
      in: query
      required: false
      description: >-
        Used for searching entities by name, supporting both exact and fuzzy
        matching to find relevant results.
      schema:
        type: string
        minLength: 2
        example: Alex21
    list_of_boundary_worker_statuses:
      description: If empty, then return all boundary workers.
      name: status
      in: query
      required: false
      explode: true
      style: form
      schema:
        type: array
        items:
          type: string
          enum:
            - stable
            - 'off'
    list_boundary_workers_sort_by:
      name: sort-by
      in: query
      required: false
      schema:
        type: string
        enum:
          - default
          - worker_name
          - nominal_hashrate
          - created_at
        default: default
    year:
      name: year
      in: query
      schema:
        type: integer
        description: Year in YYYY-format
        example: 2025
    month:
      name: month
      in: query
      schema:
        type: integer
        description: Month number
        example: 1
        minimum: 1
        maximum: 12
    pool_host:
      name: X-Headframe-Domain
      in: header
      required: true
      schema:
        type: string
        format: host
        example: bestpool.demo.headframe.io
      description: |
        The address of the pool at which the configuration is requested.
    pool_id:
      name: pool_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    period:
      name: period
      in: query
      schema:
        type: string
        format: duration
        enum:
          - PT15M
          - PT1H
          - P1D
          - P1W
      description: >
        The time period for the selected chart. 

        For each of the periods there is a different frequency of points.

        - PT15M: 15-minute time period, the distance between the points is 1
        minute.

        - PT1H: 1-hour time period, the distance between the points is 5
        minutes.

        - P1D: 24-hour time period, the distance between the points is 20
        minutes.

        - P1W: 7-day time period, the distance between the points is 4 hours.
    email_query:
      name: email
      in: query
      required: false
      description: >-
        Used for searching users by email, supporting both exact and fuzzy
        matching to find relevant results.
      schema:
        type: string
        minLength: 2
        example: Alex21
    list_users_sort_by:
      name: sort-by
      in: query
      required: false
      schema:
        type: string
        enum:
          - default
          - registered_date
          - email_similarity
        default: default
    user_id:
      name: user_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    session_id:
      name: session_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    operator_id:
      name: operator_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    worker_id:
      name: worker_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    wallet_id:
      name: wallet_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    list_of_ids:
      name: id
      in: query
      schema:
        type: array
        items:
          type: string
          format: uuid
        minItems: 1
        example: 0e4ce810-6107-4eb0-a71c-53046e396aa3
      description: List of entity IDs.
      style: form
      explode: true
      examples:
        oneId:
          summary: Example of a single ID
          value:
            - 0e4ce810-6107-4eb0-a71c-53046e396aa3
        multipleIds:
          summary: Example of multiple IDs
          value:
            - 0e4ce810-6107-4eb0-a71c-53046e396aa3
            - f6e3e748-16c6-4235-a5bb-d948b9638c6e
    identity_id:
      name: identity_id
      required: true
      in: path
      schema:
        oneOf:
          - type: string
            format: uuid
            description: Identity UUID
          - type: string
            enum:
              - current
            description: Current user identity. UUID is taken from session.
    watcher_token:
      name: watcher_token
      required: true
      in: path
      schema:
        type: string
        example: hfwl_0123456789abcdef000000000000000000000000000000000000000000000000
    watcher_id:
      name: watcher_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
  schemas:
    RatesList:
      type: object
      properties:
        rates:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date
                example: '2022-12-14'
              currency:
                type: string
                example: BTC
              rate:
                type: string
                format: decimal
                example: '0.00000367'
    InvalidInputError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - invalid_input
            message:
              type: string
              format: string
              example: >-
                json: cannot unmarshal number into struct field account_name of
                type string
    ValidationError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - validation_error
            message:
              type: string
              format: string
              example: Validation failed
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    format: string
                    enum:
                      - validation_is_email
                      - validation_is_url
                      - validation_is_request_url
                      - validation_request_is_request_uri
                      - validation_is_alpha
                      - validation_is_digit
                      - validation_is_alphanumeric
                      - validation_is_utf_letter
                      - validation_is_utf_digit
                      - validation_is utf_letter_numeric
                      - validation_is_utf_numeric
                      - validation_is_lower_case
                      - validation_is_upper_case
                      - validation_is_hexadecimal
                      - validation_is_hex_color
                      - validation_is_rgb_color
                      - validation_is_int
                      - validation_is_float
                      - validation_is_uuid_v3
                      - validation_is_uuid_v4
                      - validation_is_uuid_v5
                      - validation_is_uuid
                      - validation_is_credit_card
                      - validation_is_isbn_10
                      - validation_is_isbn_13
                      - validation_is_isbn
                      - validation_is_json
                      - validation_is_ascii
                      - validation_is_printable_ascii
                      - validation_is_multibyte
                      - validation_is_full_width
                      - validation_is_half_width
                      - validation_is_variable_width
                      - validation_is_base64
                      - validation_is_data_uri
                      - validation_is_e164_number
                      - validation_is_country_code_2_letter
                      - validation_is_country_code_3_letter
                      - validation_is_currency_code
                      - validation_is_dial_string
                      - validation_is_mac_address
                      - validation_is_ip
                      - validation_is_ipv4
                      - validation_is_ipv6
                      - validation_is_sub_domain
                      - validation_is_domain
                      - validation_is_dns_name
                      - validation_is_host
                      - validation_is_port
                      - validation_is_mongo_id
                      - validation_is_latitude
                      - validation_is_longitude
                      - validation_is_ssn
                      - validation_is_semver
                      - validation_nil
                      - validation_empty
                      - validation_date_invalid
                      - validation_date_min_greater_equal_than_required
                      - validation_date_max_less_equal_than_required
                      - validation_in_invalid
                      - validation_length_too_long
                      - validation_length_too_short
                      - validation_length_invalid
                      - validation_length_out_of_range
                      - validation_length_empty_required
                      - validation_key_wrong_type
                      - validation_key_missing
                      - validation_key_unexpected
                      - validation_match_invalid
                      - validation_min_greater_equal_than_required
                      - validation_max_less_equal_than_required
                      - validation_min_greater_than_required
                      - validation_max_less_than_required
                      - validation_multiple_of_invalid
                      - validation_not_in_invalid
                      - validation_not_nil_required
                      - validation_required
                      - validation_nil_or_not_empty_required
                      - validation_account_name_is_taken
                      - validation_crypto_address_invalid
                      - validation_worker_name_is_taken
                  message:
                    type: string
                    format: string
                    enum:
                      - must be a valid email address
                      - must be a valid URL
                      - must be a valid request URL
                      - must be a valid request URI
                      - must contain English letters only
                      - must contain digits only
                      - must contain English letters and digits only
                      - 'must contain only the following characters: {{chars}}'
                      - must contain unicode letter characters only
                      - must contain unicode decimal digits only
                      - must contain unicode letters and numbers only
                      - must contain unicode number characters only
                      - must be in lower case
                      - must be in upper case
                      - must be a valid hexadecimal number
                      - must be a valid hexadecimal color code
                      - must be a valid RGB color code
                      - must be an integer number
                      - must be a floating point number
                      - must be a valid UUID v3
                      - must be a valid UUID v4
                      - must be a valid UUID v5
                      - must be a valid UUID
                      - must be a valid credit card number
                      - must be a valid ISBN-10
                      - must be a valid ISBN-13
                      - must be a valid ISBN
                      - must be in valid JSON format
                      - must contain ASCII characters only
                      - must contain printable ASCII characters only
                      - must contain multibyte characters
                      - must contain full-width characters
                      - must contain half-width characters
                      - must contain both full-width and half-width characters
                      - must be encoded in Base64
                      - must be a Base64-encoded data URI
                      - must be a valid E164 number
                      - must be a valid two-letter country code
                      - must be a valid three-letter country code
                      - must be valid ISO 4217 currency code
                      - must be a valid dial string
                      - must be a valid MAC address
                      - must be a valid IP address
                      - must be a valid IPv4 address
                      - must be a valid IPv6 address
                      - must be a valid subdomain
                      - must be a valid domain
                      - must be a valid DNS name
                      - must be a valid IP address or DNS name
                      - must be a valid port number
                      - must be a valid hex-encoded MongoDB ObjectId
                      - must be a valid latitude
                      - must be a valid longitude
                      - must be a valid social security number
                      - must be a valid semantic version
                      - must be blank
                      - must be a valid date
                      - the date is out of range
                      - the date must be no greater than {{threshold}}
                      - the date must be no less than {{threshold}}
                      - must be a valid value [{{values}}]
                      - the length must be no more than {{max}}
                      - the length must be no less than {{min}}
                      - the length must be exactly {{min}}
                      - the length must be between {{min}} and {{max}}
                      - the value must be empty
                      - key not the correct type
                      - required key is missing
                      - key not expected
                      - must be in a valid format
                      - must be no less than {{threshold}}
                      - must be no greater than {{threshold}}
                      - must be greater than {{threshold}}
                      - must be less than {{threshold}}
                      - must be multiple of {{base}}
                      - must not be in list
                      - is required
                      - cannot be blank
                      - account name is taken
                      - 'must be valid address ({{currency}}: {{network}})'
                      - worker name is taken
                  field:
                    type: string
                    format: string
                    example: account_name
                  params:
                    type: object
                    additionalProperties: {}
                    example:
                      min: 3
                      max: 32
    InvalidFormError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - user_already_has_miner
                - from_date_cannot_be_greater_than_to_date
                - language_is_not_supported_by_pool
            message:
              type: string
              format: string
              example: miner already exist
    RateLimitError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - rate_limit
            message:
              type: string
              format: string
              example: Too many requests hit the API too quickly
    InternalError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - internal_error
            message:
              type: string
              format: string
              example: Internal server error
    CompletedWorkflow:
      type: object
      required:
        - effective_date
        - type
        - created_at
      properties:
        effective_date:
          type: string
          format: date
          example: '2024-12-05'
        type:
          type: string
          format: string
          enum:
            - reward
            - payout
        created_at:
          type: string
          format: date-time
          example: '2024-12-05 12:00:00'
    AccessDeniedError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - access_denied
            message:
              type: string
              format: string
              example: Access denied
    MFARequiredError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - mfa_required
            message:
              type: string
              format: string
              example: Multifactor authentication required
    AmountSingleCurrency:
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          format: string
          example: BTC
        amount:
          type: string
          format: decimal
          example: '0.00068716'
    AccountName:
      example: Superminer123
      type: string
      minLength: 3
      maxLength: 32
      pattern: ^\w{3,32}$
    MinerShortModel:
      type: object
      required:
        - id
        - account_name
      properties:
        id:
          type: string
          format: uuid
        account_name:
          $ref: '#/components/schemas/AccountName'
        title:
          type: string
          example: LLC 'Super Miner'
          description: Visible only to the Pool.
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - active
            - pending
            - inactive
        contacts:
          type: object
          properties:
            email:
              type: string
              format: email
        registered_at:
          type: string
          format: date-time
    MinerFullModel:
      allOf:
        - $ref: '#/components/schemas/MinerShortModel'
        - type: object
          required:
            - status
            - wallets
            - pool
            - owner
          properties:
            status:
              type: string
              enum:
                - active
                - inactive
            wallets:
              type: array
              items:
                format: uuid
                type: string
            pool:
              type: object
              required:
                - id
              properties:
                id:
                  type: string
                  format: uuid
            operator:
              type: object
              required:
                - id
              properties:
                id:
                  type: string
                  format: uuid
            owner:
              $ref: '#/components/schemas/User'
    AuthenticationRequiredError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - authentication_required
            message:
              type: string
              format: string
              example: Authentication required
    APIKeyExpiredError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - api_key_expired
            message:
              type: string
              format: string
              example: The API key provided has expired
    NotFoundError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              format: string
              enum:
                - not_found
            message:
              type: string
              format: string
              example: The requested page does not exist
    UserAccessModel:
      type: object
      required:
        - id
        - email
      properties:
        id:
          type: string
          format: uuid
        email:
          type: string
          format: email
    MinerAccessRole:
      type: string
      enum:
        - admin
        - viewer
        - accountant
    MinerAccess:
      type: object
      required:
        - user
        - roles
      properties:
        user:
          $ref: '#/components/schemas/UserAccessModel'
        roles:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/MinerAccessRole'
    ConflictError:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              format: string
              enum:
                - user_already_exists
                - user_already_has_permission
                - user_is_owner
                - reward_already_processed
                - payout_already_processed
            message:
              type: string
              format: string
              example: user already exists
    _pagination:
      type: object
      required:
        - limit
        - offset
        - total_items
      properties:
        limit:
          type: integer
          format: integer
          example: 10
          default: 10
          minimum: 1
          maximum: 100
        offset:
          type: integer
          format: integer
          example: 10
        total_count:
          type: integer
          format: integer
          example: 300
    PaymentCommon:
      type: object
      required:
        - id
        - direction
        - currency
        - amount
        - status
        - created_at
        - effective_at
      properties:
        id:
          type: string
          format: uuid
        direction:
          type: string
          format: string
          example: incoming
          enum:
            - incoming
            - outgoing
        currency:
          type: string
          example: BTC
        amount:
          type: string
          format: decimal
          example: '0.000003850292003'
        status:
          type: string
          example: completed
          enum:
            - pending
            - canceled
            - completed
        created_at:
          type: string
          format: date-time
          example: 2006-01-02T15:04:05Z07:00
        effective_at:
          type: string
          format: date-time
          example: 2006-01-02T15:04:05Z07:00
    PaymentReward:
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              format: string
              enum:
                - reward
        - $ref: '#/components/schemas/PaymentCommon'
        - type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - rate
                - hashrate
              properties:
                rate:
                  type: string
                  format: decimal
                  example: '0.00000000000000000282'
                  description: Actual rate, BTC/H/s
                hashrate:
                  type: string
                  format: decimal
                  example: '178469469608370'
                  description: Hashrate per day, H/s
                description:
                  type: string
                  format: string
                  example: Reward for participation in the competition
                  description: A short description of the payment
    PaymentPayout:
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              format: string
              enum:
                - payout
        - $ref: '#/components/schemas/PaymentCommon'
        - type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - tx_hash
              properties:
                tx_hash:
                  type: string
                  format: string
                  example: >-
                    d67dbefb9fb98f1fbb89fc7163e90eb67ce4da6394fbcd610d63fa3e0421fbe1
                  description: Transaction hash on the bitcoin blockchain
                description:
                  type: string
                  format: string
                  example: Reward for participation in the competition
                  description: A short description of the payment
    PaymentProfitSharing:
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              format: string
              enum:
                - profit_sharing
        - $ref: '#/components/schemas/PaymentCommon'
        - type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - rate
                - hashrate
                - received_from
              properties:
                rate:
                  type: string
                  format: decimal
                  example: '0.00000000000000000282'
                  description: Actual rate, BTC/H/s
                hashrate:
                  type: string
                  format: decimal
                  example: '178469469608370'
                  description: Hashrate per day, H/s
                received_from:
                  type: string
                  example: OtherMiner
                  description: Account name for the profit sharing donor
                description:
                  type: string
                  format: string
                  example: Reward for participation in the competition
                  description: A short description of the payment
    PaymentVirtualMiningReward:
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              format: string
              enum:
                - virtual_mining_reward
        - $ref: '#/components/schemas/PaymentCommon'
        - type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - rate
                - hashrate
              properties:
                rate:
                  type: string
                  format: decimal
                  example: '0.00000000000000000282'
                  description: Actual rate, BTC/H/s
                hashrate:
                  type: string
                  format: decimal
                  example: '178469469608370'
                  description: Hashrate per day, H/s
                description:
                  type: string
                  format: string
                  example: Reward for participation in the competition
                  description: A short description of the payment
    PaymentVirtualMiningTransfer:
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              format: string
              enum:
                - virtual_mining_transfer
        - $ref: '#/components/schemas/PaymentCommon'
        - type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - hashrate
                - donor_fee
              properties:
                hashrate:
                  type: string
                  format: decimal
                  example: '178469469608370'
                  description: Hashrate per day, H/s
                donor_fee:
                  type: string
                  format: decimal
                  example: '0.00001201'
                  description: Fee deducted by donor, BTC
                description:
                  type: string
                  format: string
                  example: Reward for participation in the competition
                  description: A short description of the payment
    PaymentTransfer:
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              format: string
              enum:
                - transfer
        - $ref: '#/components/schemas/PaymentCommon'
        - type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              properties:
                description:
                  type: string
                  format: string
                  example: Reward for participation in the competition
                  description: A short description of the payment
    Payment:
      oneOf:
        - $ref: '#/components/schemas/PaymentReward'
        - $ref: '#/components/schemas/PaymentPayout'
        - $ref: '#/components/schemas/PaymentProfitSharing'
        - $ref: '#/components/schemas/PaymentVirtualMiningReward'
        - $ref: '#/components/schemas/PaymentVirtualMiningTransfer'
        - $ref: '#/components/schemas/PaymentTransfer'
    ListOfPayments:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
        pagination:
          $ref: '#/components/schemas/_pagination'
    Amounts:
      type: object
      required: data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AmountSingleCurrency'
    ProcessingAmounts:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - currency
              - amounts
            properties:
              currency:
                type: string
                format: string
                example: BTC
              amounts:
                type: object
                required:
                  - yesterday
                  - today
                properties:
                  yesterday:
                    type: string
                    format: decimal
                    example: '0.00157816'
                  today:
                    type: string
                    format: decimal
                    example: '0.00068716'
    HashRate:
      type: string
      format: decimal
      description: Average hashrate per second for a period.
      example: '100000000000000.00'
    Referral:
      type: object
      required:
        - id
        - hashrate
        - registered_at
        - rate
      properties:
        id:
          type: string
          format: uuid
        rate:
          type: string
          format: decimal
          example: '0.001'
        hashrate:
          type: object
          required:
            - day
            - week
            - month
          properties:
            day:
              $ref: '#/components/schemas/HashRate'
            week:
              $ref: '#/components/schemas/HashRate'
            month:
              $ref: '#/components/schemas/HashRate'
        registered_at:
          type: string
          format: date-time
    ListOfReferrals:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Referral'
        pagination:
          $ref: '#/components/schemas/_pagination'
    FlatRateValue:
      type: string
      format: decimal
      description: Flat fee value, min = 0, max = 1 (0.01 = 1%).
      example: 0.009
    ProfitSharing:
      type: object
      required:
        - rate
        - type
        - recipient
        - valid_from
        - valid_until
      properties:
        rate:
          $ref: '#/components/schemas/FlatRateValue'
        type:
          type: string
          enum:
            - profit_sharing
            - referral
        recipient:
          type: object
          required:
            - id
            - account_name
          properties:
            id:
              type: string
              format: uuid
            account_name:
              $ref: '#/components/schemas/AccountName'
        valid_from:
          type: string
          format: datetime
          example: '2022-09-12T00:00:00Z'
        valid_until:
          type: string
          format: datetime
          example: '2022-09-12T00:00:00Z'
    VirtualHashrateLimitDetails:
      type: object
      required:
        - limit
        - valid_from
        - valid_until
      properties:
        limit:
          type: string
          format: decimal
          description: Limit value, min = 0.
          example: 5000000000000000
        valid_from:
          description: The date when the limit becomes valid.
          type: string
          format: date
          example: '2024-12-05T13:02:00Z'
        valid_until:
          description: The date when the limit becomes invalid.
          type: string
          format: date
          example: '9999-01-01T00:00:00Z'
    VirtualHashrateLimits:
      type: object
      required:
        - future
      properties:
        current:
          $ref: '#/components/schemas/VirtualHashrateLimitDetails'
        future:
          $ref: '#/components/schemas/VirtualHashrateLimitDetails'
    Worker:
      type: object
      required:
        - id
        - name
        - behavior
        - status
        - miner
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: AwesomeBTCWorker
        behavior:
          type: string
          enum:
            - hardware
            - boundary
          example: hardware
        status:
          type: string
          enum:
            - stable
            - unavailable
            - 'off'
            - removed
        miner:
          $ref: '#/components/schemas/MinerShortModel'
    ListOfWorkers:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Worker'
        pagination:
          $ref: '#/components/schemas/_pagination'
    NominalHashrate:
      type: object
      required:
        - hashrate
      properties:
        hashrate:
          type: string
          format: decimal
          example: 100000000000000
        valid_from:
          type: string
          format: datetime
          example: '2022-09-12T00:00:00Z'
        valid_until:
          type: string
          format: datetime
          example: '2022-09-12T00:00:00Z'
    BoundaryWorker:
      allOf:
        - $ref: '#/components/schemas/Worker'
        - type: object
          properties:
            behavior:
              type: string
              enum:
                - boundary
              example: boundary
            donor:
              $ref: '#/components/schemas/MinerShortModel'
            hashrate:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/NominalHashrate'
                future:
                  $ref: '#/components/schemas/NominalHashrate'
            boost_hashrate:
              type: object
              properties:
                current:
                  $ref: '#/components/schemas/NominalHashrate'
                future:
                  $ref: '#/components/schemas/NominalHashrate'
            created_at:
              type: string
              format: date-time
    ListOfBoundaryWorkers:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/BoundaryWorker'
        pagination:
          $ref: '#/components/schemas/_pagination'
    WorkerStatusesStats:
      type: object
      required:
        - removed
        - 'off'
        - unavailable
        - stable
      properties:
        removed:
          type: integer
          example: 10
        'off':
          type: integer
          example: 1
        unavailable:
          type: integer
          example: 13
        stable:
          type: integer
          example: 150
    BoundaryWorkerStatusesStats:
      type: object
      properties:
        'off':
          type: integer
          example: 1
        stable:
          type: integer
          example: 150
    RejectRate:
      type: string
      format: decimal
      description: Average reject rate per second for a period.
      example: '1048576.00'
    WorkerStatsList:
      type: object
      required:
        - from
        - to
        - data
      properties:
        from:
          type: string
          format: date
          example: '2022-09-12'
        to:
          type: string
          format: date
          example: '2022-09-13'
        data:
          type: array
          items:
            type: object
            required:
              - date
              - from
              - to
              - workers
            properties:
              date:
                type: string
                format: date
                example: '2022-09-12'
              from:
                type: string
                format: date-time
                example: '2022-09-12T00:00:00Z'
              to:
                type: string
                format: date-time
                example: '2022-09-12T23:59:59Z'
              workers:
                type: array
                items:
                  required:
                    - account_name
                    - worker_name
                    - hashrate
                    - rejectrate
                  type: object
                  properties:
                    account_name:
                      $ref: '#/components/schemas/AccountName'
                    worker_name:
                      type: string
                      example: BTCMiner69
                    hashrate:
                      $ref: '#/components/schemas/HashRate'
                    rejectrate:
                      $ref: '#/components/schemas/RejectRate'
    MiningStats:
      type: object
      properties:
        15m:
          type: object
          properties:
            hashrate:
              $ref: '#/components/schemas/HashRate'
            rejectrate:
              $ref: '#/components/schemas/RejectRate'
          description: |
            Stats for the last 15 minutes.

            The start of the interval is 15 minutes ago.
            The end of the interval is the current moment.
        1h:
          type: object
          properties:
            hashrate:
              $ref: '#/components/schemas/HashRate'
            rejectrate:
              $ref: '#/components/schemas/RejectRate'
          description: |
            Stats for the last 1 hour.

            The start of the interval is 1 hour ago.
            The end of the interval is the current moment.
        1d:
          type: object
          properties:
            hashrate:
              $ref: '#/components/schemas/HashRate'
            rejectrate:
              $ref: '#/components/schemas/RejectRate'
          description: |
            Stats for the last 1 day.

            The start of the interval is 1 day ago.
            The end of the interval is the current moment.
        1w:
          type: object
          properties:
            hashrate:
              $ref: '#/components/schemas/HashRate'
            rejectrate:
              $ref: '#/components/schemas/RejectRate'
          description: |
            Stats for the last 1 week.

            The start of the interval is 1 week ago.
            The end of the interval is the current moment.
    TariffPlan:
      type: object
      required:
        - rate
      properties:
        rate:
          $ref: '#/components/schemas/FlatRateValue'
        valid_from:
          type: string
          format: datetime
          example: '2022-09-12T00:00:00Z'
        valid_until:
          type: string
          format: datetime
          example: '2022-09-12T00:00:00Z'
    CurrentAndFutureTariffPlan:
      type: object
      required:
        - current
      properties:
        current:
          $ref: '#/components/schemas/TariffPlan'
        future:
          $ref: '#/components/schemas/TariffPlan'
    TariffCommission:
      type: object
      required:
        - fee
        - valid_from
        - valid_until
      properties:
        fee:
          $ref: '#/components/schemas/FlatRateValue'
        valid_from:
          description: >-
            The date when the commission becomes valid. The date is assumed to
            be midnight of the specified day in the UTC timezone. For example,
            `2019-01-01` means `2019-01-01T00:00:00Z`.
          type: string
          format: date
        valid_until:
          description: >-
            The date when the commission becomes invalid. The date is assumed to
            be midnight of the specified day in the UTC timezone. For example,
            `2019-01-01` means `2019-01-01T00:00:00Z`.
          type: string
          format: date
        comment:
          type: string
          minLength: 1
          maxLength: 300
          example: New tariff plan
    ListOfTariffCommissions:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 10
          items:
            $ref: '#/components/schemas/TariffCommission'
        pagination:
          $ref: '#/components/schemas/_pagination'
    UpdateCommissionSchedule:
      type: object
      required:
        - schedule
      properties:
        schedule:
          description: The schedule of miner commission changes.
          example:
            - valid_from: '2019-01-01'
              fee: 0.01
              comment: Discount for the New Year
            - valid_from: '2019-02-01'
              fee: 0.02
              comment: Increased commission in honor of Valentine's Day
            - valid_from: '2019-03-01'
              fee: 0.015
              comment: Default commission
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: object
            required:
              - fee
              - valid_from
            properties:
              fee:
                $ref: '#/components/schemas/FlatRateValue'
              valid_from:
                description: >-
                  The date when the commission becomes valid. The date is
                  assumed to be midnight of the specified day in the UTC
                  timezone. For example, `2019-01-01` means
                  `2019-01-01T00:00:00Z`. Minimum date is tomorrow.
                type: string
                format: date
              comment:
                type: string
                minLength: 1
                maxLength: 300
                example: New tariff plan
    ReferrerCodePolicy:
      type: object
      required:
        - code
        - pool_flat_rate
        - policy
      properties:
        code:
          type: string
          example: hfrc_XZKKINF0
        pool_flat_rate:
          $ref: '#/components/schemas/FlatRateValue'
        policy:
          type: object
          required:
            - pool_rate_multiplier
            - referrer_reward_multiplier
          properties:
            pool_rate_multiplier:
              type: string
              format: decimal
              example: '0.9'
            referrer_reward_multiplier:
              type: string
              format: decimal
              example: '0.1'
    MiningReportMiner:
      type: object
      required:
        - end_of_month_balance
        - reward_amount
        - working_hours
        - wallet_addresses
      properties:
        end_of_month_balance:
          type: string
          format: decimal
          description: Account balance at the end of month
          example: 0.12
        reward_amount:
          type: string
          format: decimal
          description: Total amount of mining rewards for the month
          example: 0.0983
        working_hours:
          type: string
          format: decimal
          description: >-
            The total number of hours that the miner's devices worked for the
            month.
          example: 114.28
        wallet_addresses:
          type: array
          description: An array of wallet addresses used by miner to get payouts from pool.
          items:
            type: string
            example: 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5
    MiningReportPool:
      type: object
      required:
        - domain
        - wallet_addresses
      properties:
        domain:
          type: string
          format: uri
          description: Pool's domain name
          example: https://pool.headframe.io
        wallet_addresses:
          type: object
          properties:
            input:
              type: array
              description: List of addresses used by the pool to receive mining profit
              items:
                type: string
                example: 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5
            output:
              type: array
              description: List of addresses used by the pool to payout miner's profit
              items:
                type: string
                example: 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5
    MiningReport:
      type: object
      required:
        - miner
        - pool
      properties:
        miner:
          $ref: '#/components/schemas/MiningReportMiner'
        pool:
          $ref: '#/components/schemas/MiningReportPool'
    PoolAddress:
      type: object
      required:
        - type
        - address
      properties:
        type:
          type: string
          enum:
            - app
            - api
            - auth
            - stratum
        address:
          type: string
          format: uri
          example: https://pool.headframe.io
    Language:
      type: string
      example: en
      enum:
        - en
        - ru
    PoolSettings:
      type: object
      required:
        - default_language
        - available_languages
      properties:
        default_language:
          $ref: '#/components/schemas/Language'
        available_languages:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Language'
    PoolPublicModel:
      type: object
      required:
        - id
        - status
        - title
        - addresses
        - settings
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - active
            - inactive
        title:
          type: string
          example: Demo Pool
        addresses:
          type: array
          description: >-
            At minimum, we should receive address for application, API and
            stratum connection
          items:
            $ref: '#/components/schemas/PoolAddress'
        settings:
          $ref: '#/components/schemas/PoolSettings'
    PoolPrivateModel:
      allOf:
        - $ref: '#/components/schemas/PoolPublicModel'
        - type: object
          required:
            - wallets
          properties:
            wallets:
              type: array
              items:
                format: uuid
                type: string
    PoolAccessRole:
      type: string
      enum:
        - admin
        - viewer
    PoolAccess:
      type: object
      required:
        - user
        - roles
      properties:
        user:
          $ref: '#/components/schemas/UserAccessModel'
        roles:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/PoolAccessRole'
    CommonChartData:
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        interval:
          type: string
          format: duration
          example: PT1M
    DataPoint:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
          example: 1663848000
        hashrate:
          $ref: '#/components/schemas/HashRate'
        rejectrate:
          $ref: '#/components/schemas/RejectRate'
    ChartDataPoints:
      type: object
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/DataPoint'
        status:
          type: string
          enum:
            - ok
            - collecting
            - unavailable
            - stale
            - nodata
          description: >
            Status represents the result of collecting points for the selected
            device.

            - ok: the device works normally, there are points.

            - collecting: the device is recently connected, there are no points
            yet, but they will appear soon.

            - unavailable: the device is temporarily disconnected, all points
            show 0 values.

            - stale: the device has not worked and does not send data for a long
            time, there are no points.

            - nodata: the device has never sent points.
    SingleChart:
      type: object
      allOf:
        - $ref: '#/components/schemas/CommonChartData'
        - properties:
            data:
              $ref: '#/components/schemas/ChartDataPoints'
    OperatorSettings:
      type: object
      required:
        - default_pool_fee_for_customer
      properties:
        default_pool_fee_for_customer:
          $ref: '#/components/schemas/FlatRateValue'
    OperatorFullModel:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
          example: Pool operator
        status:
          type: string
          enum:
            - active
            - inactive
        wallets:
          type: array
          items:
            format: uuid
            type: string
        owner:
          $ref: '#/components/schemas/User'
        settings:
          $ref: '#/components/schemas/OperatorSettings'
    OperatorPoolModel:
      allOf:
        - $ref: '#/components/schemas/OperatorFullModel'
        - type: object
          required:
            - workers
            - miners
          properties:
            workers:
              type: object
              properties:
                count:
                  type: number
                  format: int64
                statuses:
                  $ref: '#/components/schemas/WorkerStatusesStats'
            miners:
              type: object
              properties:
                count:
                  type: number
                  format: int64
    ListOfOperatorPoolModels:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/OperatorPoolModel'
        pagination:
          $ref: '#/components/schemas/_pagination'
    MinerPoolModel:
      allOf:
        - $ref: '#/components/schemas/MinerFullModel'
        - type: object
          required:
            - pool
            - workers
          properties:
            pool:
              type: object
              required:
                - id
                - current_plan
              properties:
                id:
                  type: string
                  format: uuid
                current_plan:
                  $ref: '#/components/schemas/FlatRateValue'
            operator:
              type: object
              required:
                - id
                - current_plan
              properties:
                id:
                  type: string
                  format: uuid
                current_plan:
                  $ref: '#/components/schemas/FlatRateValue'
            workers:
              type: object
              required:
                - count
                - statuses
              properties:
                count:
                  type: number
                  format: int64
                statuses:
                  $ref: '#/components/schemas/WorkerStatusesStats'
    ListOfMinerPoolModels:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MinerPoolModel'
        pagination:
          $ref: '#/components/schemas/_pagination'
    UserShortModel:
      type: object
      required:
        - id
        - status
        - email
        - registered_at
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - active
            - pending
            - inactive
        email:
          type: object
          required:
            - value
            - masked
          properties:
            value:
              type: string
              format: email
            masked:
              type: boolean
            verified:
              type: boolean
        registered_at:
          type: string
          format: date-time
    ListOfUsersShortModels:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          items:
            $ref: '#/components/schemas/UserShortModel'
        pagination:
          $ref: '#/components/schemas/_pagination'
    UserFullModel:
      type: object
      allOf:
        - $ref: '#/components/schemas/UserShortModel'
        - type: object
          required:
            - credentials
            - language
          properties:
            language:
              $ref: '#/components/schemas/Language'
            credentials:
              type: object
              required:
                - totp
                - lookup_secret
              properties:
                totp:
                  type: boolean
                lookup_secret:
                  type: boolean
    IdentityDeletionRequest:
      type: object
      required:
        - user_id
        - created_at
        - created_by
      properties:
        user_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
    UserSession:
      type: object
      required:
        - id
        - active
        - expires_at
        - authenticated_at
        - authenticator_assurance_level
        - issued_at
        - devices
      properties:
        id:
          type: string
          format: uuid
        active:
          type: boolean
        expires_at:
          type: string
          format: date-time
        authenticated_at:
          type: string
          format: date-time
        authenticator_assurance_level:
          type: string
          enum:
            - aal0
            - aal1
            - aal2
            - aal3
        issued_at:
          type: string
          format: date-time
        devices:
          type: array
          items:
            type: object
            required:
              - id
              - ip_address
              - user_agent
              - location
            properties:
              id:
                type: string
                format: uuid
              ip_address:
                type: string
                format: ipv4|ipv6
                example: 9da1:d882:b78c:fdad:4aae:47d3:3254:142a
              user_agent:
                type: string
                example: >-
                  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
                  (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3
              location:
                type: string
                example: Tbilisi, GE
    ListOfUserSessions:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          items:
            $ref: '#/components/schemas/UserSession'
        pagination:
          $ref: '#/components/schemas/_pagination'
    UserInvite:
      type: object
      required:
        - user_id
        - code
        - created_at
        - valid_until
        - status
      properties:
        user_id:
          type: string
          format: uuid
        code:
          type: string
          example: 22728fe186490f2d5ae0849e77e157fd29424f5f5f2bf1b7cb66f1ce00d0dfcb
        created_at:
          type: string
          format: date-time
        valid_until:
          type: string
          format: date-time
        activated_at:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - pending
            - activated
            - expired
    ListOfUserInvites:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          items:
            $ref: '#/components/schemas/UserInvite'
        pagination:
          $ref: '#/components/schemas/_pagination'
    MinerPermissionWithRoles:
      type: object
      required:
        - id
        - type
        - account_name
        - roles
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - miner
        account_name:
          $ref: '#/components/schemas/AccountName'
        roles:
          type: array
          items:
            type: string
            enum:
              - owner
              - admin
              - viewer
              - accountant
    OperatorPermissionWithRoles:
      type: object
      required:
        - id
        - type
        - operator_name
        - roles
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - operator
        operator_name:
          type: string
          example: I'm the Operator with my Pocket Calculator!
        roles:
          type: array
          items:
            type: string
            enum:
              - owner
              - admin
              - viewer
              - accountant
              - treasurer
    PoolPermissionWithRoles:
      type: object
      required:
        - id
        - type
        - pool_name
        - roles
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - pool
        pool_name:
          type: string
          example: The Best Pool
        roles:
          type: array
          items:
            type: string
            enum:
              - owner
              - admin
              - viewer
              - moderator
              - moderator_editor
    ListOfUserPermissions:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/MinerPermissionWithRoles'
              - $ref: '#/components/schemas/OperatorPermissionWithRoles'
              - $ref: '#/components/schemas/PoolPermissionWithRoles'
    OperatorAccessRole:
      type: string
      enum:
        - admin
        - viewer
        - accountant
        - treasurer
    OperatorAccess:
      type: object
      required:
        - user
        - roles
      properties:
        user:
          $ref: '#/components/schemas/UserAccessModel'
        roles:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/OperatorAccessRole'
    WalletAddress:
      type: object
      required:
        - address
        - currency
        - network
      properties:
        address:
          type: string
          example: 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5
        currency:
          type: string
          enum:
            - BTC
        network:
          type: string
          enum:
            - mainnet
            - testnet
        valid_from:
          type: string
          format: date-time
        valid_until:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    CurrentAndFutureWalletAddress:
      type: object
      required:
        - current
      properties:
        current:
          $ref: '#/components/schemas/WalletAddress'
        future:
          $ref: '#/components/schemas/WalletAddress'
    ListOfWalletAddresses:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 10
          items:
            $ref: '#/components/schemas/WalletAddress'
    WalletMinPayment:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: string
          format: decimal
          description: Minimal value is 0.001.
          example: 0.01
        currency:
          type: string
          enum:
            - BTC
        valid_from:
          type: string
          format: date-time
        valid_until:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    CurrentAndFutureWalletMinPayment:
      type: object
      required:
        - current
      properties:
        current:
          $ref: '#/components/schemas/WalletMinPayment'
        future:
          $ref: '#/components/schemas/WalletMinPayment'
    ListOfWalletMinPayments:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 10
          items:
            $ref: '#/components/schemas/WalletMinPayment'
    WalletMaxPayment:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: string
          format: decimal
          description: Maximal value.
          nullable: true
          example: 100
        currency:
          type: string
          enum:
            - BTC
        valid_from:
          type: string
          format: date-time
        valid_until:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ListOfWalletMaxPayments:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 10
          items:
            $ref: '#/components/schemas/WalletMaxPayment'
    MultipleCharts:
      type: object
      allOf:
        - $ref: '#/components/schemas/CommonChartData'
        - properties:
            data:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/ChartDataPoints'
              example:
                f6e3e748-16c6-4235-a5bb-d948b9638c6e:
                  status: ok
                  points:
                    - timestamp: 1663848000
                      hashrate: '100000000000000.00'
                      rejectrate: '1048576.00'
                    - timestamp: 1663848000
                      hashrate: '100000000000000.00'
                      rejectrate: '1048576.00'
                0e4ce810-6107-4eb0-a71c-53046e396aa3:
                  status: ok
                  points:
                    - timestamp: 1663848000
                      hashrate: '100000000000000.00'
                      rejectrate: '1048576.00'
                    - timestamp: 1663848000
                      hashrate: '100000000000000.00'
                      rejectrate: '1048576.00'
    MultipleMiningStats:
      type: object
      example:
        f6e3e748-16c6-4235-a5bb-d948b9638c6e:
          15m:
            hashrate: '90697492495655'
            rejectrate: '0'
          1h:
            hashrate: '90697492495655'
            rejectrate: '0'
          1d:
            hashrate: '90697492495655'
            rejectrate: '0'
          1w:
            hashrate: '90697492495655'
            rejectrate: '0'
        0e4ce810-6107-4eb0-a71c-53046e396aa3:
          15m:
            hashrate: '90697492495655'
            rejectrate: '0'
          1h:
            hashrate: '90697492495655'
            rejectrate: '0'
          1d:
            hashrate: '90697492495655'
            rejectrate: '0'
          1w:
            hashrate: '90697492495655'
            rejectrate: '0'
      description: Entity ID
      additionalProperties:
        $ref: '#/components/schemas/MiningStats'
    ListOfMinersStatuses:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: object
          description: Map of miner IDs to their worker status statistics
          additionalProperties:
            $ref: '#/components/schemas/WorkerStatusesStats'
          example:
            00000000-0002-0005-0000-000000000001:
              stable: 150
              'off': 1
              unavailable: 5
              removed: 0
            00000000-0002-0005-0000-000000000002:
              stable: 200
              'off': 0
              unavailable: 0
              removed: 2
        pagination:
          $ref: '#/components/schemas/_pagination'
    UserStatus:
      type: string
      enum:
        - active
        - pending
        - inactive
    PlatformPermission:
      type: object
      required:
        - type
        - platform_name
      properties:
        type:
          type: string
          enum:
            - platform
        id:
          type: string
          enum:
            - headframe
    PoolPermission:
      type: object
      required:
        - id
        - type
        - pool_name
        - access
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - pool
        pool_name:
          type: string
          example: The Best Pool
        access:
          type: array
          items:
            type: string
            enum:
              - section_permissions_read
    OperatorPermission:
      type: object
      required:
        - id
        - type
        - operator_name
        - access
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - operator
        operator_name:
          type: string
          example: I'm the Operator with my Pocket Calculator!
        access:
          type: array
          items:
            type: string
            enum:
              - section_payments_read
              - section_workers_read
              - section_permissions_read
    MinerPermission:
      type: object
      required:
        - id
        - type
        - account_name
        - access
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - miner
        account_name:
          $ref: '#/components/schemas/AccountName'
        access:
          type: array
          items:
            type: string
            enum:
              - section_payments_read
              - section_workers_read
              - section_virtual_mining_read
              - section_referrals_read
              - section_permissions_read
    Identity:
      type: object
      properties:
        user:
          type: object
          properties:
            id:
              type: string
              format: uuid
              example: 432c99a8-a9c3-45d6-9963-08783e81630f
            status:
              $ref: '#/components/schemas/UserStatus'
            email:
              type: string
              format: email
              example: alice@headframe.io
            language:
              $ref: '#/components/schemas/Language'
        verification:
          type: object
          properties:
            intercom:
              description: Intercom Identity Verification token, based on User ID
              type: string
              example: bd20ce4799fe8a181a019a3c1f0d28e18d087e8643e64541a0ba9e879e72554b
        credentials:
          type: object
          properties:
            totp:
              type: boolean
              example: false
            lookup_secret:
              type: boolean
              example: false
        permissions:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PlatformPermission'
              - $ref: '#/components/schemas/PoolPermission'
              - $ref: '#/components/schemas/OperatorPermission'
              - $ref: '#/components/schemas/MinerPermission'
    NavigationItem:
      type: object
      required:
        - id
        - type
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        type:
          type: string
          enum:
            - miner
            - operator
            - pool
            - watcher
    WatcherToken:
      type: string
      example: hfwl_0123456789abcdef000000000000000000000000000000000000000000000000
    TelegramBot:
      type: object
      required:
        - username
        - first_name
      properties:
        username:
          type: string
          example: TheBestPoolBot
          description: >-
            The bot username can be used to create bot link, like this:
            https://t.me/TheBestPoolBot
        first_name:
          type: string
          example: The Best Pool Bot
          description: The bot display name as seen in the Telegram UI
    TelegramInvite:
      type: object
      required:
        - bot
        - invite
      properties:
        bot:
          $ref: '#/components/schemas/TelegramBot'
        invite:
          type: object
          required:
            - code
            - valid_until
          properties:
            code:
              type: string
              example: RH409be7cdvscY4Pu5UUVDNY
            valid_until:
              type: string
              format: date-time
            created_at:
              type: string
              format: date-time
            activated_at:
              type: string
              format: date-time
    TelegramChat:
      type: object
      required:
        - bot
        - chat
      properties:
        bot:
          $ref: '#/components/schemas/TelegramBot'
        chat:
          type: object
          required:
            - id
          properties:
            id:
              type: number
            user:
              type: object
              required:
                - id
                - first_name
                - language_code
                - is_premium
              properties:
                id:
                  type: number
                username:
                  type: string
                  example: johnny_appleseed
                first_name:
                  type: string
                  example: Johnny
                last_name:
                  type: string
                  example: Appleseed
                language_code:
                  type: string
                  example: en
                is_premium:
                  type: boolean
    NotificationPreferenceItem:
      type: object
      required:
        - enabled
        - readonly
      properties:
        enabled:
          type: boolean
        readonly:
          type: boolean
          default: false
    NotificationsPreferences:
      type: object
      required:
        - email
        - telegram
      properties:
        email:
          type: object
          required:
            - delete-miner
            - miner-payout
            - miner-reward
            - miner-wallet-address-changed
            - miner-wallet-minpay-changed
            - user-login
          properties:
            delete-miner:
              $ref: '#/components/schemas/NotificationPreferenceItem'
            miner-payout:
              $ref: '#/components/schemas/NotificationPreferenceItem'
            miner-reward:
              $ref: '#/components/schemas/NotificationPreferenceItem'
            miner-wallet-address-changed:
              $ref: '#/components/schemas/NotificationPreferenceItem'
            miner-wallet-minpay-changed:
              $ref: '#/components/schemas/NotificationPreferenceItem'
            user-login:
              $ref: '#/components/schemas/NotificationPreferenceItem'
        telegram:
          type: object
          required:
            - worker-status-changed
          properties:
            worker-status-changed:
              $ref: '#/components/schemas/NotificationPreferenceItem'
    NotificationPreferenceUpdateItem:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
    UpdateNotificationsPreferences:
      type: object
      required:
        - email
        - telegram
      properties:
        email:
          type: object
          required:
            - miner-payout
            - miner-reward
          properties:
            miner-payout:
              $ref: '#/components/schemas/NotificationPreferenceUpdateItem'
            miner-reward:
              $ref: '#/components/schemas/NotificationPreferenceUpdateItem'
        telegram:
          type: object
          required:
            - worker-status-changed
          properties:
            worker-status-changed:
              $ref: '#/components/schemas/NotificationPreferenceUpdateItem'
    InviteAcceptance:
      type: object
      properties:
        code:
          type: string
          example: 9fd9e1dcfc6dedfaa81c3ba4898366a8e06128a75efb9c62dfe147029831914c
        email:
          type: string
          format: email
          example: miner@pool.io
    RedirectionLink:
      type: object
      properties:
        address:
          type: string
          format: uri
          example: https://auth.pool.io/ui/self-service?id=123456789
    Watcher:
      type: object
      required:
        - id
        - token
        - title
      properties:
        id:
          type: string
          format: uuid
          example: 432c99a8-a9c3-45d6-9963-08783e81630f
        token:
          $ref: '#/components/schemas/WatcherToken'
        title:
          type: string
          example: Watcher for LLC 'Super Miner'
        created_at:
          type: string
          format: date-time
        extra_permissions:
          type: array
          items:
            type: string
            enum:
              - accountant
    ListOfWatchers:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Watcher'
        pagination:
          $ref: '#/components/schemas/_pagination'
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/InvalidInputError'
              - $ref: '#/components/schemas/ValidationError'
              - $ref: '#/components/schemas/InvalidFormError'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/AuthenticationRequiredError'
              - $ref: '#/components/schemas/APIKeyExpiredError'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/AccessDeniedError'
              - $ref: '#/components/schemas/MFARequiredError'
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundError'
    '409':
      description: Conflict
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ConflictError'
    '429':
      description: Too many requests
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
    '500':
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalError'
  headers:
    X-RateLimit-Limit:
      description: The maximum number of requests allowed with a time period
      schema:
        type: integer
      example: 100
    X-RateLimit-Remaining:
      description: The number of remaining requests in the current time period
      schema:
        type: integer
      example: 94
    X-RateLimit-Reset:
      description: >-
        The number of seconds to wait in order to get the maximum number of
        allowed requests
      schema:
        type: integer
      example: 50
    Retry-After:
      description: >-
        The date in RFC1123 format that indicate when a client should retry
        requests (when the rate limit expires)
      schema:
        type: string
        format: date
      example: Mon, 02 Jan 2006 15:04:05 MST
    Payments-Export-Content-Disposition:
      schema:
        type: string
      example: >-
        attachment; filename="payments_report_2023-01-01 00:00:00_2023-01-30
        00:00:00.csv"
