> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# /eth/v1/beacon/states/{state_id}/validators

> Get validators from state, with the validator IDs and statuses in the request body

Use POST instead of GET when you ask for many validators at once, because the IDs go in the request body instead of the URL.

```bash title="Mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl -X POST \
    "https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/head/validators" \
    -H "Content-Type: application/json" \
    -d '{"ids": ["1", "2"], "statuses": ["active_ongoing"]}'
```

```bash title="Testnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl -X POST \
    "https://sepolia.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/head/validators" \
    -H "Content-Type: application/json" \
    -d '{"ids": ["1", "2"], "statuses": ["active_ongoing"]}'
```


## OpenAPI

````yaml nodeapi/openapi/beacon-node-oapi-v4.json POST /eth/v1/beacon/states/{state_id}/validators
openapi: 3.1.0
info:
  title: Eth Beacon Node API
  version: v4.0.0 - Ethereum Proof-of-Stake Consensus Specification v1.5.0
  description: >-
    Subset of the Ethereum Beacon Node API v4.0.0 for routes added after the
    v2.3.0 spec used by the other beacon pages.
servers:
  - url: https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/
    description: Mainnet Beacon API
  - url: https://sepolia.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/
    description: Sepolia Beacon API
security: []
tags:
  - name: Beacon
    description: Set of endpoints to query beacon chain.
  - name: Config
    description: Endpoints to query chain configuration, specification, and fork schedules.
  - name: Debug
    description: Set of endpoints to debug chain and shouldn't be exposed publicly.
  - name: Node
    description: Endpoints to query node related information.
  - name: Validator
    description: Endpoints intended for validator clients.
  - name: ValidatorRequiredApi
    description: >
      Minimal set of endpoints to enable a working validator implementation.


      [Checkout validator flow](./validator-flow.md) to learn how to use this
      api.
  - name: Rewards
    description: Endpoints to query rewards and penalties for validators.
paths:
  /eth/v1/beacon/states/{state_id}/validators:
    post:
      tags:
        - Beacon
      summary: Get validators from state
      description: >
        Returns filterable list of validators with their balance, status and
        index.


        Information will be returned for all indices or public key that match
        known validators.  If an index or public key does not

        match any known validator, no information will be returned but this will
        not cause an error.  There are no guarantees for the

        returned data in terms of ordering; both the index and public key are
        returned for each validator, and can be used to confirm

        for which inputs a response has been returned.


        The POST variant of this endpoint has the same semantics as the GET
        endpoint but passes

        the lists of IDs and statuses via a POST body in order to enable larger
        requests.
      operationId: postStateValidators
      parameters:
        - name: state_id
          in: path
          required: true
          example: head
          schema:
            type: string
          description: >
            State identifier.

            Can be one of: "head" (canonical head in node's view), "genesis",
            "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x
            prefix\>.
      requestBody:
        description: >-
          The lists of validator IDs and statuses to filter on. Either or both
          may be `null` to signal that no filtering on that attribute is
          desired.
        required: true
        content:
          application/json:
            schema:
              type: object
              required: []
              properties:
                ids:
                  type: array
                  uniqueItems: true
                  description: >
                    An array of values, with each value either a hex encoded
                    public key (any bytes48 with 0x prefix) or a validator
                    index.


                    If the supplied list is empty (i.e. the value is `[]`) or
                    the property is omitted then all validators will be
                    returned.
                  items:
                    type: string
                statuses:
                  type: array
                  uniqueItems: true
                  description: >
                    An array of validator statuses to filter on.


                    If the supplied list is empty (i.e. the value is `[]`) or
                    the property is omitted then validators with all statuses
                    will be returned.
                  items:
                    oneOf:
                      - description: >
                          Possible statuses:

                          - **pending_initialized** - When the first deposit is
                          processed, but not enough funds are available (or not
                          yet the end of the first epoch) to get validator into
                          the activation queue.

                          - **pending_queued** - When validator is waiting to
                          get activated, and have enough funds etc. while in the
                          queue, validator activation epoch keeps changing until
                          it gets to the front and make it through (finalization
                          is a requirement here too).

                          - **active_ongoing** - When validator must be
                          attesting, and have not initiated any exit.

                          - **active_exiting** - When validator is still active,
                          but filed a voluntary request to exit.

                          - **active_slashed** - When validator is still active,
                          but have a slashed status and is scheduled to exit.

                          - **exited_unslashed** - When validator has reached
                          regular exit epoch, not being slashed, and doesn't
                          have to attest any more, but cannot withdraw yet.

                          - **exited_slashed** - When validator has reached
                          regular exit epoch, but was slashed, have to wait for
                          a longer withdrawal period.

                          - **withdrawal_possible** - After validator has
                          exited, a while later is permitted to move funds, and
                          is truly out of the system.

                          - **withdrawal_done** - (not possible in phase0,
                          except slashing full balance) - actually having moved
                          funds away


                          [Validator status
                          specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
                        enum:
                          - pending_initialized
                          - pending_queued
                          - active_ongoing
                          - active_exiting
                          - active_slashed
                          - exited_unslashed
                          - exited_slashed
                          - withdrawal_possible
                          - withdrawal_done
                        example: active_ongoing
                      - enum:
                          - active
                          - pending
                          - exited
                          - withdrawal
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                title: GetStateValidatorsResponse
                type: object
                required:
                  - execution_optimistic
                  - finalized
                  - data
                properties:
                  execution_optimistic:
                    type: boolean
                    example: false
                    description: >-
                      True if the response references an unverified execution
                      payload. Optimistic information may be invalidated at a
                      later time. If the field is not present, assume the False
                      value.
                  finalized:
                    type: boolean
                    example: false
                    description: >-
                      True if the response references the finalized history of
                      the chain, as determined by fork choice. If the field is
                      not present, additional calls are necessary to compare the
                      epoch of the requested information with the finalized
                      checkpoint.
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - index
                        - balance
                        - status
                        - validator
                      properties:
                        index:
                          type: string
                          example: '1'
                          description: Index of validator in validator registry.
                        balance:
                          description: Current validator balance in gwei.
                          type: string
                          example: '1'
                        status:
                          description: >
                            Possible statuses:

                            - **pending_initialized** - When the first deposit
                            is processed, but not enough funds are available (or
                            not yet the end of the first epoch) to get validator
                            into the activation queue.

                            - **pending_queued** - When validator is waiting to
                            get activated, and have enough funds etc. while in
                            the queue, validator activation epoch keeps changing
                            until it gets to the front and make it through
                            (finalization is a requirement here too).

                            - **active_ongoing** - When validator must be
                            attesting, and have not initiated any exit.

                            - **active_exiting** - When validator is still
                            active, but filed a voluntary request to exit.

                            - **active_slashed** - When validator is still
                            active, but have a slashed status and is scheduled
                            to exit.

                            - **exited_unslashed** - When validator has reached
                            regular exit epoch, not being slashed, and doesn't
                            have to attest any more, but cannot withdraw yet.

                            - **exited_slashed** - When validator has reached
                            regular exit epoch, but was slashed, have to wait
                            for a longer withdrawal period.

                            - **withdrawal_possible** - After validator has
                            exited, a while later is permitted to move funds,
                            and is truly out of the system.

                            - **withdrawal_done** - (not possible in phase0,
                            except slashing full balance) - actually having
                            moved funds away


                            [Validator status
                            specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
                          enum:
                            - pending_initialized
                            - pending_queued
                            - active_ongoing
                            - active_exiting
                            - active_slashed
                            - exited_unslashed
                            - exited_slashed
                            - withdrawal_possible
                            - withdrawal_done
                          example: active_ongoing
                        validator:
                          type: object
                          description: >-
                            The
                            [`Validator`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#validator)
                            object from the CL spec.
                          required:
                            - pubkey
                            - withdrawal_credentials
                            - effective_balance
                            - slashed
                            - activation_eligibility_epoch
                            - activation_epoch
                            - exit_epoch
                            - withdrawable_epoch
                          properties:
                            pubkey:
                              type: string
                              format: hex
                              pattern: ^0x[a-fA-F0-9]{96}$
                              description: >-
                                The validator's BLS public key, uniquely
                                identifying them. _48-bytes, hex encoded with 0x
                                prefix, case insensitive._
                              example: >-
                                0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a
                            withdrawal_credentials:
                              type: string
                              format: hex
                              example: >-
                                0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2
                              pattern: ^0x[a-fA-F0-9]{64}$
                              description: Root of withdrawal credentials
                            effective_balance:
                              description: Balance at stake in Gwei.
                              type: string
                              example: '1'
                            slashed:
                              type: boolean
                              example: false
                              description: Was validator slashed (not longer active).
                            activation_eligibility_epoch:
                              type: string
                              example: '1'
                              description: When criteria for activation were met.
                            activation_epoch:
                              type: string
                              example: '1'
                              description: >-
                                Epoch when validator activated.
                                'FAR_FUTURE_EPOCH' if not activated
                            exit_epoch:
                              type: string
                              example: '1'
                              description: >-
                                Epoch when validator exited. 'FAR_FUTURE_EPOCH'
                                if not exited.
                            withdrawable_epoch:
                              type: string
                              example: '1'
                              description: >-
                                When validator can withdraw or transfer funds.
                                'FAR_FUTURE_EPOCH' if not defined
        '400':
          description: Invalid state or validator ID, or status
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    description: >-
                      Either specific error code in case of invalid request or
                      http status code
                    type: number
                    example: 404
                  message:
                    description: Message describing error
                    type: string
                  stacktraces:
                    description: Optional stacktraces, sent when node is in debug mode
                    type: array
                    items:
                      type: string
              example:
                code: 400
                message: 'Invalid state ID: current'
        '404':
          description: State not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    description: >-
                      Either specific error code in case of invalid request or
                      http status code
                    type: number
                    example: 404
                  message:
                    description: Message describing error
                    type: string
                  stacktraces:
                    description: Optional stacktraces, sent when node is in debug mode
                    type: array
                    items:
                      type: string
              example:
                code: 404
                message: State not found
        '500':
          description: Beacon node internal error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    description: >-
                      Either specific error code in case of invalid request or
                      http status code
                    type: number
                    example: 404
                  message:
                    description: Message describing error
                    type: string
                  stacktraces:
                    description: Optional stacktraces, sent when node is in debug mode
                    type: array
                    items:
                      type: string
              example:
                code: 500
                message: Internal server error

````

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