API Endpoint
API Endpoints in Lleverage allow you to trigger workflows programmatically from your own applications. When you create a workflow with an API Call trigger, you can publish it to generate an endpoint that can be called from external systems.
Key Features
Programmable access to your Lleverage workflows
Secure authentication with Lleverage API tokens
Support for file uploads and mixed data types
Code examples in multiple programming languages
Dynamic code generation based on workflow configuration
Custom integration into your existing applications
How to Create an API Endpoint
Start by creating a workflow with an API Call trigger
Configure the required fields in the trigger settings:
For file uploads, set the field type to File
Add any additional fields (text, number, etc.)
Configure authentication requirements
Build your workflow with the desired actions
Test your workflow using the Run Panel
Click the Publish button in the top right corner
The Publish Panel will display your API endpoint URL
💡 Read more about different trigger types in the Triggers documentation page.
How to View Code Examples
Publish your workflow with an API Call trigger
In the Publish Panel, locate the Get Code button
Click the button to view code examples
Select from available programming languages:
cURL
Node.js
Python
PHP (Laravel)
Go
💡 These code examples are dynamically generated based on your workflow's field configuration.
API Code Examples
cURL
Node.js
Python
PHP (Laravel)
Go
Starting Workflows Asynchronously
Use the /async endpoint variant when the calling system only needs to start the workflow, not wait for the workflow result. To use it, send a POST request to the published API endpoint with /async appended. Use the same non-file JSON fields as the standard endpoint.
Lleverage accepts the request, schedules the workflow to run in the background, and returns an immediate JSON acknowledgement:
The id identifies the scheduled task. The acknowledgement only confirms that the workflow was accepted for asynchronous execution. It is not the workflow response or output.
This is useful for:
Fire-and-forget workflow starts
Avoiding client timeouts for longer workflows
Webhooks or integrations that only need to enqueue work
Workflows where the result is tracked elsewhere, such as in Lleverage activity, a data table, a notification, or another system updated by the workflow
Use the standard API endpoint instead when the caller needs the workflow result synchronously.
Limitations
The HTTP caller does not receive the workflow response or output.
Files are not supported through the async HTTP call, including file upload fields and file responses. Use the standard endpoint when the request or response needs files.
Errors that happen after the workflow has been accepted are not returned to the original HTTP caller. Check workflow activity and logs for execution results.
If validation or scheduling fails before the workflow is accepted, the async request can still return an HTTP error.
How to Send Files via API
When your workflow includes file fields, you'll need to use multipart/form-data encoding:
cURL with File Upload
Node.js with File Upload
Python with File Upload
PHP (Laravel) with File Upload
How to Structure API Requests
Use the endpoint URL provided in the Publish Panel
Include your Lleverage API token in the Authorization header (if required)
Structure your request body to include all fields defined in the trigger
For file uploads, use multipart/form-data encoding
Send the request using your preferred programming language or API client
⚠️ Always include all fields specified in the trigger configuration, even if you're not using them in your workflow. Missing required fields will cause the API call to fail.
How to Test API Endpoints
Use the provided code examples as a starting point
Modify the example with your actual API endpoint and token
Run the code from your development environment
Monitor the response to ensure successful workflow triggering
Check your workflow execution in the Lleverage platform
💡 Use tools like Postman or Insomnia to test your API endpoints before implementing them in your application.
Troubleshooting Common Issues
401 Unauthorized
Verify your API token is correct and active
Ensure the Authorization header is properly formatted:
Bearer YOUR_TOKEN
400 Bad Request
Check that all required fields are included
Verify field types match your workflow configuration
For file uploads, ensure proper multipart encoding
413 Payload Too Large
Check file size limits for your Lleverage plan
Consider compressing files before upload
Empty or Unexpected Response
Ensure your workflow has proper output configuration
Check workflow logs in Lleverage for processing errors
Best Practices
Store API tokens as environment variables
Implement retry logic for transient failures
Validate file types and sizes before sending
Log API responses for debugging
Monitor workflow execution logs regularly
Use HTTPS for all API communications
Handle errors gracefully in your application
⚠️ Be mindful of rate limits based on your Lleverage plan.
Last updated
Was this helpful?