Skip to main content
POST
/
api
/
workflows
/
{id}
/
execute
/
sendgrid-inbound
Execute a workflow for a SendGrid inbound email
curl --request POST \
  --url https://your-instance.example.com/api/workflows/{id}/execute/sendgrid-inbound \
  --header 'Content-Type: application/json' \
  --data '
{
  "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"
}

Documentation Index

Fetch the complete documentation index at: https://docs.tetherai.ca/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

id
string
required

Body

application/json

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.

organizationId
string
required

Owning organization for the run — must match the workflow's organizationId.

emailData
object
required

Parsed inbound email payload. Either supply the flat fields (from/to/subject/…) or a nested email object — from, to, and subject are required.

userId
string

Optional User _id to attribute the run to. Falls back to the workflow's creator when omitted.

Response

Workflow executed successfully

Returned by POST /api/workflows/{id}/execute/sendgrid-inbound after the internal service hands off the email payload to the workflow engine.

success
enum<boolean>
required
Available options:
true
message
string
required