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

#  Upload Demand Forecast

Upload demand forecasts for one or more roles.

Demand is the number of staff needed during a 15-minute window, the same
staffing level consumed by the autoscheduler and coverage metrics. A row
spanning more than 15 minutes applies its demand to every 15-minute window
in its range: a day-long row with a demand of 4 means 4 staff are needed
throughout that day.

startDate and endDate must be ISO-8601 strings with an explicit timezone
offset and fall on 15-minute boundaries (:00, :15, :30 or :45). Rows may
be supplied in any order, but rows for the same role must not overlap.
A single request may create at most 50000
15-minute windows (a full year for one role is roughly 35,000).

Any existing forecast data between each role's first startDate and last
endDate is replaced.

The body may be sent as application/json, or as text/csv with a header
row containing the columns: role, startDate, endDate, demand.


## OpenAPI

````yaml /openapi.json post /v1/forecasting/demand
openapi: 3.1.0
info:
  version: 1.0.0
  title: Untether Labs API
servers:
  - url: https://app.untetherlabs.com/api
    description: Untether Labs Production API
    x-speakeasy-server-id: production
security:
  - BearerAuth: []
paths:
  /v1/forecasting/demand:
    post:
      summary: ' Upload Demand Forecast'
      operationId: v1_forecasting_demand_uploadDemandForecast
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadDemandForecastRequest'
          text/csv:
            schema:
              type: string
              description: >-
                CSV text with a header row containing the columns: role,
                startDate, endDate, demand.
      responses:
        '201':
          description: ''
        '400':
          description: >-
            We follow the
            [RFC-9457](https://www.rfc-editor.org/rfc/rfc9457.html) Problem
            Detail specification for error responses.


            Errors should be identified by their `type` field. You can view
            extensions for each error response below.
          content:
            application/problem+json:
              schema:
                oneOf:
                  - allOf:
                      - type: object
                        properties:
                          type:
                            type: string
                          status:
                            type: integer
                            description: Always the HTTP status code of the response
                            example: 400
                          title:
                            type: string
                            description: >-
                              A short, human-readable summary of the problem
                              type
                          detail:
                            type: string
                            description: >-
                              A human-readable explanation specific to this
                              occurrence of the problem
                            example: >-
                              The specified provider does not satisfy the skill
                              requirements for this shift.
                        required:
                          - type
                          - status
                          - title
                      - type: object
                        properties:
                          path:
                            type: string
                          message:
                            type: string
                          type:
                            type: string
                            enum:
                              - >-
                                https://developers.untetherlabs.com/errors#validation
                          title:
                            type: string
                            example: Input validation failed.
                        required:
                          - message
                          - type
                          - title
                    title: Validation
        '404':
          description: >-
            We follow the
            [RFC-9457](https://www.rfc-editor.org/rfc/rfc9457.html) Problem
            Detail specification for error responses.


            Errors should be identified by their `type` field. You can view
            extensions for each error response below.
          content:
            application/problem+json:
              schema:
                oneOf:
                  - allOf:
                      - type: object
                        properties:
                          type:
                            type: string
                          status:
                            type: integer
                            description: Always the HTTP status code of the response
                            example: 400
                          title:
                            type: string
                            description: >-
                              A short, human-readable summary of the problem
                              type
                          detail:
                            type: string
                            description: >-
                              A human-readable explanation specific to this
                              occurrence of the problem
                            example: >-
                              The specified provider does not satisfy the skill
                              requirements for this shift.
                        required:
                          - type
                          - status
                          - title
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - >-
                                https://developers.untetherlabs.com/errors#role-not-found
                          title:
                            type: string
                            example: A specified role does not exist in the system.
                        required:
                          - type
                          - title
                    title: Role Not Found
components:
  schemas:
    UploadDemandForecastRequest:
      type: array
      items:
        $ref: '#/components/schemas/UploadDemandForecastRow'
    UploadDemandForecastRow:
      type: object
      properties:
        role:
          type: string
          format: uuid
        startDate:
          type: string
          example: 2024-11-20T07:43:34+0000
        endDate:
          type: string
          example: 2024-11-20T07:43:34+0000
        demand:
          type: number
          minimum: 0
      required:
        - role
        - startDate
        - endDate
        - demand
      id: UploadDemandForecastRow
      x-speakeasy-group: v1.forecasting
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````