---
agentTools:
  projectIndex: https://developers.pipefy.com/llms.txt
---

# List Organization SMTP Custom Emails (paginated)

Retrieve the SMTP Custom Emails of an organization with cursor-based pagination.

## Before You Begin

🔗 **Use the [GraphQL Playground](https://app.pipefy.com/graphiql)** to execute the queries in this guide.

➡️ **New to GraphQL?** Learn how to navigate the Playground with our **[Playground Basics Guide](https://developers.pipefy.com/reference/exploring-the-playground)**.

## Why this use case

Use this query when an organization has many custom senders and you need to page through them with GraphQL cursor-based pagination. For a simple flat list (limited to 30 entries, default sender first), use **[List SMTP Custom Emails](https://developers.pipefy.com/reference/list-smtp-custom-emails)** instead.

***

## Prerequisites

1. **Authentication**: Use a [Service Account token](https://developers.pipefy.com/reference/service-accounts) (Personal Access Tokens are deprecated).
2. **Permissions**: Your token must be able to read SMTP custom emails in the target organization.
3. **IDs**: See our [Get resource IDs page](https://developers.pipefy.com/reference/get-resource-ids) for how to find the `organizationId`.

## Step 1: Run the query

```graphql
query OrganizationSmtpCustomEmails($organizationId: ID!, $first: Int, $after: String) {
  organizationSmtpCustomEmails(organizationId: $organizationId, first: $first, after: $after) {
    edges {
      node {
        id
        emailAddress
        senderName
      }
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
}
```

### Variables

```json
{
  "organizationId": "12345",
  "first": 20
}
```

## Step 2: Check the response

```json
{
  "data": {
    "organizationSmtpCustomEmails": {
      "edges": [
        {
          "node": {
            "id": 678,
            "emailAddress": "no-reply@yourcompany.com",
            "senderName": "Your Company"
          }
        }
      ],
      "pageInfo": {
        "endCursor": "MQ",
        "hasNextPage": true
      }
    }
  }
}
```

### Returned fields

| Field                       | Description                                                                                                                                                                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `edges[].node.id`           | The SMTP Custom Email ID — use it in **[Update](https://developers.pipefy.com/reference/update-smtp-custom-email)**, **[Delete](https://developers.pipefy.com/reference/delete-smtp-custom-email)**, and **[Set the Default Organization SMTP Custom Email](https://developers.pipefy.com/reference/set-default-organization-smtp-custom-email)** |
| `edges[].node.emailAddress` | The sender email address used for outbound messages                                                                                                                                                                                   |
| `edges[].node.senderName`   | The display name shown to recipients                                                                                                                                                                                                  |
| `pageInfo.endCursor`        | Cursor of the last returned email — pass it as `after` to fetch the next page                                                                                                                                                         |
| `pageInfo.hasNextPage`      | Whether more emails exist beyond this page                                                                                                                                                                                            |

## Step 3: Fetch the next page

Pass the previous `endCursor` as `after` to continue paging:

```json
{
  "organizationId": "12345",
  "first": 20,
  "after": "MQ"
}
```

## Implementation notes

* Results are ordered by sender name (ascending).
* The query returns an empty connection when the token cannot read SMTP custom emails in the organization.