User Data Stream¶
listenKey create, keepalive (update), and close — API key only (no HMAC).
Lifecycle: create → call update at least every 30 minutes → close when finished. Then authenticate on the private WebSocket.
Pepperstone Crypto Public OpenAPI — User Data Stream 1.0.0¶
Pepperstone Crypto public REST API.
Authenticate with HMAC where required. See Authentication in the developer documentation for signing details. WebSocket market and private streams are documented separately. All times are UTC milliseconds unless noted.
Servers¶
| Description | URL |
|---|---|
| Production | https://api.pcrypto.com |
User Data Stream¶
POST /openapi/v1/userDataStream¶
Create listenKey
Description
Required Type: Spot trade (Read only OK)
Create a 64-character listenKey for the private WebSocket stream. Keep alive with update; close when finished. API key only — no HMAC.
Input parameters
| Parameter | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | Yes | API key. |
POST /openapi/v1/userDataStreamcurl -sS -X POST 'https://api.pcrypto.com/openapi/v1/userDataStream' \
-H 'x-ptrader-apikey: {apiKey}'{
"listenKey": "AbCdEfGhIjKlMnOpQrStUvWxYzabcdefghijklmnopqrstuvwxyz0123456789ab"
}Responses
Success
Response fields
| Name | Type | Description |
|---|---|---|
listenKey |
string |
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
POST /openapi/v1/userDataStream/update¶
Keepalive listenKey
Description
Required Type: Spot trade (Read only OK)
Keepalive a listenKey (call at least every 30 minutes). API key only — no HMAC.
Input parameters
| Parameter | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | Yes | API key. | |
listenKey |
query | string | Yes |
POST /openapi/v1/userDataStream/updatecurl -sS -X POST 'https://api.pcrypto.com/openapi/v1/userDataStream/update?listenKey={listenKey}' \
-H 'x-ptrader-apikey: {apiKey}'Responses
Success
Response fields
Empty JSON object {}.
Empty object {}
missing_parameter
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
POST /openapi/v1/userDataStream/close¶
Close listenKey
Description
Required Type: Spot trade (Read only OK)
Close a listenKey. API key only — no HMAC.
Input parameters
| Parameter | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
x-ptrader-apikey |
header | string | Yes | API key. | |
listenKey |
query | string | Yes |
POST /openapi/v1/userDataStream/closecurl -sS -X POST 'https://api.pcrypto.com/openapi/v1/userDataStream/close?listenKey={listenKey}' \
-H 'x-ptrader-apikey: {apiKey}'Responses
Success
Response fields
Empty JSON object {}.
Empty object {}
missing_parameter
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
rate_limited
Response fields
Error payload. Most API errors (including auth failures such as -1002) return HTTP 200 — see Error codes → HTTP status mapping. HTTP 400 for missing or invalid request parameters. HTTP 429 when rate limited.
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
Schemas¶
EmptyObject¶
ErrorBody¶
| Name | Type | Description |
|---|---|---|
code |
integer | |
msg |
string |
ListenKey¶
| Name | Type | Description |
|---|---|---|
listenKey |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| ApiKeyHmac | apiKey | ||
| ApiKeyOnly | apiKey | API key header only (no HMAC). Used for listenKey create, keepalive, and close. |
Tags¶
| Name | Description |
|---|---|
| User Data Stream |