When adding/updating entities, API does not return header "x-daily-requests-left"

I add and edit entities via API using OAuth, i.s. doing POST/PUT requests.
But the API does not return the “x-daily-requests-left” header in the response.

I tried it on entities “deal”, “activity”, “person”, “organization”.

Example the request:

curl --location --request POST 'https://api.pipedrive.com/v1/activities' \
--header 'Authorization: Bearer 7550228:11547632:ce78bab28bc3b85c0c6b6baacdfe034e0f747590' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cfduid=d7391f8e31df56ca66429e28bb2bd6f5d1604326689; pipedrive-cdl=eu-central-1' \
--data-raw '{
"subject": "x-daily-requests-left"
}'

Example the response headers:

Date: Wed, 04 Nov 2020 10:19:13 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
x-correlation-id: e632ac16-36e2-470b-82d6-b9515f33d612
badi: Routing: eu-central-1=>eu-central-1; Version: a0fa; Host: bari;
Cache-Control: no-cache
Access-Control-Expose-Headers: X-RateLimit-Remaining, X-RateLimit-Limit, X-RateLimit-Reset
pdtrusted-wgw-real-user-ip: 145.255.181.132
x-frame-options: SAMEORIGIN
access-control-allow-origin: *
x-content-type-options: nosniff
vary: Accept-Encoding
set-cookie: pipedrive-cdl=eu-central-1;path=/;expires=Thu, 05 Nov 2020 10:19:13 GMT;secure
X-RateLimit-Limit: 480
X-RateLimit-Remaining: 479
X-RateLimit-Reset: 2
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
CF-Cache-Status: DYNAMIC
cf-request-id: 06345d9b31000000228e92d000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 5ecd9871e9d70022-DME"

What am I doing wrong?

@mykhailo Please, help me.

Hi @a.skibardin

Unfortunately, the x-daily-requests-left header is sent only if the request was made with API token (not OAuth). I am not aware of future plans to change that, but if it happens, most likely it will be reflected in the Changelog.

Hi, @mykhailo
Is there a way to find out what the limit is left? When using OAuth.
Or just getting HTTP 429 error?

It’s hard for me to advise, as I do not know your use case. 429 can be returned also when you make more requests per second than your plan allows (https://pipedrive.readme.io/docs/core-api-concepts-rate-limiting).

But If you want to stop sending requests when any of the limits we have is reached, then 429 should work.

@mykhailo

My case is this: I make requests through OAuth.
The documentation says that 10,000 POST/PUT requests are available per day. If I go over the limit of 10,000 requests, is there any way to find out about this other than getting HTTP 429 error. For example, in the header response or endpoint API?

If I get HTTP 429 error, is it possible to differ that the error is:

  • more requests per second than my plan allows
  • more POST/PUT requests per day than 10000

@a.skibardin to my knowledge in both cases, the error will be the same, 429. But if you make to many requests in 2s window (number of requests is be based on your plan) then x-ratelimit-remaining header will be 0, meaning you can use that to check if it was to rate limit error related to your plan or number of POST/PUT requests (that could work only if you don’t make POST/PUT requests more often than your plan allows).

Hope it helps. Also, if you building an app that might make more than 10k requests per day per user per company maybe there is another way to achieve the result you need.

1 Like