Skip to main content
POST
/
v1
/
emails
Create An Email
curl --request POST \
  --url http://api.stuut.ai/v1/emails \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "bcc": [
    "[email protected]"
  ],
  "body": "<string>",
  "cc": [
    "[email protected]"
  ],
  "email_sender": "<string>",
  "email_template": "<string>",
  "invoices": [
    "<string>"
  ],
  "partner": "<string>",
  "options": {
    "include_checkout_url": false,
    "reply_all": false,
    "use_llm": false
  },
  "parent_email": "<string>",
  "reply_to": [
    "[email protected]"
  ],
  "subject": "<string>",
  "to": [
    "[email protected]"
  ]
}
'
{
  "object": "<string>",
  "thread_id": "<string>",
  "id": "<string>",
  "attachments": [
    {
      "file_type": "audio",
      "mime_type": "<string>",
      "name": "<string>",
      "object": "<string>",
      "organization_id": "<string>",
      "id": "<string>",
      "content_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "disposition": "<string>",
      "is_verified": true,
      "modified_at": "2023-11-07T05:31:56Z",
      "presigned_url": "<string>",
      "presigned_url_expires_at": "2023-11-07T05:31:56Z",
      "purpose": "<string>",
      "remote_id": "<string>",
      "size": 123,
      "src": "<unknown>",
      "user_id": "<string>"
    }
  ],
  "author": {
    "email": "<string>",
    "family_name": "<string>",
    "given_name": "<string>",
    "object": "<string>",
    "organization_id": "<string>",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "dashboard_settings": {
      "thread_emails_sort_order": "asc"
    },
    "default_email_sender_id": "<string>",
    "invited_by_user_id": "<string>",
    "is_access_approved": true,
    "is_org_admin": true,
    "modified_at": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "onboarding_required": true,
    "profile_picture": "<string>",
    "selected": true
  },
  "author_id": "<string>",
  "bcc": [
    "<string>"
  ],
  "body": "<string>",
  "bounced_addresses": [
    "<string>"
  ],
  "bulk_email_request_id": "<string>",
  "cc": [
    "<string>"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "custom_headers": "<unknown>",
  "direction": "inbound",
  "email_reason": "<string>",
  "email_sender": {
    "email": "<string>",
    "object": "<string>",
    "reply_to": "<string>",
    "user_id": "<string>",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "expired_at": "2023-11-07T05:31:56Z",
    "is_nylas_connection": true,
    "is_nylas_grant_expired": true,
    "is_shared": true,
    "modified_at": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "provider": "<string>",
    "reply_to_name": "<string>",
    "signature_html": "<string>"
  },
  "email_sender_id": "<string>",
  "error_message": "<string>",
  "from_email": "<string>",
  "generated_body": "<string>",
  "is_automated": true,
  "is_generated": true,
  "is_originated_in_stuut": true,
  "is_unread": true,
  "modified_at": "2023-11-07T05:31:56Z",
  "parent_email_id": "<string>",
  "participants": [
    "[email protected]"
  ],
  "remote_id": "<string>",
  "remote_links": [
    {
      "email_id": "<string>",
      "email_sender_id": "<string>",
      "object": "<string>",
      "remote_id": "<string>",
      "remote_thread_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z"
    }
  ],
  "reply_to": [
    "<string>"
  ],
  "send_separately": true,
  "sent_at": "2023-11-07T05:31:56Z",
  "sent_by_id": "<string>",
  "snippet": "<string>",
  "status": "draft",
  "subject": "<string>",
  "to": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
bcc
string<email>[]
body
string
cc
string<email>[]
email_sender
string

The EmailSender identifier, (e.g. sndr_abc123).

email_template
string

The EmailTemplate identifier, (e.g. eml_tmpl_abc123).

invoices
string[]

The Invoice identifier, (e.g. inv_abc123).

partner
string

The Partner identifier, (e.g. ptn_abc123).

options
object
parent_email
string

The Email identifier, (e.g. eml_abc123).

reply_to
string<email>[]
subject
string
to
string<email>[]

Response

Successful response

object
string
required
thread_id
string
required
Maximum string length: 32
id
string
Maximum string length: 32
attachments
object[]
author
object
author_id
string | null
Maximum string length: 32
bcc
string[]
body
string | null

The HTML body of the email.

bounced_addresses
string[]

List of email addresses that bounced for this email

bulk_email_request_id
string | null
Maximum string length: 32
cc
string[]
created_at
string<date-time>
custom_headers
any | null

Custom email headers

direction
enum<string>

The request direction of the email. Either inbound or outbound

Available options:
inbound,
outbound
Maximum string length: 8
email_reason
string | null

The reason the email was sent.

email_sender
object
email_sender_id
string | null
Maximum string length: 32
error_message
string | null

The error message if the email failed to send.

from_email
string
generated_body
string | null

Saves LLM-generated body of the email. Diffed against email body when email is sent to get user changes.

is_automated
boolean

Whether the email was automatically sent by a workflow or an AI agent.

is_generated
boolean

Whether the email was automatically generated by a workflow or an AI agent.

is_originated_in_stuut
boolean

Whether the email originated (was sent through) Stuut.

is_unread
boolean
modified_at
string<date-time> | null
parent_email_id
string | null
Maximum string length: 32
participants
string<email>[]
remote_id
string | null

The Nylas ID of the email

reply_to
string[]
send_separately
boolean
sent_at
string<date-time> | null

When the email was sent.

sent_by_id
string | null
Maximum string length: 32
snippet
string | null
status
enum<string>
Available options:
draft,
pending,
sending,
sent,
error
Maximum string length: 7
subject
string | null
to
string[]