### API Request for Undelegation

#### Parameters

- **network**: string (required)  
  Osmosis network to build transaction for  
  Allowed: `testnet`, `mainnet`

- **delegator_address**: string (required)  
  The address of the delegator

- **validator_address**: string (required)  
  The address of the validator

- **amount**: string (required)  
  Amount to undelegate

- **pubkey**: string  
  Public key of the delegator

- **pubkey_type**: string (enum)  
  Type of public key of the delegator.  
  Allowed: `secp256k1`, `multisig`

- **gas_limit**: string  
  Gas limit for the transaction. Required if pubkey type is multisig.

- **gas_price**: string  
  Gas price for the transaction. Required if pubkey type is multisig.

#### Response Codes

- **201**: Undelegate transaction created
- **400**: Bad request
- **422**: Unprocessable entity

### Example CURL Request

```bash
curl --request POST \
     --url https://api.figment.io/osmosis/undelegate \
     --header 'content-type: application/json' \
     --header 'x-api-key: your-api-key-here' \
     --data '
{
  "network": "testnet"
}
'```
