Prerequisites
Before using the Automation API, you must obtain an access token. For instructions, see the Authentication guide.
Authorization header of every request:
Handle rate limits
The Automation API enforces two rate-limiting windows to control request traffic:| Time window | Maximum requests |
|---|---|
| 10 seconds | 50 requests |
| 1 hour | 1,000 requests |
- 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:| Batch | Requests | Wait time |
|---|---|---|
| 1 | 50 | Wait 10 seconds |
| 2 | 50 | Wait 10 seconds |
| 3 | 50 | Wait 10 seconds |
| 4 | 50 | Wait 10 seconds |
| 5 | 30 | Complete |
Delete accounts using Python
Use the following Python script to send delete requests sequentially and manage rate limits automatically:delete_accounts.py
- 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.