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

# Create Undelegate Resource Request

> Create an unsigned UnDelegateResource transaction to reclaim delegated ENERGY after the lock period.



## OpenAPI

````yaml POST /api/v1/tron/{network}/staking/undelegate-resource
openapi: 3.0.0
info:
  title: Staking API
  description: API used for staking
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.p2p.org/api
security:
  - bearer: []
tags:
  - name: Aptos
    description: Aptos staking operations (stake, unstake, withdraw, claim).
  - name: Celestia
    description: Celestia staking operations (stake, unstake, redelegate, claim).
  - name: Cosmos
    description: Cosmos Hub staking operations (stake, unstake, redelegate, claim).
  - name: EigenLayer
    description: EigenLayer restaking operations.
  - name: Ethereum
    description: Ethereum staking operations (direct, SSV, pooled).
  - name: Hyperliquid
    description: Hyperliquid staking operations.
  - name: Monad
    description: Monad staking operations (delegate, undelegate, withdraw).
  - name: P2P SSV
    description: P2P-managed SSV validator operations (deposit, claim, withdraw).
  - name: Polkadot
    description: Polkadot staking and nomination pool operations.
  - name: Polygon
    description: Polygon staking operations.
  - name: Pooled Staking
    description: Pooled staking vault operations (deposit, unstake, withdraw).
  - name: Sei
    description: Sei staking operations (stake, unstake, redelegate, claim).
  - name: Solana
    description: Solana staking operations (stake, split, merge, deactivate, withdraw).
  - name: SSV
    description: SSV network validator operations.
  - name: Story
    description: Story network staking operations.
  - name: Sui
    description: Sui staking operations.
  - name: TON
    description: TON staking operations (single nominator, whales pool).
  - name: TRON
    description: TRON staking operations (freeze, delegate, vote, withdraw).
  - name: Unified
    description: Unified multi-chain staking interface.
paths:
  /api/v1/tron/{network}/staking/undelegate-resource:
    post:
      tags:
        - TRON
      summary: Create Undelegate Resource Request
      description: >-
        Create an unsigned UnDelegateResource transaction to reclaim delegated
        ENERGY after the lock period.
      operationId: tron-staking-undelegate-resource
      parameters:
        - name: network
          required: true
          in: path
          description: >-
            <p>TRON network:</p><ul><li>`mainnet` — TRON
            mainnet.</li><li>`testnet-nile` — TRON testnet.</li></ul>
          schema:
            enum:
              - mainnet
              - testnet-nile
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TronUndelegateResourceRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      result:
                        $ref: '#/components/schemas/TronUndelegateResourceResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionResponse'
                  - type: object
                    properties:
                      error:
                        oneOf:
                          - $ref: >-
                              #/components/schemas/TronInvalidDelegatorAddressException
                          - $ref: '#/components/schemas/TronInvalidReceiverException'
                          - $ref: >-
                              #/components/schemas/TronInvalidUnfreezeAmountException
                          - $ref: >-
                              #/components/schemas/TronResourceNotSupportedException
                          - $ref: >-
                              #/components/schemas/TronNoActiveDelegationException
                          - $ref: >-
                              #/components/schemas/TronExceedsDelegatedAmountException
                          - $ref: '#/components/schemas/TronDelegationLockedException'
                          - $ref: >-
                              #/components/schemas/TronUndelegateResourceTransactionException
              examples:
                InvalidDelegatorAddressException:
                  value:
                    error:
                      code: 125102
                      message: >-
                        Invalid delegator address provided. Please ensure the
                        address is a valid TRON address format.
                      name: InvalidDelegatorAddressException
                      type: client
                    result: null
                InvalidReceiverException:
                  value:
                    error:
                      code: 125123
                      message: >-
                        Invalid receiver address. The receiver must be a valid
                        TRON address and must differ from the owner address.
                      name: InvalidReceiverException
                      type: client
                    result: null
                InvalidUnfreezeAmountException:
                  value:
                    error:
                      code: 125105
                      message: >-
                        Unfreeze amount exceeds the available frozen balance or
                        is invalid. Please verify the account’s frozen amount.
                      name: InvalidUnfreezeAmountException
                      type: client
                    result: null
                ResourceNotSupportedException:
                  value:
                    error:
                      code: 125125
                      message: >-
                        Resource type is not supported. Only ENERGY delegation
                        is available.
                      name: ResourceNotSupportedException
                      type: client
                    result: null
                NoActiveDelegationException:
                  value:
                    error:
                      code: 125126
                      message: >-
                        No active ENERGY delegation found for this account.
                        There is nothing to undelegate.
                      name: NoActiveDelegationException
                      type: client
                    result: null
                ExceedsDelegatedAmountException:
                  value:
                    error:
                      code: 125127
                      message: >-
                        Undelegation amount exceeds the currently delegated
                        ENERGY balance. Please reduce the amount.
                      name: ExceedsDelegatedAmountException
                      type: client
                    result: null
                DelegationLockedException:
                  value:
                    error:
                      code: 125128
                      message: >-
                        Delegation is still locked and cannot be undelegated
                        until the lock period expires.
                      name: DelegationLockedException
                      type: client
                    result: null
                UndelegateResourceTransactionException:
                  value:
                    error:
                      code: 125122
                      message: >-
                        Failed to create the resource undelegation transaction.
                        Locked delegations can only be undelegated after the
                        lock period expires.
                      name: UndelegateResourceTransactionException
                      type: client
                    result: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionResponse'
                  - type: object
                    properties:
                      error:
                        oneOf:
                          - $ref: '#/components/schemas/AuthNoTokenException'
                          - $ref: '#/components/schemas/AuthWrongTokenException'
              examples:
                NoTokenException:
                  value:
                    error:
                      code: 101111
                      message: >-
                        No Bearer token has been provided. To obtain an
                        authentication token, follow the instructions at
                        https://docs.p2p.org/docs/authentication.
                      name: NoTokenException
                      type: authentication
                    result: null
                WrongTokenException:
                  value:
                    error:
                      code: 101109
                      message: >-
                        An invalid Bearer token has been provided. Please
                        specify the correct authentication token.
                      name: WrongTokenException
                      type: authentication
                    result: null
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - bearer: []
components:
  schemas:
    TronUndelegateResourceRequest:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: Amount of resource to delegate, in SUN (1 TRX = 10⁶ SUN).
          example: 10000000
          nullable: false
        delegatorAddress:
          type: string
          format: tron-address
          description: Owner (delegator) account address.
          example: TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r
          nullable: false
        resource:
          type: string
          enum:
            - ENERGY
          description: >-
            Resource type to delegate. Only `ENERGY` is supported in the current
            version.
          example: ENERGY
          default: ENERGY
      required:
        - amount
        - delegatorAddress
    SuccessResponse:
      type: object
      properties:
        error:
          type: object
          nullable: true
          default: null
          description: Error object. Always null on successful responses.
        result:
          type: object
          description: Response payload containing the requested data.
      description: Standard API success response envelope wrapping the result payload.
      required:
        - error
        - result
    TronUndelegateResourceResponse:
      type: object
      properties:
        delegatorAddress:
          type: string
          format: tron-address
          description: Owner (delegator) account address.
          example: TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r
          nullable: false
        receiverAddress:
          type: string
          format: tron-address
          description: Receiver (resource pool) account address.
          example: TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r
          nullable: false
        amount:
          type: integer
          format: int64
          description: Amount of resource undelegated, in SUN (1 TRX = 10⁶ SUN).
          example: 10000000
          nullable: false
        resource:
          type: string
          enum:
            - ENERGY
          description: Resource type undelegated.
          example: ENERGY
        unsignedTransaction:
          type: object
          description: Original unsigned transaction object returned by tronWeb.
          additionalProperties: false
        unsignedTransactionSerialized:
          type: string
          description: Unsigned serialized transaction in Base64 format ready for signing.
          example: eyJ0eElEIjoidHJ4SWQifQ==
        createdAt:
          type: string
          description: Timestamp of the transaction in the ISO 8601 format.
          example: '2025-06-03T12:00:00.000Z'
          readOnly: true
      required:
        - delegatorAddress
        - receiverAddress
        - amount
        - resource
        - unsignedTransaction
        - unsignedTransactionSerialized
        - createdAt
    ExceptionResponse:
      type: object
      properties:
        error:
          type: object
          description: Error object containing exception details. Null on success.
        result:
          type: object
          nullable: true
          default: null
          description: Result payload. Always null on error responses.
        requestId:
          type: string
          description: >-
            Identifier of the request (the `x-request-id` header). Quote this
            value to correlate the response with server logs.
          example: 90c16e9e-6e99-4651-a033-60290356df2f
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the error response was generated.
          example: '2026-05-20T22:29:03.126Z'
      description: Standard API error response envelope wrapping the exception details.
      required:
        - error
        - result
        - timestamp
    TronInvalidDelegatorAddressException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125102
          example: 125102
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Invalid delegator address provided. Please ensure the address is a
            valid TRON address format.
          example: >-
            Invalid delegator address provided. Please ensure the address is a
            valid TRON address format.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: InvalidDelegatorAddressException
          example: InvalidDelegatorAddressException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronInvalidReceiverException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125123
          example: 125123
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Invalid receiver address. The receiver must be a valid TRON address
            and must differ from the owner address.
          example: >-
            Invalid receiver address. The receiver must be a valid TRON address
            and must differ from the owner address.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: InvalidReceiverException
          example: InvalidReceiverException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronInvalidUnfreezeAmountException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125105
          example: 125105
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Unfreeze amount exceeds the available frozen balance or is invalid.
            Please verify the account’s frozen amount.
          example: >-
            Unfreeze amount exceeds the available frozen balance or is invalid.
            Please verify the account’s frozen amount.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: InvalidUnfreezeAmountException
          example: InvalidUnfreezeAmountException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronResourceNotSupportedException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125125
          example: 125125
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: Resource type is not supported. Only ENERGY delegation is available.
          example: Resource type is not supported. Only ENERGY delegation is available.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: ResourceNotSupportedException
          example: ResourceNotSupportedException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronNoActiveDelegationException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125126
          example: 125126
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            No active ENERGY delegation found for this account. There is nothing
            to undelegate.
          example: >-
            No active ENERGY delegation found for this account. There is nothing
            to undelegate.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: NoActiveDelegationException
          example: NoActiveDelegationException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronExceedsDelegatedAmountException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125127
          example: 125127
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Undelegation amount exceeds the currently delegated ENERGY balance.
            Please reduce the amount.
          example: >-
            Undelegation amount exceeds the currently delegated ENERGY balance.
            Please reduce the amount.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: ExceedsDelegatedAmountException
          example: ExceedsDelegatedAmountException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronDelegationLockedException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125128
          example: 125128
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Delegation is still locked and cannot be undelegated until the lock
            period expires.
          example: >-
            Delegation is still locked and cannot be undelegated until the lock
            period expires.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: DelegationLockedException
          example: DelegationLockedException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    TronUndelegateResourceTransactionException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 125122
          example: 125122
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Failed to create the resource undelegation transaction. Locked
            delegations can only be undelegated after the lock period expires.
          example: >-
            Failed to create the resource undelegation transaction. Locked
            delegations can only be undelegated after the lock period expires.
          description: Human-readable error message describing what went wrong.
        errors:
          description: Validation error details when applicable.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponse'
        name:
          type: string
          default: UndelegateResourceTransactionException
          example: UndelegateResourceTransactionException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - errors
        - name
    AuthNoTokenException:
      type: object
      properties:
        type:
          type: string
          default: authentication
          example: authentication
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 101111
          example: 101111
          description: Numeric error code identifying the exception type.
        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.
          example: >-
            No Bearer token has been provided. To obtain an authentication
            token, follow the instructions at
            https://docs.p2p.org/docs/authentication.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: NoTokenException
          example: NoTokenException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    AuthWrongTokenException:
      type: object
      properties:
        type:
          type: string
          default: authentication
          example: authentication
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 101109
          example: 101109
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            An invalid Bearer token has been provided. Please specify the
            correct authentication token.
          example: >-
            An invalid Bearer token has been provided. Please specify the
            correct authentication token.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: WrongTokenException
          example: WrongTokenException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    ValidationErrorResponse:
      type: object
      properties:
        property:
          type: string
          description: Name of the property that failed validation.
        constraints:
          type: object
          additionalProperties:
            type: string
          description: Validation constraint details describing what was expected.
      required:
        - property
        - constraints
  responses:
    TooManyRequests:
      description: >-
        Too Many Requests — the client exceeded its rate limit. The response
        advertises when to retry and the active quota via headers.
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          schema:
            type: integer
            example: 60
        RateLimit-Limit:
          description: >-
            The request quota (maximum number of requests) for the most
            restrictive applicable window.
          schema:
            type: integer
            example: 120
        RateLimit-Reset:
          description: >-
            Number of seconds until the rate-limit window resets and requests
            are accepted again.
          schema:
            type: integer
            example: 60
        RateLimit-Policy:
          description: >-
            The active rate-limit policy as `<limit>;w=<window-seconds>`,
            comma-separated when multiple windows apply.
          schema:
            type: string
            example: 120;w=60
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: integer
                  name:
                    type: string
                    example: ThrottlerException
                  message:
                    type: string
                    example: ThrottlerException
                  errors:
                    type: array
                    nullable: true
                    items:
                      type: object
              result:
                type: object
                nullable: true
                example: null
              requestId:
                type: string
                description: >-
                  Identifier of the request (the `x-request-id` header). Quote
                  this value to correlate the response with server logs.
                example: 90c16e9e-6e99-4651-a033-60290356df2f
              timestamp:
                type: string
                format: date-time
                description: ISO 8601 timestamp of when the error response was generated.
                example: '2026-05-20T22:29:03.126Z'
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

## Related topics

- [Energy Delegation](/docs/energy-delegation.md)
- [Create Undelegate Request](/reference/tron-staking-undelegate.md)
