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

# Get Organization Reports

Retrieve all organization reports for a specific organization

## 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)**.

## Prerequisites

1. **Authentication**: Use a [Service Account token](https://developers.pipefy.com/reference/service-accounts) (Personal Access Tokens are deprecated).
2. **Permissions**: Ensure your token has the necessary permissions to access the organization.
3. **Organization ID**: Identify the Organization you want to fetch reports for.

## Step 1: Find The Organization ID

1. **Via Pipefy UI:**

   1. Open the Organization in your browser.
   2. The URL will include the Organization ID: `https://app.pipefy.com/organizations/987654321`.
   3. **Organization ID = `987654321`** (the number after `/organizations/`).

2. **Via GraphQL Query:**
   1. [How to get the organization ID.](https://developers.pipefy.com/reference/get-resource-ids#organization-id)

## Step 2: Query Organization Reports

Execute the `organizationReports` query to retrieve all reports of the organization:

```graphql
{
  organizationReports(organizationId: 123456789) {
    edges {
      node {
        id
        name
        cardCount
        color
        createdAt
        lastUpdatedAt
        fields
        filter
        sortBy {
          field
          direction
        }
        repos {
          id
          name
        }
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

### Response Example

```json
{
  "data": {
    "organizationReports": {
      "edges": [
        {
          "node": {
            "id": "456789123",
            "name": "Sales Pipeline Report",
            "cardCount": 1250,
            "color": "#FF6B6B",
            "createdAt": "2024-01-15T10:30:00Z",
            "lastUpdatedAt": "2024-03-13T14:45:00Z",
            "fields": ["title", "status", "assignee", "due_date"],
            "filter": {
              "status": ["in_progress", "review"]
            },
            "sortBy": {
              "field": "due_date",
              "direction": "ASC"
            },
            "repos": [
              {
                "id": "789123456",
                "name": "Sales Pipeline"
              },
              {
                "id": "789123457",
                "name": "Lead Management"
              }
            ]
          }
        },
        {
          "node": {
            "id": "456789124",
            "name": "Marketing Campaigns",
            "cardCount": 89,
            "color": "#4ECDC4",
            "createdAt": "2024-02-20T09:15:00Z",
            "lastUpdatedAt": "2024-03-12T16:20:00Z",
            "fields": ["title", "campaign_type", "budget", "start_date"],
            "filter": null,
            "sortBy": {
              "field": "start_date",
              "direction": "desc"
            },
            "repos": [
              {
                "id": "789123458",
                "name": "Marketing Campaigns"
              }
            ]
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
        "endCursor": "YXJyYXljb25uZWN0aW9uOjE="
      }
    }
  }
}
```

## Key Fields Explained

### Report Information

* `id`: Unique identifier for the report
* `name`: Display name of the report
* `cardCount`: Total number of cards included in the report
* `color`: Hex color code for the report's visual representation
* `createdAt`: Timestamp when the report was created
* `lastUpdatedAt`: Timestamp when the report was last modified

### Report Configuration

* `fields`: Array of field names to display in the report
* `filter`: JSON object containing filter criteria applied to the report
* `sortBy`: Object defining how cards are sorted in the report
  * `field`: The field name to sort by
  * `direction`: Sort direction (`asc` or `desc`)

### Associated Resources

* `repos`: Array of pipes/repositories included in the report
  * `id`: Pipe ID
  * `name`: Pipe name

### Pagination

The `organizationReports` query uses pagination. Refer to our [Pagination basics page](https://developers.pipefy.com/reference/pagination-basics) to understand more about how it works.

* `pageInfo`: Pagination information for handling large result sets
  * `hasNextPage`: Boolean indicating if more results are available
  * `hasPreviousPage`: Boolean indicating if previous results exist
  * `startCursor`: Cursor for the first item in the current page
  * `endCursor`: Cursor for the last item in the current page

## Notes

* **Pagination**: The query supports pagination with a maximum page size of 300 items