Create and send an inbox email in one request

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

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: Your token must have permission to manage inbox emails on the card and to read the SMTP configuration for the sender address.
  3. Card ID: The card to which the email will be linked (required).
  4. Pipe ID (repoId): The pipe where the card lives. In the API, the pipe is often referred to as repo; repoId is the pipe ID.
  5. Sender address: The from address must match an authorized SMTP configuration in your organization.

What This Mutation Does

The createAndSendInboxEmail mutation:

  1. Creates an inbox email record linked to the given card (and optional repo).
  2. Sends the email using your organization’s SMTP configuration for the from address.

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 is 123456789.
  • Pipe ID: From the pipe URL https://app.pipefy.com/pipes/987654321 → Pipe ID is 987654321 (use this as repoId).

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 be null; the mutation still returns emailSent: false.
  • emailSent: true if the email was sent successfully, false otherwise (e.g. save succeeded but send failed).

Optional arguments

ArgumentTypeDescription
repoIdIDPipe (repo) ID. Optional.
cc[String]Carbon copy addresses.
bcc[String]Blind carbon copy addresses.
fromNameStringSender display name.
htmlStringHTML body.
textStringPlain text body.
emailAttachments[Input]Attachment metadata (e.g. fileName, fileUrl, publicUrl).
stateStringInbox email state (e.g. pending, processing, processed, failed).
userIdIDUser 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: false and an error message in the response.