Use the createAndSendInboxEmail mutation to create an inbox email and send it in a single GraphQL request.
Before You Begin
🔗 Use the GraphQL Playground to execute the queries in this guide.
➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.
Prerequisites
- Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
- Permissions: Your token must have permission to manage inbox emails on the card and to read the SMTP configuration for the sender address.
- Card ID: The card to which the email will be linked (required).
- Pipe ID (repoId): The pipe where the card lives. In the API, the pipe is often referred to as repo;
repoIdis the pipe ID. - Sender address: The
fromaddress must match an authorized SMTP configuration in your organization.
What This Mutation Does
The createAndSendInboxEmail mutation:
- Creates an inbox email record linked to the given card (and optional repo).
- Sends the email using your organization’s SMTP configuration for the
fromaddress.
You get back the created inbox email and whether the email was sent successfully (emailSent), in one request.
Step 1: Get the required IDs
- Card ID: From the card URL
https://app.pipefy.com/open-cards/123456789→ Card ID is123456789. - Pipe ID: From the pipe URL
https://app.pipefy.com/pipes/987654321→ Pipe ID is987654321(use this asrepoId).
You can also obtain these via GraphQL: How to get the card ID and How to get the pipe ID.
Step 2: Call createAndSendInboxEmail
Required arguments:
from: Sender email address (must be authorized in your org’s SMTP configuration).to: List of recipient email addresses.subject: Email subject.cardId: ID of the card to attach the email to.
Optional arguments include repoId, html, text, cc, bcc, fromName, emailAttachments, state, and userId.
Example: create and send in one request
mutation CreateAndSendInboxEmail($from: String!, $to: [String!]!, $subject: String!, $html: String, $text: String, $repoId: ID, $cardId: ID!) {
createAndSendInboxEmail(
input: {
from: $from
to: $to
subject: $subject
html: $html
text: $text
repoId: $repoId
cardId: $cardId
}
) {
inboxEmail {
id
from
subject
state
}
emailSent
}
}
Variables:
{
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Project update",
"html": "<p>Here is the latest update on the project.</p>",
"text": "Here is the latest update on the project.",
"repoId": "987654321",
"cardId": "123456789"
}
Example response:
{
"data": {
"createAndSendInboxEmail": {
"inboxEmail": {
"id": "551991950",
"from": "[email protected]",
"subject": "Project update",
"state": "processed"
},
"emailSent": true
}
}
}
inboxEmail: The created inbox email (id, from, subject, state, etc.). When save fails, it can benull; the mutation still returnsemailSent: false.emailSent:trueif the email was sent successfully,falseotherwise (e.g. save succeeded but send failed).
Optional arguments
| Argument | Type | Description |
|---|---|---|
repoId | ID | Pipe (repo) ID. Optional. |
cc | [String] | Carbon copy addresses. |
bcc | [String] | Blind carbon copy addresses. |
fromName | String | Sender display name. |
html | String | HTML body. |
text | String | Plain text body. |
emailAttachments | [Input] | Attachment metadata (e.g. fileName, fileUrl, publicUrl). |
state | String | Inbox email state (e.g. pending, processing, processed, failed). |
userId | ID | User ID of the creator. |
Errors
- Authorization: If the current user cannot manage the inbox email or read the SMTP configuration, the request returns a permission error.
- Rate limits: Sending may be subject to rate limits; the API can return a usage limit error.
- SMTP / delivery: If sending fails (e.g. SMTP error, blocked email), the mutation may raise or return
emailSent: falseand an error message in the response.
