Home > Forum > Installation > KSeF Connector | 429 API TooManyRequests

KSeF Connector | 429 API TooManyRequests
0

Hi everybody,

KSeF Connector. I configured it and it was working properly, and suddenly an error started appearing. It looks like an error from the government API. I'm wondering if anyone has encountered this issue and if there's any way to set intervals in the KSeF Connector. I have an appsettings.production.json file, but I don't know if the settings there apply. Is there any diagnostic option for this tool?

2026-01-07 12:24:16.3867||INFO|WebCon.KSEF.Core.Logic.Managers.Api.ApiManager|Checking InvoicesSync
2026-01-07 12:24:16.4729||INFO|WebCon.KSEF.Core.Logic.Services.Incoming.QueueSynchronizer|IsTruncated: False
2026-01-07 12:24:16.4729||INFO|WebCon.KSEF.Core.Logic.Services.Incoming.QueueSynchronizer|Downloaded: 2
2026-01-07 12:24:16.4729||INFO|WebCon.KSEF.Core.Logic.Services.Incoming.QueueSynchronizer|Has more: False
2026-01-07 12:24:21.3906||INFO|WebCon.KSEF.Core.Logic.Services.Incoming.QueueSynchronizer|Creating request content
2026-01-07 12:24:21.3906||INFO|WebCon.KSEF.Core.Logic.Services.Incoming.QueueSynchronizer|Downloading invoices from range: 23/12/2025 12:01:01 - 02/01/2026 12:11:01
2026-01-07 12:24:21.3906||INFO|WebCon.KSEF.Core.Logic.Managers.Api.ApiManager|Checking InvoicesSync
2026-01-07 12:24:21.4588||ERROR|WebCon.KSEF.Core.Logic.Managers.Api.ApiManager|Cannot download invoices for company with id: 1. Error message: The limit on the number of API requests has been exceeded (HTTP 429)
2026-01-07 12:24:21.4588||WARN|WebCon.KSEF.Core.Logic.Managers.ThrottlingManager|Throtling Company: 1, Service: QueueSynchronizer, Status: TooManyRequests, Messgae: API request limit exceeded (HTTP 429)
2026-01-07 12:24:51.3812||INFO|WebCon.KSEF.Core.Logic.Services.Outgoing.InvoicesVerifier|No invoices to verify

Hi,
There is a web admin panel for the KSeF connector.(Every environment has its own admin panel) You can log in via AD (if you have been added to the admin group in the KSeF connector) or by using the admin password.(created during installation)
Maybe you exceeded the invoice download limit?(If I remember correctly, this limit is set based on the license purchased from Webcon.)

In reply to: Franek

Ok. Ksef 2.0 has rate limiting. Here you have some information about it:(polish version)

https://github.com/CIRFMF/ksef-docs/blob/main/przeglad-kluczowych-zmian-ksef-api-2-0.md
https://github.com/CIRFMF/ksef-docs/blob/main/limity/limity-api.md

I have the same issue.
Everything was working fine on the KSeF TEST environment, but the problem appeared on DEMO, where the API request limits are much lower.
Because of these limits, the KSeF Connector exceeds the allowed number of requests and receives HTTP 429 (Too Many Requests).
In this case, the KSeF Connector should adapt to DEMO limits, especially since the production environment is expected to have the same rate limits as DEMO. This means the same problem will most likely occur after the KSeF production go-live.
At the moment, we are not able to download even a single invoice from KSeF DEMO.

Does anyone know how to configure the connector to respect KSeF rate limits (polling intervals, request throttling, parallelism), or is there any workaround available?

msg: Cannot download invoices for company with id: 1 | url: | ex: KSeF.Client.Core.Exceptions.KsefRateLimitException: Przekroczono limit ilości zapytań do API (HTTP 429) at KSeF.Client.Http.RestClient.<HandleInvalidStatusCode>g__HandleTooManyRequestsAsync|17_5(HttpResponseMessage responseMessage, CancellationToken innerCancellationToken) at KSeF.Client.Http.RestClient.HandleInvalidStatusCode(HttpResponseMessage response, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendCoreAsync[T](HttpRequestMessage httpRequestMessage, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendAsync[TResponse,TRequest](HttpMethod method, String url, TRequest requestBody, String token, String contentType, Dictionary`2 additionalHeaders, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendAsync[TResponse,TRequest](HttpMethod method, String url, TRequest requestBody, String token, String contentType, CancellationToken cancellationToken) at KSeF.Client.Clients.KSeFClient.QueryInvoiceMetadataAsync(InvoiceQueryFilters requestPayload, String accessToken, Nullable`1 pageOffset, Nullable`1 pageSize, SortOrder sortOrder, CancellationToken cancellationToken) at WebCon.KSEF.Core.Logic.Managers.Api.ApiManager.TryInvoicesSynchronizationAsync(InvoiceQueryFilters request, Int32 companyId, Int32 pageSize, Int32 pageOffset) | log: WebCon.KSEF.Core.Logic.Managers.Api.ApiManager

In reply to: Anna

I have the same issue.
Everything was working fine on the KSeF TEST environment, but the problem appeared on DEMO, where the API request limits are much lower.
Because of these limits, the KSeF Connector exceeds the allowed number of requests and receives HTTP 429 (Too Many Requests).
In this case, the KSeF Connector should adapt to DEMO limits, especially since the production environment is expected to have the same rate limits as DEMO. This means the same problem will most likely occur after the KSeF production go-live.
At the moment, we are not able to download even a single invoice from KSeF DEMO.

Does anyone know how to configure the connector to respect KSeF rate limits (polling intervals, request throttling, parallelism), or is there any workaround available?

msg: Cannot download invoices for company with id: 1 | url: | ex: KSeF.Client.Core.Exceptions.KsefRateLimitException: Przekroczono limit ilości zapytań do API (HTTP 429) at KSeF.Client.Http.RestClient.<HandleInvalidStatusCode>g__HandleTooManyRequestsAsync|17_5(HttpResponseMessage responseMessage, CancellationToken innerCancellationToken) at KSeF.Client.Http.RestClient.HandleInvalidStatusCode(HttpResponseMessage response, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendCoreAsync[T](HttpRequestMessage httpRequestMessage, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendAsync[TResponse,TRequest](HttpMethod method, String url, TRequest requestBody, String token, String contentType, Dictionary`2 additionalHeaders, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendAsync[TResponse,TRequest](HttpMethod method, String url, TRequest requestBody, String token, String contentType, CancellationToken cancellationToken) at KSeF.Client.Clients.KSeFClient.QueryInvoiceMetadataAsync(InvoiceQueryFilters requestPayload, String accessToken, Nullable`1 pageOffset, Nullable`1 pageSize, SortOrder sortOrder, CancellationToken cancellationToken) at WebCon.KSEF.Core.Logic.Managers.Api.ApiManager.TryInvoicesSynchronizationAsync(InvoiceQueryFilters request, Int32 companyId, Int32 pageSize, Int32 pageOffset) | log: WebCon.KSEF.Core.Logic.Managers.Api.ApiManager

Could you please let me know which version of the ksef connector you have installed?

In reply to: Franek

Could you please let me know which version of the ksef connector you have installed?

I have version ver. 2.0.0.19. It seems that the problem has probably been resolved.
I managed to download invoices from DEMO KSeF — after deactivating the NIP for a few hours and activating it again, the download started working.
However, in the logs, approximately every 10 minutes, a Warn message keeps appearing:

"msg: Throttling Company: 1, Service: QueueSynchronizer, Status: TooManyRequests, Message: The limit of API requests has been exceeded (HTTP 429) | url: | ex: | log: WebCon.KSEF.Core.Logic.Managers.ThrottlingManager"

and an Error message:

"msg: Cannot download invoices for company with id: 1 | url: | ex: KSeF.Client.Core.Exceptions.KsefRateLimitException: The limit of API requests has been exceeded (HTTP 429) at KSeF.Client.Http.RestClient.<HandleInvalidStatusCode>g__HandleTooManyRequestsAsync|17_5(HttpResponseMessage responseMessage, CancellationToken innerCancellationToken) at KSeF.Client.Http.RestClient.HandleInvalidStatusCode(HttpResponseMessage response, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendCoreAsync[T](HttpRequestMessage httpRequestMessage, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendAsync[TResponse,TRequest](HttpMethod method, String url, TRequest requestBody, String token, String contentType, Dictionary2 additionalHeaders, CancellationToken cancellationToken) at KSeF.Client.Http.RestClient.SendAsync[TResponse,TRequest](HttpMethod method, String url, TRequest requestBody, String token, String contentType, CancellationToken cancellationToken) at KSeF.Client.Clients.KSeFClient.QueryInvoiceMetadataAsync(InvoiceQueryFilters requestPayload, String accessToken, Nullable1 pageOffset, Nullable`1 pageSize, SortOrder sortOrder, CancellationToken cancellationToken) at WebCon.KSEF.Core.Logic.Managers.Api.ApiManager.TryInvoicesSynchronizationAsync(InvoiceQueryFilters request, Int32 companyId, Int32 pageSize, Int32 pageOffset) | log: WebCon.KSEF.Core.Logic.Managers.Api.ApiManager"

What is weird because in the Connector I have two companies configured (two different NIPs), but the message about exceeding the request limit appears only for this one company with ID 1.