{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Returns the requested segment analytics series data.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `2/m`<br>Daily: `225/d`\n\n**Scopes:**\n`segments:read`\n\n[OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/query_segment_series.json)","properties":{"query":{"type":"object","properties":{"fields[segment-series-report]":{"type":"array","items":{"type":"string","enum":["date_times","id","results"]},"description":"For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#sparse-fieldsets"}},"required":[],"additionalProperties":false},"headers":{"type":"object","properties":{"revision":{"type":"string","default":"2026-10-15","enum":["2026-10-15"],"description":"API endpoint revision (format: YYYY-MM-DD[.suffix])"}},"required":["revision"],"additionalProperties":false},"body":{"$ref":"#/definitions/SegmentSeriesRequestDTO"}},"required":["headers","body"],"additionalProperties":false,"definitions":{"SegmentSeriesRequestDTO":{"type":"object","properties":{"data":{"$ref":"#/definitions/SegmentSeriesRequestDTOResourceObject"}},"required":["data"]},"SegmentSeriesRequestDTOResourceObject":{"type":"object","properties":{"type":{"$ref":"#/definitions/SegmentSeriesReportEnum"},"attributes":{"type":"object","properties":{"statistics":{"description":"List of statistics to query for.","type":"array","items":{"type":"string","enum":["members_added","members_removed","net_members_changed","total_members"],"description":"Defined segment reporting metric"},"examples":[["total_members","net_members_changed"]]},"timeframe":{"description":"The time frame to pull data from (Max length: 1 year). Data is unavailable before June 1st, 2023. Please use a time frame after this date. See [available time frames](https://developers.klaviyo.com/en/reference/reporting_api_overview#available-time-frames).","oneOf":[{"$ref":"#/definitions/Timeframe"},{"$ref":"#/definitions/CustomTimeframe"}]},"interval":{"description":"The interval used to aggregate data within the series request.\nIf hourly is used, the timeframe cannot be longer than 7 days.\nIf daily is used, the timeframe cannot be longer than 60 days.\nIf monthly is used, the timeframe cannot be longer than 52 weeks.","type":"string","enum":["daily","hourly","monthly","weekly"],"examples":["weekly"]},"filter":{"description":"API filter string used to filter the query.\nAllowed filters are segment_id.\nAllowed operators are equals, any.\nOnly one filter can be used per attribute.\nMax of 100 messages per ANY filter.","type":["string","null"],"examples":["any(segment_id,[\"xyz123\",\"ghi456\"])"]}},"required":["statistics","timeframe","interval"]}},"required":["type","attributes"]},"SegmentSeriesReportEnum":{"type":"string","enum":["segment-series-report"]},"Timeframe":{"type":"object","properties":{"key":{"description":"Pre-defined key that represents a set timeframe","type":"string","enum":["last_12_months","last_30_days","last_365_days","last_3_months","last_7_days","last_90_days","last_month","last_week","last_year","this_month","this_week","this_year","today","yesterday"]}},"required":["key"]},"CustomTimeframe":{"type":"object","properties":{"start":{"description":"A datetime that represents the start of a custom time frame. Offset is ignored and the company timezone is used.","type":"string","format":"date-time","examples":["2022-11-08T00:00:00+00:00"]},"end":{"description":"A datetime that represents the end of a custom time frame. Offset is ignored and the company timezone is used.","type":"string","format":"date-time","examples":["2022-11-08T00:00:00+00:00"]}},"required":["start","end"]}}},"name":"Query Segment Series","id":"klaviyo.query_segment_series","example":{"headers":{"revision":"2026-10-15"},"body":{"data":{"type":"segment-series-report","attributes":{"statistics":["total_members","net_members_changed"],"timeframe":{"key":"last_12_months"},"interval":"weekly"}}}},"maxRequests":1,"summary":false}}