Skip to main content

Submit SpiderMail Job

POST/api/v1/jobs/spiderMail/submit

Overview

SpiderMail processes email send, reply, and forward operations through the standard job queue. Emails are sent via SMTP from registered mailboxes and outbound copies are stored in the database for thread continuity.

Request Body

payloadobjectrequired

SpiderMail job configuration

payload.actionstringrequired

Email action: send, reply, or forward

payload.from_emailstringrequired

Sender email address (must be a registered mailbox)

payload.toarray

Recipient email addresses. Required for send and forward actions.

payload.ccarray

CC recipient email addresses

payload.subjectstring

Email subject line. Required for send action.

payload.body_textstringrequired

Plain text email body (required as fallback for clients that don't render HTML)

payload.body_htmlstring

HTML email body. When provided, the email is sent as multipart/alternative with both text and HTML versions. Most email clients will display the HTML version.

payload.reply_to_message_idinteger

Database ID of the message to reply to. Required for reply and forward actions.

payload.reply_allbooleandefault: false

Reply to all recipients (only used with reply action)

priorityintegerdefault: 0

Job priority (0-10, higher = processed first)

Send Email (Plain Text)

curl -X POST https://spideriq.ai/api/v1/jobs/spiderMail/submit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <client_id>:<api_key>:<api_secret>" \
-d '{
"payload": {
"action": "send",
"from_email": "alice@company.com",
"to": ["bob@prospect.com"],
"subject": "Quick question about your services",
"body_text": "Hi Bob,\n\nI noticed your company is expanding..."
}
}'

Send Email (HTML + Plain Text)

For rich formatting, include both body_text (required fallback) and body_html. The email is sent as multipart/alternative — most email clients display the HTML version.

curl -X POST https://spideriq.ai/api/v1/jobs/spiderMail/submit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <client_id>:<api_key>:<api_secret>" \
-d '{
"payload": {
"action": "send",
"from_email": "alice@company.com",
"to": ["bob@prospect.com"],
"subject": "Quick question about your services",
"body_text": "Hi Bob,\n\nI noticed your company is expanding...",
"body_html": "<p>Hi Bob,</p><p>I noticed your company is <strong>expanding</strong>...</p>"
}
}'

Reply to Email

curl -X POST https://spideriq.ai/api/v1/jobs/spiderMail/submit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <client_id>:<api_key>:<api_secret>" \
-d '{
"payload": {
"action": "reply",
"from_email": "alice@company.com",
"reply_to_message_id": 1234,
"body_text": "Thanks for getting back to me! I would love to schedule a call."
}
}'

Forward Email

curl -X POST https://spideriq.ai/api/v1/jobs/spiderMail/submit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <client_id>:<api_key>:<api_secret>" \
-d '{
"payload": {
"action": "forward",
"from_email": "alice@company.com",
"to": ["manager@company.com"],
"reply_to_message_id": 1234,
"body_text": "FYI — this prospect is interested."
}
}'

Response

{
"success": true,
"job_id": "job_abc123",
"type": "spiderMail",
"status": "queued",
"message": "SpiderMail job queued successfully"
}

Validation Rules

ActionRequired Fields
sendfrom_email, to, subject, body_text
replyfrom_email, reply_to_message_id, body_text
forwardfrom_email, to, reply_to_message_id, body_text