> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketflows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve the segment usage for a business



## OpenAPI

````yaml /openapi.json get /businesses/{id}/segment_usage
openapi: 3.0.3
info:
  title: Pocketflows API
  version: 0.0.4
servers:
  - url: https://api.pocketflows.com
    description: Production server
security:
  - HttpBasicAuth: []
paths:
  /businesses/{id}/segment_usage:
    get:
      tags:
        - Segment usage
      summary: Retrieve the segment usage for a business
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: The ID of the business
          required: true
        - in: query
          name: start_time
          schema:
            type: string
          description: >-
            The start time of the usage period. Provided as a string in ISO 8601
            format.
          required: false
        - in: query
          name: end_time
          schema:
            type: string
          description: >-
            The end time of the usage period. Provided as a string in ISO 8601
            format.
          required: false
      responses:
        '200':
          description: The segment usage for the business within the time window
          content:
            application/json:
              schema:
                type: object
                properties:
                  sms:
                    type: integer
                    description: The number of SMS segments sent
                  mms:
                    type: integer
                    description: The number of MMS segments sent
                  email:
                    type: integer
                    description: The number of email segments sent
                  scheduled_segment_usage:
                    type: object
                    properties:
                      sms:
                        type: integer
                        description: The number of scheduled SMS segments
                      mms:
                        type: integer
                        description: The number of scheduled MMS segments
                      email:
                        type: integer
                        description: The number of scheduled email segments
                    required:
                      - sms
                      - mms
                      - email
                    description: The scheduled segment usage for campaigns not yet sent
                  in_progress_segment_usage:
                    type: object
                    properties:
                      sms:
                        type: integer
                        description: The number of in-progress SMS segments remaining
                      mms:
                        type: integer
                        description: The number of in-progress MMS segments remaining
                      email:
                        type: integer
                        description: The number of in-progress email segments remaining
                    required:
                      - sms
                      - mms
                      - email
                    description: The estimated segment usage for in-progress campaigns
                  start_time:
                    type: string
                    description: The start time of the usage period in ISO 8601 format
                  end_time:
                    type: string
                    description: The end time of the usage period in ISO 8601 format
                required:
                  - sms
                  - mms
                  - email
                  - scheduled_segment_usage
                  - in_progress_segment_usage
                  - start_time
                  - end_time
components:
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````