# Undelegate HYPE tokens from Hyperbeat validator

## Undelegate HYPE tokens from P2P validator

> Undelegate HYPE tokens from P2P validator to stop earning staking rewards

```json
{"openapi":"3.0.0","info":{"title":"Staking API","version":"1.0.0"},"servers":[{"url":"https://api.p2p.org","description":"Staking API"},{"url":"https://api-test.p2p.org","description":"Testnet Staking API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"HyperLiquidStakingUndelegateRequestDto":{"type":"object","properties":{"amount":{"type":"number","description":"HYPE amount to undelegate","minimum":0.1,"maximum":9007199254740991},"delegatorAddress":{"type":"string","description":"Delegator Hyperliquid address"}},"required":["amount","delegatorAddress"]},"SuccessResponse":{"type":"object","properties":{"error":{"type":"object","nullable":true,"default":null},"result":{"type":"object"}},"required":["error","result"]},"HyperLiquidStakingUndelegateResponseDto":{"type":"object","properties":{"amount":{"type":"string","description":"Transaction amount"},"unsignedTransaction":{"type":"string","description":"Unsigned transaction data"},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"}},"required":["amount","unsignedTransaction","createdAt"]},"ExceptionResponse":{"type":"object","properties":{"error":{"type":"object"},"result":{"type":"object","nullable":true,"default":null}},"required":["error","result"]},"DelegationLockedException":{"type":"object","properties":{"code":{"type":"number","default":129110},"message":{"type":"string","default":"Delegation is locked. Total locked balance: 12."},"name":{"type":"string","default":"DelegationLockedException"}},"required":["code","message","name"]},"NotEnoughDelegatedBalanceException":{"type":"object","properties":{"code":{"type":"number","default":129111},"message":{"type":"string","default":"Not enough delegated balance. Current balance: 100, required amount: 500."},"name":{"type":"string","default":"NotEnoughDelegatedBalanceException"}},"required":["code","message","name"]},"ValidationException":{"type":"object","properties":{"code":{"type":"number","default":100101},"message":{"type":"string","default":"The data provided is not valid. Please check the request parameters and try again."},"name":{"type":"string","default":"ValidationException"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorResponse"}}},"required":["code","message","name","errors"]},"ValidationErrorResponse":{"type":"object","properties":{"property":{"type":"string"},"constraints":{"additionalProperties":{"type":"string"},"type":"array","items":{"type":"object"}}},"required":["property","constraints"]},"NoTokenException":{"type":"object","properties":{"code":{"type":"number","default":101111},"message":{"type":"string","default":"No Bearer token has been provided. To obtain an authentication token, follow the instructions at https://docs.p2p.org/docs/authentication."},"name":{"type":"string","default":"NoTokenException"}},"required":["code","message","name"]},"WrongTokenException":{"type":"object","properties":{"code":{"type":"number","default":101109},"message":{"type":"string","default":"An invalid Bearer token has been provided. Please specify the correct authentication token."},"name":{"type":"string","default":"WrongTokenException"}},"required":["code","message","name"]},"UndelegateUnexpectedException":{"type":"object","properties":{"code":{"type":"number","default":129105},"message":{"type":"string","default":"The undelegate operation could not be completed because an unexpected error occurred."},"name":{"type":"string","default":"UndelegateUnexpectedException"}},"required":["code","message","name"]},"TokenGuardException":{"type":"object","properties":{"code":{"type":"number","default":101110},"message":{"type":"string","default":"The request could not be performed because the server authorization error occurred."},"name":{"type":"string","default":"TokenGuardException"}},"required":["code","message","name"]}}},"paths":{"/api/v1/hyperliquid/{network}/staking/undelegate":{"post":{"operationId":"hyperliquid-undelegate","summary":"Undelegate HYPE tokens from P2P validator","description":"Undelegate HYPE tokens from P2P validator to stop earning staking rewards","parameters":[{"name":"network","required":true,"in":"path","description":"The Hyperliquid network to use","schema":{"enum":["mainnet","testnet"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HyperLiquidStakingUndelegateRequestDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"}],"properties":{"result":{"oneOf":[{"$ref":"#/components/schemas/HyperLiquidStakingUndelegateResponseDto"}]}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExceptionResponse"}],"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/DelegationLockedException"},{"$ref":"#/components/schemas/NotEnoughDelegatedBalanceException"},{"$ref":"#/components/schemas/ValidationException"}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExceptionResponse"}],"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/NoTokenException"},{"$ref":"#/components/schemas/WrongTokenException"}]}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExceptionResponse"}],"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/UndelegateUnexpectedException"},{"$ref":"#/components/schemas/TokenGuardException"}]}}}}}}},"tags":["Hyperliquid"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperbeat.org/hyperbeat-staking/staking-api/undelegate-hype-tokens-from-hyperbeat-validator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
