API Security and Resource Limits

A client may need only a document title and update time. An API defines which fields it accepts and returns, who may call it, and how much work one request can trigger.

On this page

Control both incoming and outgoing fields

After checking membership, copy allowed input fields explicitly. Ownership and billing flags belong to separate privileged operations. Select response fields explicitly too. Keep an inventory of supported endpoint versions so that retired versions stop serving private data.

// Run after authorization and title validation.
const changes = { title: validatedTitle };
const publicFields = { id: document.id, title: document.title };

Bound expensive work before starting it

Limit body size, page size, execution time, and concurrent jobs. Rate-limit by an appropriate account or tenant as well as network signals. Return 429 with Retry-After when the client should slow down. For operations such as paid exports, scope an idempotency key to the caller and record it atomically so a retry cannot charge twice. These numbers illustrate a policy.

List documents    50 rows per page maximum
Export queue      2 active exports per account
Quota response    429 Too Many Requests
Retry-After: 60

Official references