---
updatedAt: 2025-06-02T23:41:26.000Z
agentTools:
  projectIndex: https://docs.stake.fish/llms.txt
---

# /v1/generate-exit-messages

Generates an exit message for a specified validator using their indices. This message facilitates the process of exiting the validator directly, eliminating the need for intermediary stakefish services. This allows stakers to broadcast the message to the Ethereum network on their own.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Ethereum Staking API",
    "version": "1.0.0",
    "description": "This API facilitates the management of non-custodial Ethereum validators hosted by Stakefish. It equips users with essential tools and datapoints to manage a seamless staking experience at scale, supporting operations from keypair generation through to validator exit."
  },
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "API key required to authenticate the request, provided on the header in the format of `Authorization: <API key>`. Alternatively, this can be supplied as an `api_key` query parameter."
      }
    }
  },
  "paths": {
    "/v1/generate-exit-messages": {
      "post": {
        "tags": [
          "client staking"
        ],
        "description": "Generates an exit message for a specified validator using their indices. This message facilitates the process of exiting the validator directly, eliminating the need for intermediary stakefish services. This allows stakers to broadcast the message to the Ethereum network on their own.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "indices": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        },
                        {
                          "type": "integer"
                        }
                      ],
                      "description": "The index of the validator.",
                      "example": "123456"
                    },
                    "minItems": 1,
                    "maxItems": 100,
                    "example": [
                      1568943,
                      "2468221"
                    ],
                    "description": "The indices of the validator(s). Must be an array of integers (or strings representing them)"
                  },
                  "signature": {
                    "type": "string",
                    "pattern": "^(0x)?[0-9a-fA-F]*$",
                    "example": "0xac1af0450a0e512c1e610bfb98b92b17559fbd8aeffcda3d576f92d1b8d605780c15848a85a379c5cb54a7aa612c30c478f5150e1baf9fca66e795588c8f56181c",
                    "description": "The <a href=\"https://eips.ethereum.org/EIPS/eip-191\" target=\"_blank\">EIP-191</a> or the <a href=\"https://eip1271.io/\" target=\"_blank\">EIP-1271</a> signature of the message."
                  },
                  "message": {
                    "type": "string",
                    "example": "I confirm I request an exit message for validator(s) with indexes: 1609623 and my request is valid for 1 hr (2024-05-09 13:52:36 UTC).",
                    "description": "The message to be signed by the user. Proves intent to generate exit message and wallet ownership."
                  }
                },
                "required": [
                  "indices",
                  "signature",
                  "message"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the signed messages that are ready to be broadcasted to exit the validators. Each message must be broadcasted separately.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "signedExit": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "object",
                            "properties": {
                              "epoch": {
                                "type": "string",
                                "pattern": "^[0-9]+$",
                                "example": "123456",
                                "description": "The epoch number of the beacon chain."
                              },
                              "validator_index": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                  },
                                  {
                                    "type": "string"
                                  }
                                ],
                                "description": "The index of the validator.",
                                "example": "123456"
                              }
                            },
                            "required": [
                              "epoch",
                              "validator_index"
                            ]
                          },
                          "signature": {
                            "type": "string",
                            "pattern": "^0x",
                            "example": "0xac1af0450a0e512c1e610bfb98b92b17559fbd8aeffcda3d576f92d1b8d605780c15848a85a379c5cb54a7aa612c30c478f5150e1baf9fca66e795588c8f56181c",
                            "description": "The <a href=\"https://eips.ethereum.org/EIPS/eip-191\" target=\"_blank\">EIP-191</a> or the <a href=\"https://eip1271.io/\" target=\"_blank\">EIP-1271</a> signature of the message."
                          }
                        },
                        "required": [
                          "message",
                          "signature"
                        ]
                      },
                      "forkVersion": {
                        "type": "string",
                        "pattern": "^0x",
                        "minLength": 10,
                        "maxLength": 10,
                        "example": "0x30000000",
                        "description": "The fork version of the capella upgrade."
                      }
                    },
                    "required": [
                      "signedExit",
                      "forkVersion"
                    ]
                  },
                  "description": "Returns the signed messages that are ready to be broadcasted to exit the validators. Each message must be broadcasted separately."
                }
              }
            }
          },
          "400": {
            "description": "Returns an error object describing the payload validation issues.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Returns an error object describing the payload validation issues."
                },
                "example": {
                  "error": {
                    "issues": [
                      {
                        "code": "custom",
                        "message": "Invalid Ethereum address",
                        "path": [
                          "withdrawalCredentials"
                        ]
                      }
                    ],
                    "name": "ZodError"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Returns an error message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Returns an error message"
                },
                "example": {
                  "error": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Returns an error message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Returns an error message"
                },
                "examples": {
                  "example1": {
                    "value": {
                      "error": "Unauthorized"
                    }
                  },
                  "example2": {
                    "value": {
                      "error": "Setting custom fee recipient is not allowed"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "Internal Server Error"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.stake.fish/eth/stake"
    },
    {
      "url": "https://api.hoodi.stake.fish/eth/stake"
    }
  ],
  "tags": [
    {
      "name": "client staking",
      "description": "Endpoints which require an API key and a valid cryptographic signature to be included in the request payload."
    }
  ]
}
```