# Custom Rule Signal

## POST /signal

>

```json
{"openapi":"3.0.0","info":{"title":"Coinrule Open API","version":"2.0"},"paths":{"/signal":{"post":{"operationId":"SignalController_externalSignalsWebhook","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalSignal"}}}},"responses":{"201":{"description":"The signal was successfully processed and passed to the Rule Engine.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalResponse"}}}},"400":{"description":"The request is malformed or the arguments are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalErrorResponse"}}}},"401":{"description":"Security tokens are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalErrorResponse"}}}},"404":{"description":"No rule found for the signal, it could be paused or completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalErrorResponse"}}}},"429":{"description":"The rate limit (1 request per rule per second) has been exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalErrorResponse"}}}},"500":{"description":"An internal server error has occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalErrorResponse"}}}}},"tags":["Custom Rule Signal"]}}},"components":{"schemas":{"ExternalSignal":{"type":"object","properties":{"userId":{"type":"string","description":"Coinrule User ID"},"hookId":{"type":"string","description":"Hook ID to identify the signal source."},"hookToken":{"type":"string","description":"Hook token to authenticate the signal source."},"side":{"type":"string","description":"Order side (\"buy\" or \"sell\").","enum":["buy","sell"]},"product":{"type":"string","description":"Product symbol (e.g. BTCUSD_PERP). If provided, baseCoin and quoteCoin should not be provided. For spot trading, better to use baseCoin and quoteCoin instead, or alternatively send this value in a format baseCoin/quoteCoin."},"baseCoin":{"type":"string","description":"Base coin for spot trading (e.g. BTC)."},"quoteCoin":{"type":"string","description":"Quote coin for spot trading (e.g. USD). If provided, the wallet in the rule will be checked for this coin - it does not overwrite the wallet coin. If not matched, the signal will be ignored."},"amountValue":{"type":"string","description":"Amount value to trade. If provided, it will overwrite the action amount in the rule. If multiple actions are present, the amount will be applied to all of them. Required when amount symbol is provided."},"amountSymbol":{"type":"string","description":"Amount symbol to trade (currently only \"%\" is supported). Required when amount value is provided.","enum":["%"]}},"required":["userId","hookId","hookToken","side"]},"SignalResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"SignalErrorResponse":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string","description":"The error message."}},"required":["statusCode","message"]}}}}
```
