# Limits

## GET /limits

> Get the global limits.

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"servers":[{"url":"http://localhost:3031","description":"Local Emily server"},{"url":"https://sbtc-emily.com","description":"Production Emily server"},{"url":"https://temp.sbtc-emily-dev.com","description":"Testnet Emily server"}],"paths":{"/limits":{"get":{"tags":["limits"],"summary":"Get the global limits.","operationId":"getLimits","responses":{"200":{"description":"Limits retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Limits"}}}},"405":{"description":"Method not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"Limits":{"type":"object","description":"Represents the current sBTC limits.","required":["accountCaps"],"properties":{"accountCaps":{"type":"object","description":"Represents the individual limits for requests coming from different accounts.","additionalProperties":{"$ref":"#/components/schemas/AccountLimits"}},"availableToWithdraw":{"type":"integer","format":"int64","description":"Total amount sBTC still available for withdrawals in current window. All withdrawals except rejected\ncounted here","nullable":true,"minimum":0},"pegCap":{"type":"integer","format":"int64","description":"Represents the total cap for all pegged-in BTC/sBTC.","nullable":true,"minimum":0},"perDepositCap":{"type":"integer","format":"int64","description":"Per deposit cap. If none then there is no cap.","nullable":true,"minimum":0},"perDepositMinimum":{"type":"integer","format":"int64","description":"Per deposit minimum. If none then there is no minimum.","nullable":true,"minimum":0},"perWithdrawalCap":{"type":"integer","format":"int64","description":"Per withdrawal cap. If none then there is no cap.","nullable":true,"minimum":0},"rollingWithdrawalBlocks":{"type":"integer","format":"int64","description":"Number of blocks that define the rolling withdrawal window.","nullable":true,"minimum":0},"rollingWithdrawalCap":{"type":"integer","format":"int64","description":"Maximum total sBTC that can be withdrawn within the rolling withdrawal window.","nullable":true,"minimum":0},"throttleModeInitiator":{"type":"string","description":"Name of key which triggered throttle mode (if throttle mode is active)","nullable":true}}},"AccountLimits":{"type":"object","description":"The representation of a limit for a specific account.","properties":{"pegCap":{"type":"integer","format":"int64","description":"Represents the current sBTC limits.","nullable":true,"minimum":0},"perDepositCap":{"type":"integer","format":"int64","description":"Per deposit cap. If none then the cap is the same as the global per deposit cap.","nullable":true,"minimum":0},"perDepositMinimum":{"type":"integer","format":"int64","description":"Per deposit minimum. If none then there is no minimum.","nullable":true,"minimum":0},"perWithdrawalCap":{"type":"integer","format":"int64","description":"Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.","nullable":true,"minimum":0},"rollingWithdrawalBlocks":{"type":"integer","format":"int64","description":"Number of blocks that define the rolling withdrawal window.","nullable":true,"minimum":0},"rollingWithdrawalCap":{"type":"integer","format":"int64","description":"Maximum total sBTC that can be withdrawn within the rolling withdrawal window.","nullable":true,"minimum":0},"throttleModeInitiator":{"type":"string","description":"Throttle key initiated throttle","nullable":true}}},"ErrorResponse":{"type":"object","description":"Structure representing an error response\nThis is used to serialize error messages in HTTP responses","required":["message"],"properties":{"message":{"type":"string"}}}}}}
```

## GET /limits/{account}

> Get limits for account handler.

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"servers":[{"url":"http://localhost:3031","description":"Local Emily server"},{"url":"https://sbtc-emily.com","description":"Production Emily server"},{"url":"https://temp.sbtc-emily-dev.com","description":"Testnet Emily server"}],"paths":{"/limits/{account}":{"get":{"tags":["limits"],"summary":"Get limits for account handler.","operationId":"getLimitsForAccount","parameters":[{"name":"account","in":"path","description":"The account for which to get the limits.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Account limits retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLimits"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Address not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"405":{"description":"Method not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"AccountLimits":{"type":"object","description":"The representation of a limit for a specific account.","properties":{"pegCap":{"type":"integer","format":"int64","description":"Represents the current sBTC limits.","nullable":true,"minimum":0},"perDepositCap":{"type":"integer","format":"int64","description":"Per deposit cap. If none then the cap is the same as the global per deposit cap.","nullable":true,"minimum":0},"perDepositMinimum":{"type":"integer","format":"int64","description":"Per deposit minimum. If none then there is no minimum.","nullable":true,"minimum":0},"perWithdrawalCap":{"type":"integer","format":"int64","description":"Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.","nullable":true,"minimum":0},"rollingWithdrawalBlocks":{"type":"integer","format":"int64","description":"Number of blocks that define the rolling withdrawal window.","nullable":true,"minimum":0},"rollingWithdrawalCap":{"type":"integer","format":"int64","description":"Maximum total sBTC that can be withdrawn within the rolling withdrawal window.","nullable":true,"minimum":0},"throttleModeInitiator":{"type":"string","description":"Throttle key initiated throttle","nullable":true}}},"ErrorResponse":{"type":"object","description":"Structure representing an error response\nThis is used to serialize error messages in HTTP responses","required":["message"],"properties":{"message":{"type":"string"}}}}}}
```
