Rate Limiting
Usually the API is rate limited to 100 requests per 20 seconds per user, but that limit and time period are subject to change either up or down as necessary. If you think your app may be affected by rate limits, it should be developed to adjust dynamically inspecting the values of X-PCO-API-Request-Rate-Limit and X-PCO-API-Request-Rate-Period in the HTTP headers. Your current count is discoverable in the X-PCO-API-Request-Rate-Count key. Requests that exceed the current limit will return an HTTP status 429. The number of seconds to wait until you can retry those requests is in the key Retry-After.
Sample rate limited request response headers:
$ curl -sS -D /dev/stderr -H 'Authorization: ...' https://api.planningcenteronline.com/people/v2/me
HTTP/2 429
content-type: application/json
content-length: 122
x-pco-api-request-rate-count: 118
x-pco-api-request-rate-limit: 100
x-pco-api-request-rate-period: 20 seconds
retry-after: 19
Sample rate limited request response body:
{
"errors": [
{
"code": "429",
"detail": "Rate limit exceeded: 118 of 100 requests per 20 seconds"
}
]
}