Asynchronous Workflow
The Flimpa API uses an asynchronous architecture to efficiently process files of any size without timing out your HTTP connections.
The Task Lifecycle
File processing can be time-consuming. Instead of keeping an HTTP connection open while a file is being processed, the Flimpa API uses a three-step asynchronous workflow:
1. Create
You upload your file and specify the operation. The API immediately responds with a taskId and a secure token. The task enters the pending state and is queued for processing.
2. Poll Status
You periodically check the status of the task using the taskId and the X-Task-Access-Token. The state will change from pending to processing, and finally to completed (or failed).
3. Download
Once the task is completed, you can download the processed file. The result is kept on our servers for 1 hour (Task TTL) before being securely and permanently deleted.
Polling Best Practices
- Implement exponential backoff: Start by polling every 1-2 seconds, and gradually increase the interval if the task takes longer.
- Respect rate limits: The status endpoint has a generous rate limit, but excessive polling may result in a
429 Too Many Requestserror. - Handle failures gracefully: Always check if the status is
failedand handle the error accordingly.
Webhooks (Coming Soon)