List email templates for a pipe

Fetch a paginated list of email templates for a given repo, with optional filter by name.

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: You must have permission to show the pipe/table (repo).
  3. Repo ID: Identify the pipe or table whose email templates you want to list.

Step 1: Find Your Repo ID

See our Get resource IDs page for how to find the pipe or table ID.

1. Via Pipefy UI

  • Open the pipe or table in your browser; the ID appears in the URL (e.g. https://app.pipefy.com/pipes/10805973).

2. Via GraphQL Query

  • Use the appropriate query to fetch your organization's pipes or tables and obtain the repo ID.

Step 2: Query Email Templates

Use the emailTemplates query to list email templates for a repo. Results are ordered by default template first, and support pagination (max 50 per page). Below is an example:

{
  emailTemplates(repoId: "10805973") {
    edges {
      cursor
      node {
        id
        name
        subject
        body
        fromEmail
        fromName
        toEmail
        ccEmail
        bccEmail
        repoId
        defaultTemplate
        hasInsecureContent
      }
    }
  }
}

To filter by template name (case-insensitive partial match):

{
  emailTemplates(repoId: "10805973", filterByName: "Follow-up") {
    edges {
      cursor
      node {
        id
        name
        subject
        body
        fromEmail
        fromName
        toEmail
        ccEmail
        bccEmail
        repoId
        defaultTemplate
        hasInsecureContent
      }
    }
  }
}

To paginate, use first and after (see Pagination basics for details):

{
  emailTemplates(repoId: "10805973", first: 10, after: "cursor-from-previous-page") {
    edges {
      cursor
      node {
        id
        name
        subject
      }
    }
  }
}

Key Fields Explained:

  • edges: List of connection edges; each has a cursor (for pagination) and a node (the template).
  • node.id: Email template unique identifier.
  • node.name: Name of the template.
  • node.subject: Subject line (may contain placeholders).
  • node.body: HTML body (may contain placeholders).
  • node.fromEmail: Sender email address (nullable).
  • node.fromName: Sender display name (nullable).
  • node.toEmail: To addresses (nullable).
  • node.ccEmail: CC addresses (nullable).
  • node.bccEmail: BCC addresses (nullable).
  • node.repoId: ID of the pipe/table where the template resides.
  • node.defaultTemplate: Whether this is the default template.
  • node.hasInsecureContent: Whether the template body contains insecure content.

Step 3: Execute and Interpret the Response

After running the query, you'll receive a structured JSON response. Here's an example:

{
  "data": {
    "emailTemplates": {
      "edges": [
        {
          "cursor": "abc123",
          "node": {
            "id": "42",
            "name": "Follow-up",
            "subject": "Following up on your request",
            "body": "<p>Hello {{card.title}}</p>",
            "fromEmail": "[email protected]",
            "fromName": "Support",
            "toEmail": null,
            "ccEmail": null,
            "bccEmail": null,
            "repoId": "10805973",
            "defaultTemplate": true,
            "hasInsecureContent": false
          }
        }
      ]
    }
  }
}

This query provides a quick and effective way to list all email templates for a pipe or table, optionally filtered by name, with cursor-based pagination (up to 50 items per page).