curl --request POST \
--url https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"providerId": "hyperliquid",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 3900,
"stopLossPrice": 3600,
"takeProfitPrice": 4400,
"orderId": "12345",
"orderIds": [
"<string>"
],
"assetIndex": 1,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "my-app",
"validUntil": 1767225600,
"stopLossOrderId": "12346",
"takeProfitOrderId": "12347",
"skipApproval": false,
"fundingMethod": "bridge2",
"enabled": true
}
}
'import requests
url = "https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions"
payload = {
"providerId": "hyperliquid",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 3900,
"stopLossPrice": 3600,
"takeProfitPrice": 4400,
"orderId": "12345",
"orderIds": ["<string>"],
"assetIndex": 1,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "my-app",
"validUntil": 1767225600,
"stopLossOrderId": "12346",
"takeProfitOrderId": "12347",
"skipApproval": False,
"fundingMethod": "bridge2",
"enabled": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providerId: 'hyperliquid',
address: '0x1234567890abcdef1234567890abcdef12345678',
action: 'open',
args: {
marketId: 'hyperliquid-eth-usdc',
side: 'long',
amount: '100',
size: '1000',
leverage: 10,
marginMode: 'isolated',
limitPrice: 3900,
stopLossPrice: 3600,
takeProfitPrice: 4400,
orderId: '12345',
orderIds: ['<string>'],
assetIndex: 1,
agentAddress: '0x1234567890abcdef1234567890abcdef12345678',
agentName: 'my-app',
validUntil: 1767225600,
stopLossOrderId: '12346',
takeProfitOrderId: '12347',
skipApproval: false,
fundingMethod: 'bridge2',
enabled: true
}
})
};
fetch('https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerId' => 'hyperliquid',
'address' => '0x1234567890abcdef1234567890abcdef12345678',
'action' => 'open',
'args' => [
'marketId' => 'hyperliquid-eth-usdc',
'side' => 'long',
'amount' => '100',
'size' => '1000',
'leverage' => 10,
'marginMode' => 'isolated',
'limitPrice' => 3900,
'stopLossPrice' => 3600,
'takeProfitPrice' => 4400,
'orderId' => '12345',
'orderIds' => [
'<string>'
],
'assetIndex' => 1,
'agentAddress' => '0x1234567890abcdef1234567890abcdef12345678',
'agentName' => 'my-app',
'validUntil' => 1767225600,
'stopLossOrderId' => '12346',
'takeProfitOrderId' => '12347',
'skipApproval' => false,
'fundingMethod' => 'bridge2',
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions"
payload := strings.NewReader("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 3900,\n \"stopLossPrice\": 3600,\n \"takeProfitPrice\": 4400,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"<string>\"\n ],\n \"assetIndex\": 1,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"my-app\",\n \"validUntil\": 1767225600,\n \"stopLossOrderId\": \"12346\",\n \"takeProfitOrderId\": \"12347\",\n \"skipApproval\": false,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 3900,\n \"stopLossPrice\": 3600,\n \"takeProfitPrice\": 4400,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"<string>\"\n ],\n \"assetIndex\": 1,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"my-app\",\n \"validUntil\": 1767225600,\n \"stopLossOrderId\": \"12346\",\n \"takeProfitOrderId\": \"12347\",\n \"skipApproval\": false,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 3900,\n \"stopLossPrice\": 3600,\n \"takeProfitPrice\": 4400,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"<string>\"\n ],\n \"assetIndex\": 1,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"my-app\",\n \"validUntil\": 1767225600,\n \"stopLossOrderId\": \"12346\",\n \"takeProfitOrderId\": \"12347\",\n \"skipApproval\": false,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"providerId": "hyperliquid",
"action": "open",
"status": "CREATED",
"summary": {
"type": "Open Position",
"orderType": "market",
"direction": "long",
"asset": "ETH",
"price": 3500,
"size": "0.215",
"leverage": 20,
"collateral": "43.00",
"fee": "0.0005",
"marginMode": "isolated",
"estimatedLiquidationPrice": 4200
},
"transactions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"network": "hyperliquid",
"chainId": "1337",
"type": "OPEN_POSITION",
"status": "CREATED",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"explorerUrls": [
"<string>"
],
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 3900,
"stopLossPrice": 3600,
"takeProfitPrice": 4400,
"orderId": "12345",
"orderIds": [
"<string>"
],
"assetIndex": 1,
"fromToken": {
"network": "eip155:42161",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "my-app",
"validUntil": 1767225600,
"stopLossOrderId": "12346",
"takeProfitOrderId": "12347",
"skipApproval": false,
"fundingMethod": "bridge2",
"enabled": true
},
"signingFormat": "EIP712_TYPED_DATA",
"signablePayload": "<string>",
"rawPayload": "<string>"
}
],
"createdAt": "2026-08-26T10:30:00.000Z",
"completedAt": "2026-08-26T10:30:05.000Z",
"signedMetadata": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "yield-xyz-borrow returned a response for GET /v1/positions that does not match the expected schema",
"id": "INTEGRATION_RESPONSE_SCHEMA_DRIFT",
"details": {
"integration": "yield-xyz-borrow",
"endpoint": "GET /v1/positions",
"issues": [
{
"path": "supplyBalances.0.balanceUsd",
"message": "Expected string, received number",
"code": "invalid_type"
}
]
}
}{
"error": "<string>"
}Execute a perps action
Build unsigned transaction(s) for a perps action (open, close, updateLeverage, stopLoss, takeProfit, setTpAndSl, cancelOrder, editOrder, updateMargin, fund, withdraw, approveAgent, approveBuilderFee, setUnifiedAccount). Returns transaction(s) to sign by their signingFormat; submit each via POST /transactions/:id/submit.
This is a proxy to the Yield.xyz Perps POST /v1/actions endpoint. Portal validates the upstream response against the schema documented here before returning it under data, and translates funding-chain network values to CAIP-2. If Yield.xyz changes the response shape, Portal returns a 500 with id: INTEGRATION_RESPONSE_SCHEMA_DRIFT instead of a partial response. Upstream reference: Yield.xyz Perps API.
curl --request POST \
--url https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"providerId": "hyperliquid",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 3900,
"stopLossPrice": 3600,
"takeProfitPrice": 4400,
"orderId": "12345",
"orderIds": [
"<string>"
],
"assetIndex": 1,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "my-app",
"validUntil": 1767225600,
"stopLossOrderId": "12346",
"takeProfitOrderId": "12347",
"skipApproval": false,
"fundingMethod": "bridge2",
"enabled": true
}
}
'import requests
url = "https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions"
payload = {
"providerId": "hyperliquid",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 3900,
"stopLossPrice": 3600,
"takeProfitPrice": 4400,
"orderId": "12345",
"orderIds": ["<string>"],
"assetIndex": 1,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "my-app",
"validUntil": 1767225600,
"stopLossOrderId": "12346",
"takeProfitOrderId": "12347",
"skipApproval": False,
"fundingMethod": "bridge2",
"enabled": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providerId: 'hyperliquid',
address: '0x1234567890abcdef1234567890abcdef12345678',
action: 'open',
args: {
marketId: 'hyperliquid-eth-usdc',
side: 'long',
amount: '100',
size: '1000',
leverage: 10,
marginMode: 'isolated',
limitPrice: 3900,
stopLossPrice: 3600,
takeProfitPrice: 4400,
orderId: '12345',
orderIds: ['<string>'],
assetIndex: 1,
agentAddress: '0x1234567890abcdef1234567890abcdef12345678',
agentName: 'my-app',
validUntil: 1767225600,
stopLossOrderId: '12346',
takeProfitOrderId: '12347',
skipApproval: false,
fundingMethod: 'bridge2',
enabled: true
}
})
};
fetch('https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerId' => 'hyperliquid',
'address' => '0x1234567890abcdef1234567890abcdef12345678',
'action' => 'open',
'args' => [
'marketId' => 'hyperliquid-eth-usdc',
'side' => 'long',
'amount' => '100',
'size' => '1000',
'leverage' => 10,
'marginMode' => 'isolated',
'limitPrice' => 3900,
'stopLossPrice' => 3600,
'takeProfitPrice' => 4400,
'orderId' => '12345',
'orderIds' => [
'<string>'
],
'assetIndex' => 1,
'agentAddress' => '0x1234567890abcdef1234567890abcdef12345678',
'agentName' => 'my-app',
'validUntil' => 1767225600,
'stopLossOrderId' => '12346',
'takeProfitOrderId' => '12347',
'skipApproval' => false,
'fundingMethod' => 'bridge2',
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions"
payload := strings.NewReader("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 3900,\n \"stopLossPrice\": 3600,\n \"takeProfitPrice\": 4400,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"<string>\"\n ],\n \"assetIndex\": 1,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"my-app\",\n \"validUntil\": 1767225600,\n \"stopLossOrderId\": \"12346\",\n \"takeProfitOrderId\": \"12347\",\n \"skipApproval\": false,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 3900,\n \"stopLossPrice\": 3600,\n \"takeProfitPrice\": 4400,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"<string>\"\n ],\n \"assetIndex\": 1,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"my-app\",\n \"validUntil\": 1767225600,\n \"stopLossOrderId\": \"12346\",\n \"takeProfitOrderId\": \"12347\",\n \"skipApproval\": false,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz-perps/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 3900,\n \"stopLossPrice\": 3600,\n \"takeProfitPrice\": 4400,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"<string>\"\n ],\n \"assetIndex\": 1,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"my-app\",\n \"validUntil\": 1767225600,\n \"stopLossOrderId\": \"12346\",\n \"takeProfitOrderId\": \"12347\",\n \"skipApproval\": false,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"providerId": "hyperliquid",
"action": "open",
"status": "CREATED",
"summary": {
"type": "Open Position",
"orderType": "market",
"direction": "long",
"asset": "ETH",
"price": 3500,
"size": "0.215",
"leverage": 20,
"collateral": "43.00",
"fee": "0.0005",
"marginMode": "isolated",
"estimatedLiquidationPrice": 4200
},
"transactions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"network": "hyperliquid",
"chainId": "1337",
"type": "OPEN_POSITION",
"status": "CREATED",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"explorerUrls": [
"<string>"
],
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 3900,
"stopLossPrice": 3600,
"takeProfitPrice": 4400,
"orderId": "12345",
"orderIds": [
"<string>"
],
"assetIndex": 1,
"fromToken": {
"network": "eip155:42161",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
},
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "my-app",
"validUntil": 1767225600,
"stopLossOrderId": "12346",
"takeProfitOrderId": "12347",
"skipApproval": false,
"fundingMethod": "bridge2",
"enabled": true
},
"signingFormat": "EIP712_TYPED_DATA",
"signablePayload": "<string>",
"rawPayload": "<string>"
}
],
"createdAt": "2026-08-26T10:30:00.000Z",
"completedAt": "2026-08-26T10:30:05.000Z",
"signedMetadata": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "yield-xyz-borrow returned a response for GET /v1/positions that does not match the expected schema",
"id": "INTEGRATION_RESPONSE_SCHEMA_DRIFT",
"details": {
"integration": "yield-xyz-borrow",
"endpoint": "GET /v1/positions",
"issues": [
{
"path": "supplyBalances.0.balanceUsd",
"message": "Expected string, received number",
"code": "invalid_type"
}
]
}
}{
"error": "<string>"
}Authorizations
Client API Key or Client Session Token (CST). Pass as a Bearer token in the Authorization header.
Body
Request body for POST /actions.
"hyperliquid"
"0x1234567890abcdef1234567890abcdef12345678"
Action to execute. Portal validates this against the fixed set below and rejects other values with a 400; new action types require Portal support. This is separate from venue and per-action args discovery via GET /providers, which is provider-driven — a new venue reusing these actions needs no change.
open, close, updateLeverage, stopLoss, takeProfit, cancelOrder, editOrder, fund, withdraw, approveAgent, approveBuilderFee, updateMargin, setTpAndSl, setUnifiedAccount "open"
Action arguments. Documented fields are typed; unknown keys pass through to the venue untouched (the venue's argumentSchemas from GET /providers/{providerId} is the source of truth for which args an action requires). network values here are venue slugs or CAIP-2 chains.
Show child attributes
Show child attributes
Response
Action created with unsigned transactions ready for signing
An action with its unsigned transactions and status. signedMetadata is opaque passthrough (returned untouched) for client-side verification.
Show child attributes
Show child attributes
Was this page helpful?