Create a portfolio
curl --request POST \
--url https://api.portfobit.com/api/v1/portfolios \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"base_currency": "USD",
"tags": [
"<string>"
],
"account_ids": [
"<string>"
]
}
'import requests
url = "https://api.portfobit.com/api/v1/portfolios"
payload = {
"name": "<string>",
"description": "<string>",
"base_currency": "USD",
"tags": ["<string>"],
"account_ids": ["<string>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
base_currency: 'USD',
tags: ['<string>'],
account_ids: ['<string>']
})
};
fetch('https://api.portfobit.com/api/v1/portfolios', 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.portfobit.com/api/v1/portfolios",
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([
'name' => '<string>',
'description' => '<string>',
'base_currency' => 'USD',
'tags' => [
'<string>'
],
'account_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.portfobit.com/api/v1/portfolios"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"base_currency\": \"USD\",\n \"tags\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.portfobit.com/api/v1/portfolios")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"base_currency\": \"USD\",\n \"tags\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portfobit.com/api/v1/portfolios")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"base_currency\": \"USD\",\n \"tags\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "pf_01J2K7M9N3",
"name": "Q3_Quant_Hedge",
"description": "Cross_CEX_funding_rate_arbitrage",
"base_currency": "USD",
"tags": [
"Arbitrage"
],
"account_ids": [
"acc_01H8XFK9A"
],
"matched_account_count": 1,
"subscription_access": "available",
"is_system": false,
"created_at": "2026-08-01T00:00:00Z",
"updated_at": "2026-08-07T08:00:00Z"
},
"meta": {
"request_id": "req_01J2K8B7QW",
"generated_at": "2026-08-07T08:00:01Z"
}
}{
"error": {
"code": "plan_limit_reached",
"message": "The Free plan allows up to 3 available accounts.",
"details": {
"resource_type": "account",
"used": 3,
"limit": 3,
"current_plan": "Free",
"required_plan": "Plus",
"upgrade_available": true
}
},
"meta": {
"request_id": "req_01J2K8B7QW",
"generated_at": "2026-08-08T08:00:00Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "<string>",
"generated_at": "2023-11-07T05:31:56Z"
}
}Portfolios
Create a portfolio
Requires portfolio:write and Idempotency-Key.
POST
/
portfolios
Create a portfolio
curl --request POST \
--url https://api.portfobit.com/api/v1/portfolios \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"base_currency": "USD",
"tags": [
"<string>"
],
"account_ids": [
"<string>"
]
}
'import requests
url = "https://api.portfobit.com/api/v1/portfolios"
payload = {
"name": "<string>",
"description": "<string>",
"base_currency": "USD",
"tags": ["<string>"],
"account_ids": ["<string>"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
base_currency: 'USD',
tags: ['<string>'],
account_ids: ['<string>']
})
};
fetch('https://api.portfobit.com/api/v1/portfolios', 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.portfobit.com/api/v1/portfolios",
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([
'name' => '<string>',
'description' => '<string>',
'base_currency' => 'USD',
'tags' => [
'<string>'
],
'account_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.portfobit.com/api/v1/portfolios"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"base_currency\": \"USD\",\n \"tags\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.portfobit.com/api/v1/portfolios")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"base_currency\": \"USD\",\n \"tags\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portfobit.com/api/v1/portfolios")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"base_currency\": \"USD\",\n \"tags\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "pf_01J2K7M9N3",
"name": "Q3_Quant_Hedge",
"description": "Cross_CEX_funding_rate_arbitrage",
"base_currency": "USD",
"tags": [
"Arbitrage"
],
"account_ids": [
"acc_01H8XFK9A"
],
"matched_account_count": 1,
"subscription_access": "available",
"is_system": false,
"created_at": "2026-08-01T00:00:00Z",
"updated_at": "2026-08-07T08:00:00Z"
},
"meta": {
"request_id": "req_01J2K8B7QW",
"generated_at": "2026-08-07T08:00:01Z"
}
}{
"error": {
"code": "plan_limit_reached",
"message": "The Free plan allows up to 3 available accounts.",
"details": {
"resource_type": "account",
"used": 3,
"limit": 3,
"current_plan": "Free",
"required_plan": "Plus",
"upgrade_available": true
}
},
"meta": {
"request_id": "req_01J2K8B7QW",
"generated_at": "2026-08-08T08:00:00Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "<string>",
"generated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Opaque retry key, unique to the same user, method, and path.
Required string length:
1 - 255Body
application/json