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

# Reserve Capacity

> Create a reservation policy. Times must be in 15-minute increments.



## OpenAPI

````yaml /api-reference/flex-compute/flex-api.json post /external/api/v1/flexcompute/reserve
openapi: 3.1.0
info:
  title: Cloudidr FlexCompute API
  description: API for managing compute schedule policies and capacity reservations.
  version: 1.0.0
servers:
  - url: https://public-api.cloudidr.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /external/api/v1/flexcompute/reserve:
    post:
      summary: Reserve Capacity
      description: Create a reservation policy. Times must be in 15-minute increments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - accountId
                - policyName
                - instanceType
                - platform
                - zoneId
                - quantity
                - startDate
                - endDate
                - startTime
                - endTime
                - utcOffsetHours
              properties:
                accountId:
                  type: string
                  description: AWS account ID
                policyName:
                  type: string
                  description: Name to assign to the reservation policy
                instanceType:
                  type: string
                  description: EC2 instance type to check (e.g., c5.large)
                platform:
                  type: string
                  default: Linux/UNIX
                  description: >-
                    OS/platform for the offering (e.g., Linux/UNIX, Windows
                    Server)
                zoneId:
                  type: string
                  description: >-
                    Availability Zone identifier to search within (e.g.,
                    usw2-az1, aps1-az1)
                quantity:
                  type: integer
                  minimum: 1
                  description: Number of instances to reserve (must be positive)
                startDate:
                  type: string
                  pattern: ^\d{2}/\d{2}/\d{4}$
                  description: Reservation start date, format MM/dd/yyyy (e.g., 12/20/2024)
                endDate:
                  type: string
                  pattern: ^\d{2}/\d{2}/\d{4}$
                  description: Reservation end date, format MM/dd/yyyy (e.g., 12/25/2024)
                startTime:
                  type: string
                  pattern: ^\d{2}:\d{2}$
                  description: Reservation start time, format HH:mm (24-hour, e.g., 09:30)
                endTime:
                  type: string
                  pattern: ^\d{2}:\d{2}$
                  description: Reservation end time, format HH:mm (24-hour, e.g., 23:15)
                utcOffsetHours:
                  type: string
                  description: Client UTC offset in hours (range -18 to 18)
                autoRenewalEnabled:
                  type: boolean
                  default: false
                  description: Enables auto-renewal for the policy
                autoRenewalFrequency:
                  type: string
                  enum:
                    - one-day
                    - one-week
                    - one-month
                  description: >-
                    Auto-renewal frequency (required when autoRenewalEnabled is
                    true)
            example:
              accountId: '014876987943'
              zoneId: usw2-az1
              policyName: Volod test policy
              instanceType: c5.large
              platform: Linux/UNIX
              startDate: 01/10/2026
              endDate: 01/12/2026
              startTime: '00:00'
              endTime: '23:15'
              utcOffsetHours: '-8'
              quantity: 2
      responses:
        '200':
          description: Success - Reservation was successful
          content:
            application/json:
              example:
                myPolicy:
                  cidrId: sc_830349911839
                  policyName: Volod test policy
                  cspAccountName: personal AWS
                  policyStatus: READY_FOR_PURCHASE
                  policyOperatingState: IDLE
                  policyInstance:
                    id: 1688
                    instanceType: c5.large
                    platformCode: Linux/UNIX
                    tenancyCode: DEDICATED
                    vcpu: 2
                    memory: 4
                    gpu: 0
                    gpuMemory: 0
                    qty: 2
                  cspRegion:
                    regionCode: us-west-2
                    regionType: PRIMARY
                    availabilityZoneId: usw2-az1
                  createdDate: '2026-01-08T15:20:15.64868Z'
                  capacityConfiguration:
                    launchDateTime: '2026-01-10T00:00:00-08:00'
                    endDateTime: '2026-01-12T23:15:00-08:00'
                    autoRenewalEnabled: false
                    frequency: null
                    vpc: default
                    securityGroups: none
                    amiImage: default
                    sshPairKey: none
                    ebsVolumeSize: 10
                  pricing:
                    ourPrice: 8.48
                    cspProviderPrice: 12.11
                    savings: 3.63
                    savingsPercentage: 0.3
                    creditCardProcessingFee: 0.55
                    bankAccountProcessingFee: 0.07
                capacityAvailable: true
                alternativeQtyRecommendations: []
                alternativeTimeRecommendations: []
                alternativeTypeRecommendations: []
        '400':
          description: Bad Request - Invalid time format or parameters
          content:
            application/json:
              example:
                error:
                  code: '400'
                  message: Bad Request
                  details:
                    timestamp: '2026-01-08T15:23:53'
                    description: End time minute must be 0, 15, 30, or 45
        '401':
          description: Unauthorized - Unable to process access token
          content:
            application/json:
              example:
                error:
                  code: '401'
                  message: Unauthorized
                  details:
                    timestamp: '2025-03-04T17:01:01'
                    description: Unable to process access token
        '404':
          description: Not Found - The specified instance type does not exist
          content:
            application/json:
              example:
                error:
                  code: '404'
                  message: Not Found
                  details:
                    timestamp: '2026-01-08T14:43:14'
                    description: >-
                      Supported instance type c5.large1 and platform Linux/UNIX
                      not found
        '500':
          description: Internal Server Error - Unexpected error occurred
          content:
            application/json:
              example:
                error:
                  code: '500'
                  message: Internal Server Error
                  details:
                    timestamp: '2025-03-04T17:17:08'
                    description: Unexpected error. Our team is working on it
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````