> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/instance-settings/settings-rate-limits.md).

# Settings Rate Limits

Operations about Public API rate-limit settings

## Retrieve the Public API rate-limit settings

> Retrieve the Public API rate-limit settings. \`envManagedFields\` lists the fields that are set by environment variables and can't be changed through the API. Requires the \`securitySettings:manage\` scope. Requests to this route count against the rate limits.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SettingsRateLimits","description":"Operations about Public API rate-limit settings"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"schemas":{"rateLimitSettingsPublicDto.generated":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether Public API rate limiting is enabled."},"globalReadLimit":{"type":"integer","minimum":0,"description":"Read requests allowed for one API key across all endpoints. Set 0 for no limit."},"globalReadWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the global read limit, in seconds."},"globalWriteLimit":{"type":"integer","minimum":0,"description":"Write requests allowed for one API key across all endpoints. Set 0 for no limit."},"globalWriteWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the global write limit, in seconds."},"endpointReadLimit":{"type":"integer","minimum":0,"description":"Read requests allowed for one API key on one endpoint. Set 0 for no limit."},"endpointReadWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the endpoint read limit, in seconds."},"endpointWriteLimit":{"type":"integer","minimum":0,"description":"Write requests allowed for one API key on one endpoint. Set 0 for no limit."},"endpointWriteWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the endpoint write limit, in seconds."},"envManagedFields":{"type":"array","items":{"type":"string","enum":["enabled","globalReadLimit","globalReadWindowSeconds","globalWriteLimit","globalWriteWindowSeconds","endpointReadLimit","endpointReadWindowSeconds","endpointWriteLimit","endpointWriteWindowSeconds"]},"description":"Fields controlled by environment variables, including _FILE variables. These fields return their effective values. A PUT can repeat these values but cannot change them.","readOnly":true}},"required":["enabled","globalReadLimit","globalReadWindowSeconds","globalWriteLimit","globalWriteWindowSeconds","endpointReadLimit","endpointReadWindowSeconds","endpointWriteLimit","endpointWriteWindowSeconds","envManagedFields"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/settings/rate-limits":{"get":{"operationId":"getRateLimitSettings","tags":["SettingsRateLimits"],"summary":"Retrieve the Public API rate-limit settings","description":"Retrieve the Public API rate-limit settings. `envManagedFields` lists the fields that are set by environment variables and can't be changed through the API. Requires the `securitySettings:manage` scope. Requests to this route count against the rate limits.","responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rateLimitSettingsPublicDto.generated"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```

## Set the Public API rate-limit settings

> Set the Public API rate-limit settings. You can send a GET response back as the body, and \`envManagedFields\` is ignored. When rate limiting is enabled, at least one limit must be greater than \`0\`. Fields set by environment variables can't be changed: a different value is rejected with 409, but sending the current value is accepted. Requires the \`securitySettings:manage\` scope. Requests to this route count against the rate limits.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SettingsRateLimits","description":"Operations about Public API rate-limit settings"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"schemas":{"rateLimitSettingsPublicDto.generated":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether Public API rate limiting is enabled."},"globalReadLimit":{"type":"integer","minimum":0,"description":"Read requests allowed for one API key across all endpoints. Set 0 for no limit."},"globalReadWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the global read limit, in seconds."},"globalWriteLimit":{"type":"integer","minimum":0,"description":"Write requests allowed for one API key across all endpoints. Set 0 for no limit."},"globalWriteWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the global write limit, in seconds."},"endpointReadLimit":{"type":"integer","minimum":0,"description":"Read requests allowed for one API key on one endpoint. Set 0 for no limit."},"endpointReadWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the endpoint read limit, in seconds."},"endpointWriteLimit":{"type":"integer","minimum":0,"description":"Write requests allowed for one API key on one endpoint. Set 0 for no limit."},"endpointWriteWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the endpoint write limit, in seconds."},"envManagedFields":{"type":"array","items":{"type":"string","enum":["enabled","globalReadLimit","globalReadWindowSeconds","globalWriteLimit","globalWriteWindowSeconds","endpointReadLimit","endpointReadWindowSeconds","endpointWriteLimit","endpointWriteWindowSeconds"]},"description":"Fields controlled by environment variables, including _FILE variables. These fields return their effective values. A PUT can repeat these values but cannot change them.","readOnly":true}},"required":["enabled","globalReadLimit","globalReadWindowSeconds","globalWriteLimit","globalWriteWindowSeconds","endpointReadLimit","endpointReadWindowSeconds","endpointWriteLimit","endpointWriteWindowSeconds","envManagedFields"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"conflict":{"description":"Conflict"},"unsupportedMediaType":{"description":"Unsupported media type."},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/settings/rate-limits":{"put":{"operationId":"updateRateLimitSettings","tags":["SettingsRateLimits"],"summary":"Set the Public API rate-limit settings","description":"Set the Public API rate-limit settings. You can send a GET response back as the body, and `envManagedFields` is ignored. When rate limiting is enabled, at least one limit must be greater than `0`. Fields set by environment variables can't be changed: a different value is rejected with 409, but sending the current value is accepted. Requires the `securitySettings:manage` scope. Requests to this route count against the rate limits.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether Public API rate limiting is enabled."},"globalReadLimit":{"type":"integer","minimum":0,"description":"Read requests allowed for one API key across all endpoints. Set 0 for no limit."},"globalReadWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the global read limit, in seconds."},"globalWriteLimit":{"type":"integer","minimum":0,"description":"Write requests allowed for one API key across all endpoints. Set 0 for no limit."},"globalWriteWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the global write limit, in seconds."},"endpointReadLimit":{"type":"integer","minimum":0,"description":"Read requests allowed for one API key on one endpoint. Set 0 for no limit."},"endpointReadWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the endpoint read limit, in seconds."},"endpointWriteLimit":{"type":"integer","minimum":0,"description":"Write requests allowed for one API key on one endpoint. Set 0 for no limit."},"endpointWriteWindowSeconds":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"The window for the endpoint write limit, in seconds."},"envManagedFields":{"type":"array","items":{"type":"string","enum":["enabled","globalReadLimit","globalReadWindowSeconds","globalWriteLimit","globalWriteWindowSeconds","endpointReadLimit","endpointReadWindowSeconds","endpointWriteLimit","endpointWriteWindowSeconds"]},"description":"Fields controlled by environment variables, including _FILE variables. These fields return their effective values. A PUT can repeat these values but cannot change them.","readOnly":true}},"required":["enabled","globalReadLimit","globalReadWindowSeconds","globalWriteLimit","globalWriteWindowSeconds","endpointReadLimit","endpointReadWindowSeconds","endpointWriteLimit","endpointWriteWindowSeconds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rateLimitSettingsPublicDto.generated"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"409":{"$ref":"#/components/responses/conflict"},"415":{"$ref":"#/components/responses/unsupportedMediaType"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```
