Skip to main content
This guide explains how to delete multiple accounts using the Automation API while complying with API rate limits. It uses the Delete account endpoint.

Prerequisites

Before using the Automation API, you must obtain an access token. For instructions, see the Authentication guide.
Include your token in the Authorization header of every request:

Handle rate limits

The Automation API enforces two rate-limiting windows to control request traffic:
If you send requests too quickly, the API returns an HTTP 429 Too Many Requests status code.
To avoid these limits, process your requests in controlled batches:
  • Send a maximum of 50 requests every 10 seconds.
  • Send a maximum of 1,000 requests per hour.

Example: Deleting 230 accounts

To delete 230 accounts, divide your requests into the following batches:

Delete accounts using Python

Use the following Python script to send delete requests sequentially and manage rate limits automatically:
delete_accounts.py
The script manages account deletion while complying with Automation API rate limits by:
  • Sending requests sequentially.
  • Processing accounts in batches of 50.
  • Waiting between batches to enforce the 10-second limit.
  • Pausing if the process reaches the hourly limit of 1,000 requests.
This approach prevents rate-limit errors and ensures reliable account deletion during large cleanup or offboarding operations.