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

# Schedule by price limit

> Find the lowest- or highest-cost periods by setting a maximum acceptable price.

For example, you schedule EV charging between when electricity price is below $0.15



## OpenAPI

````yaml api-reference/anode/flatpeak-api-spec-anode.json POST /schedules/limit/{id}
openapi: 3.0.3
info:
  description: Flatpeak API
  version: 2025-09-14.anode
  title: Flatpeak API
  termsOfService: https://flatpeak.com/legal
  contact:
    name: Technical Support
    email: support@flatpeak.com
    url: https://flatpeak.com/contact
  license:
    name: Apache 2.0
    url: https://flatpeak.com/legal
servers:
  - url: https://api.flatpeak.com
    description: Location
security: []
tags:
  - name: Consumption
    description: Consumption operations
  - name: Customers
    description: Customer operations
  - name: Devices
    description: Device operations
  - name: Meters
    description: Meter readings operations
  - name: Events
    description: Events operations
  - name: Login
    description: Bearer auth token operations
  - name: Connect
    description: Connect operations
  - name: Locations
    description: Location operations
  - name: Rates
    description: Rates operations
  - name: Costs
    description: Consumption cost calculations
  - name: Schedules
    description: Consumption schedules
  - name: Tariffs
    description: Tariff operations
  - name: Slots
    description: Slots operations
externalDocs:
  description: Location documentation
  url: https://docs.flatpeak.com
paths:
  /schedules/limit/{id}:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Flatpeak `location_id`.
    post:
      tags:
        - Schedules
      summary: Schedule by price limit
      description: >-
        Find the lowest- or highest-cost periods by setting a maximum acceptable
        price.


        For example, you schedule EV charging between when electricity price is
        below $0.15
      operationId: schedule-by-limit
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/ScheduleByLimitCreate'
      responses:
        '200':
          $ref: '#/components/responses/ScheduleByLimit'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
      security:
        - bearerAuth: []
components:
  requestBodies:
    ScheduleByLimitCreate:
      content:
        application/json:
          schema:
            type: object
            properties:
              start_time:
                type: string
                x-stoplight:
                  id: zxh4l4kuhyp3w
                description: >-
                  RFC 3339 timestamp marking the start of the data window, e.g.
                  2023-06-15T09:00:00Z or 2023-06-15T08:00:00+01:00; use either
                  UTC or time offset—if offsets differ, end_time takes
                  precedence.
                example: '2023-06-15T09:00:00Z'
                format: date-time
              end_time:
                type: string
                x-stoplight:
                  id: f2nwuxivtcpuc
                description: >-
                  RFC 3339 timestamp marking the start of the data window, e.g.
                  2023-06-15T09:00:00Z or 2023-06-15T08:00:00+01:00; use either
                  UTC or time offset—if offsets differ, end_time takes
                  precedence. The maximum period between start_time and end_time
                  for a single request is 3 days.
                example: '2023-06-16T09:00:00Z'
                format: date-time
              direction:
                type: string
                x-stoplight:
                  id: y64mrlvmh4yc8
                description: >-
                  Indicates the direction you want to work with. Set to `IMPORT`
                  or `EXPORT`. Defaults to `IMPORT`.
                example: IMPORT
              segment:
                type: string
                x-stoplight:
                  id: bgvpzqifixhz8
                description: >-
                  Set to `HIGH` to get the most expensive rate segment and to
                  `LOW` to get the cheapest segment.
                example: HIGH
              relative:
                type: number
                x-stoplight:
                  id: 2jyepypq7fiy1
                description: >-
                  Relative tariff threshold. The highest tariff is `1`, and the
                  lowest is `0.01`. Either relative or absolute must be
                  provided.
                example: 0.1
              absolute:
                type: number
                x-stoplight:
                  id: npgec2fxwav2u
                description: >-
                  Absolute tariff threshold in local currency. Either absolute
                  or relative must be provided. Absolute threshold overrides
                  relative if it was provided. Use major currency units.
                default: 0.17
            required:
              - start_time
              - end_time
              - segment
  responses:
    '403':
      description: 403 forbidden
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Bad credentials
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: gria4ysjd9zhk
                default: error
              type:
                type: string
                x-stoplight:
                  id: 7mhtfljidnqcu
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: sy7ljpdy5wdes
                example: access_denied
                default: access_denied
              time_created:
                type: string
                x-stoplight:
                  id: 84d5biv9dfbc9
                format: date-time
                example: '2025-01-01T00:00:00Z'
            required:
              - object
              - type
              - code
          examples: {}
    '422':
      description: 422 Data not available
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                object: error
                type: api_error
                live_mode: false
                time_created: '2022-01-24T14:15:22.003'
                code: country_code_missing
                message: Country code is required
            properties:
              object:
                type: string
                x-stoplight:
                  id: 8tu6jw6w7a4ds
                default: error
                example: error
              type:
                type: string
                x-stoplight:
                  id: pi73vu0gm23xz
                example: invalid_request
                default: invalid_request
              context:
                type: string
                x-stoplight:
                  id: 86mrnnt9y68p9
                example: api.price_get
              code:
                type: string
                x-stoplight:
                  id: yvmrv5mczcj3f
                example: no_tariff_connected
              message:
                type: string
                x-stoplight:
                  id: n8zx3cn5xogky
                example: No tariff connected for IMPORT direction
              time_created:
                type: string
                x-stoplight:
                  id: wffseagefabdy
                format: date-time
                example: '2025-01-01T00:00:00Z'
            required:
              - object
              - type
              - context
              - code
              - message
              - time_created
    '429':
      description: 429 Too many requests
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                x-stoplight:
                  id: irkmp11gg6sjx
                example: error
                default: error
              type:
                type: string
                x-stoplight:
                  id: u0gq12cizam3d
                default: rate_limit
                example: rate_limit
              code:
                type: string
                x-stoplight:
                  id: uh7x9404d4w3q
                default: too_many_requests
                example: too_many_requests
              message:
                type: string
                x-stoplight:
                  id: 9z8h79l1coblc
                default: Too many requests. Please retry after a short delay.
                example: Too many requests. Please retry after a short delay.
              time_created:
                type: string
                x-stoplight:
                  id: ea7o3uvdojrtc
                format: date-time
                default: '2026-01-29T17:11:52Z'
                example: '2026-01-29T17:11:52Z'
            required:
              - object
              - type
              - code
              - message
    ScheduleByLimit:
      description: Response example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SlotThreshold'
  schemas:
    SlotThreshold:
      type: object
      x-stoplight:
        id: 67o50ru9lhjm2
      x-examples: {}
      x-tags:
        - Rates
      title: ScheduleLimit
      description: This object is a container for tariff rate segments.
      properties:
        id:
          type: string
          description: Flatpeak unique object `id`.
          example: spl_65e42cdd73e9f861edda35d7
        object:
          type: string
          description: Represents the object's type.
          example: schedule_limit
        live_mode:
          type: boolean
          description: >-
            Has the value `true` if the object exists in live mode or the value
            false if the object exists in test mode.
        location_id:
          type: string
          description: The unique Flatpeak ID of the location.
          x-stoplight:
            id: 0grw6kx1kien5
          example: loc_65e42ce4d3b813479b252160
        location_timezone:
          type: string
          description: >-
            The timezone at the location, in 'tz database format'. I.e.
            'Europe/Berlin'.
          x-stoplight:
            id: qew0bifiwrkx7
          example: Europe/London
        currency_code:
          type: string
          description: Currency at the location in ISO 4217.
          x-stoplight:
            id: aomadeld01p2u
          example: EUR
        direction:
          type: string
          description: >-
            Direction of tariff. Supported options are `IMPORT`, `EXPORT` and
            `LOCAL`.
          x-stoplight:
            id: nwrbo35d5kqyt
          example: IMPORT
        duration:
          type: number
          x-stoplight:
            id: 3ufzouj9tfdlu
          description: Total amount of time in minutes for all calculated slots.
          example: 180
        next_update:
          type: string
          description: >-
            Time when we recommend fetching new rates. In the format of the
            request, e.g. UTC or time-offset.
          example: '2022-05-24T23:00:00Z'
        request:
          type: object
          x-stoplight:
            id: usyyuaku0isdq
          description: Your original request.
          required:
            - direction
            - segment
            - absolute
            - relative
            - start_time
            - end_time
          properties:
            direction:
              type: string
              x-stoplight:
                id: lthmqz8cvi15x
              example: IMPORT
              description: Indicates the tariff direction you requested.
            segment:
              type: string
              x-stoplight:
                id: klbkave2dcnbx
              example: HIGH
              description: Indicates HIGH or LOW segment that was requested.
            absolute:
              type: number
              x-stoplight:
                id: 94hzkqraqo1w3
              description: Indicates absolute tariff threshold you requested.
              example: 4.2
            relative:
              type: number
              x-stoplight:
                id: 4n9bk1w5kxltm
              example: 0.5
              description: Indicates the relative tariff threshold you requested.
            start_time:
              type: string
              x-stoplight:
                id: xnom9m5tlb24y
              description: >-
                Time when data will start. In the format of the request, e.g.
                UTC or time-offset.
              example: '2022-12-28T00:00:00Z'
            end_time:
              type: string
              x-stoplight:
                id: oenuzcm59eqo8
              description: >-
                Time when data will end. In the format of the request, e.g. UTC
                or time-offset.
              example: '2022-12-28T06:00:00Z'
        data:
          type: array
          description: Rates response data.
          items:
            type: object
            x-stoplight:
              id: atpz6bpok2p95
            properties:
              start_time:
                type: string
                description: >-
                  Time when tariff period starts, in timezone of the original
                  request.
                format: date-time
                example: '2022-12-28T01:00:00Z'
                x-stoplight:
                  id: 7dnjqix6bc3po
              end_time:
                type: string
                description: >-
                  Time when tariff period ends, in timezone of the original
                  request.
                format: date-time
                example: '2022-12-28T02:30:00Z'
                x-stoplight:
                  id: zei9yj17objar
              tariff:
                type: object
                description: Price object
                x-stoplight:
                  id: pn45sc7wo47c0
                required:
                  - confidence
                properties:
                  rate_avg:
                    type: number
                    description: The average price, in *large* currency units.
                    x-stoplight:
                      id: wp9jjm45ig076
                    example: 4.998
                  confidence:
                    type: number
                    description: >-
                      Estimated confidence of data where '1' is 100% accurate
                      and 0.1 is 10% accurate.
                    example: 1
            required:
              - start_time
              - end_time
              - tariff
        time_created:
          type: string
          description: Time when this response was calculated. In UTC.
          format: date-time
          example: '2022-05-24T15:15:22Z'
        account_id:
          type: string
          x-stoplight:
            id: js64f97p2gpks
          example: acc_661677911f2197045e6cf1b1
          description: Flatpeak account ID.
      required:
        - id
        - object
        - live_mode
        - location_id
        - location_timezone
        - currency_code
        - direction
        - duration
        - next_update
        - request
        - data
        - time_created
        - account_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with `bearer` you obtained from
        [authentication](/api-reference/anode/authentication) endpoint.

````