Workflows

Execute a workflow for a SendGrid inbound email

POST
/api/workflows/{id}/execute/sendgrid-inbound

Internal service endpoint that runs a workflow against an inbound SendGrid email payload. Authenticated via the INTERNAL_SERVICE_TOKEN bearer (not user auth). Validates the email payload (from / to / subject required) and rejects unauthorized requests with 403.

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Internal service payload forwarded by an inbound-email adapter (e.g. services/sendgrid-inbound). The workflow is run against the supplied email under the specified organization.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/workflows/string/execute/sendgrid-inbound" \  -H "Content-Type: application/json" \  -d '{    "organizationId": "64a1b2c3d4e5f60012345678",    "userId": "64a1b2c3d4e5f60012345679",    "emailData": {      "email": {        "from": "alex.nguyen@example.com",        "to": "inbound+org-64a1b@inbound.tetherai.ca",        "subject": "Question about Maple Court",        "body": "Hi - could you confirm the unit availability for next month?"      },      "metadata": {        "messageId": "sg_msg_1234567890"      }    }  }'
{  "success": true,  "message": "Workflow executed successfully"}