Push a signal
POST https://rest.haasapi.com/v1/partner/signals
Sends a trading signal to your signal (webhook) bots listening on a signal_token. Create the bot first with strategy webhook (see GET /v1/partner/strategies); its token is in the bot’s settings. The order size and market are the bot’s own settings - the signal carries only the action. Answers 202: delivery is immediate but fire-and-forget, so a token no bot listens to is still accepted.
Requires the partner scope.
Request body
Section titled “Request body”{ "signal_token": "a1b2c3d4", "action": "enter_long"}PushPartnerSignalRequest
Section titled “PushPartnerSignalRequest”| Field | Type | Description |
|---|---|---|
signal_token |
string | The signal bot’s token (from the bot’s settings). Letters, digits, ‘-’ and ‘_’. |
action |
string | The trading action (lowercase): buy / enter_long, sell / enter_short, exit_position, exit_long, or exit_short. |
Example request
Section titled “Example request”curl "https://rest.haasapi.com/v1/partner/signals" \ -X POST \ -H "Authorization: Bearer hk_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"signal_token":"a1b2c3d4","action":"enter_long"}'Response
Section titled “Response”202 Accepted - the job was queued; poll its status. Returns a PartnerSignalAccepted.
{ "signal_token": "a1b2c3d4", "action": "enter_long", "accepted": true}Fields
Section titled “Fields”PartnerSignalAccepted
Section titled “PartnerSignalAccepted”| Field | Type | Description |
|---|---|---|
signal_token |
string | |
action |
string | |
accepted |
boolean | Always true - the signal was validated and dispatched. |
Errors
Section titled “Errors”All errors are RFC 9457 problem documents.
| Status | Description |
|---|---|
400 |
The request is malformed (invalid limit, unusable cursor, …). (code: invalid_request) |
401 |
Missing, malformed, disabled, or revoked API key. (code: invalid_api_key) |
409 |
A request with this Idempotency-Key is still being processed. (code: idempotency_in_progress) |
422 |
The action or token was rejected - see the message. (code: invalid_signal) The Idempotency-Key was already used with a different request. (code: idempotency_key_reuse) |
500 |
An unexpected error inside the API. Nothing about the request caused it; retry, and quote the instance value if it persists. (code: internal_error) |
502 |
An internal service answered in a way the API could not serve. Retry. (code: upstream_error) |
503 |
The request could not be served right now. Retry with the same key - do not discard it. (code: temporarily_unavailable) |
504 |
An internal service did not answer within the deadline. Retry with backoff. (code: upstream_timeout) |
{ "type": "https://docs.haasapi.com/errors/invalid_request", "title": "Invalid request", "status": 400, "detail": "The request is malformed (invalid limit, unusable cursor, …).", "code": "invalid_request"}