Skip to main content
All examples below demonstrate how to trigger flows using a Bearer Token and a JSON payload.

Request Details

  • Method: POST
  • Authorization: Bearer Token (workspace-level)
  • Content-Type: application/json

Sample Payload

Replace:
  • {workspace_id} with your workspace ID
  • {trigger_id} with your trigger ID
  • {environment} with DEV / UAT / PROD
  • workspace_api_key with your workspace token
curl -X POST "https://ai-core.phinite.ai/trigger/{workspace_id}/{trigger_id}/{environment}" \
  -H "Authorization: Bearer workspace_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "start the task",
    "user_variables": {
      "key1": "value1",
      "key2": "value2"
    }
  }'

Error Responses

{
  "detail": "Invalid authentication credentials"
}

Common Use Cases

  • Automated incident response from monitoring systems
  • Scheduled data processing and reporting
  • Webhook-triggered workflows from external platforms (Jira, etc.)
  • Background batch processing with real-time progress tracking
  • Long-running data transformation and enrichment tasks
  • Periodic system health checks and maintenance routines

Notes & Best Practices

Choose the right execution mode: Use single endpoint API only for simple flows under 120-150 seconds. Use background task for most autonomous workflows. Use cron job for scheduled, recurring tasks.
  • Validate bearer tokens: Always verify authentication in DEV environment before deploying to PROD.
  • Use user_variables for context: Pass structured data through user_variables instead of embedding everything in the message field.
  • Poll status intelligently: When using background tasks, implement appropriate polling intervals (e.g., every 5-10 seconds) to check status without overwhelming the API.
  • Monitor execution time: Be aware of the 2700-second maximum for background tasks. Design flows to complete within this limit.
  • Test thoroughly: Always test in DEV environment before promoting to UAT and PROD.
  • Keep triggers descriptive: Use clear, meaningful names for triggers to facilitate internal reference and debugging.
  • Handle webhooks appropriately: For Jira and other webhook integrations, ensure the integration is properly configured with the correct secret before testing.