---
updatedAt: 2025-11-06T16:48:54.000Z
agentTools:
  projectIndex: https://developer.peakon.com/llms.txt
---

# Get segments groups

Return the number of segments with engagement data grouped by attribute.

# OpenAPI definition

```json
{
  "info": {
    "version": "1.1.0",
    "title": "Peakon API",
    "description": "The Public Peakon API"
  },
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://{subdomain}.peakon.com/api/v1/",
      "variables": {
        "subdomain": {
          "description": "Unique subdomain assigned to your Peakon instance.",
          "default": "api"
        }
      }
    }
  ],
  "tags": [
    {
      "description": "Retrieving engagement scores",
      "name": "Engagement"
    }
  ],
  "paths": {
    "/engagement/contexts/{contextId}/segments/groups": {
      "get": {
        "tags": [
          "Engagement"
        ],
        "summary": "Get segments groups",
        "description": "Return the number of segments with engagement data grouped by attribute.",
        "parameters": [
          {
            "name": "contextId",
            "description": "A company or segment context id. Param is a `string` formatted as `company_[companyId]` or `segment_[segmentId]`.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "in": "path"
          },
          {
            "name": "filter[employee.segmentIds]",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "The array of segment ids that the result should be filtered for. The segment ids should be sent comma-separated and ending with \"$contains\".",
            "example": "22$contains",
            "in": "query"
          },
          {
            "name": "filter[question.driver]",
            "schema": {
              "type": "string",
              "enum": [
                "accomplishment",
                "autonomy",
                "collaboration",
                "communication",
                "engagement",
                "environment",
                "free_opinions",
                "goal_setting",
                "growth",
                "management_support",
                "meaningful_work",
                "organisational_fit",
                "peer_relationship",
                "recognition",
                "reward",
                "reward_recognition",
                "strategy",
                "workload"
              ]
            },
            "in": "query"
          },
          {
            "name": "filter[question.subdriver]",
            "schema": {
              "type": "string",
              "enum": [
                "accomplishment",
                "advocacy",
                "alignment",
                "belief",
                "belief_in_action",
                "belief_in_strategy",
                "burnout",
                "career_development",
                "career_path",
                "challenging",
                "collaboration",
                "communication",
                "cross_collaboration",
                "customer_satisfaction",
                "demand_for_skills",
                "distributive_fairness",
                "effective_systems",
                "effective_tools",
                "efficacy",
                "equality",
                "equipment",
                "expectancy_theory",
                "fair_rewards",
                "feel_accomplished",
                "feeling_energised",
                "finding_focus",
                "focus",
                "friendly",
                "goals",
                "health",
                "how",
                "how_to_work",
                "impact",
                "inclusive_culture",
                "informal",
                "interactional_fairness",
                "job_fit",
                "job_security",
                "job_significance",
                "known_expectations",
                "leadership_honesty",
                "learning",
                "learning_from_mistakes",
                "learning_resources",
                "loyalty",
                "manageable_work",
                "manager",
                "manager_support",
                "meaningful_work",
                "meeting_customer_needs",
                "mentoring",
                "mission",
                "multiple_perspectives",
                "one_to_ones",
                "openness",
                "opinions_matter",
                "opportunity",
                "performance",
                "pride_in_work",
                "procedural_fairness",
                "professional_growth",
                "recognition",
                "response",
                "safe_sharing_environment",
                "satisfaction",
                "self_confidence",
                "strategy",
                "support",
                "team",
                "timely_communication",
                "trying_new_things",
                "values",
                "values_fit",
                "when",
                "where",
                "willing_to_help",
                "work_environment",
                "work_meaning"
              ]
            },
            "in": "query"
          },
          {
            "name": "filter[question.valueId]",
            "schema": {
              "type": "integer"
            },
            "in": "query"
          },
          {
            "name": "filter[round.type]",
            "schema": {
              "type": "string",
              "default": "automatic",
              "enum": [
                "automatic",
                "test"
              ]
            },
            "description": "The type of rounds to include data for",
            "in": "query"
          }
        ],
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "A [JSONAPI resource](http://jsonapi.org/format/#document-resource-objects) of type 'engagement_segment_groups'",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/engagementSegmentGroups"
                    },
                    "included": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/resourceIdentifier"
                      },
                      "description": "An array of included JSONAPI resources"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "engagementSegmentGroups": {
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "attributes": {
            "properties": {
              "segmentCount": {
                "type": "integer"
              },
              "negativeCount": {
                "type": "integer"
              },
              "positiveCount": {
                "type": "integer"
              }
            }
          },
          "relationships": {
            "type": "object",
            "properties": {
              "attribute": {
                "type": "object",
                "properties": {
                  "data": {
                    "$ref": "#/components/schemas/resourceIdentifier"
                  }
                }
              }
            }
          }
        },
        "type": "object"
      },
      "resourceIdentifier": {
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "jwt": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```