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

# Bulk Create Schedules

> Create multiple schedules in a single request. The body is a JSON array of schedule objects (1-1000). Validation is all-or-nothing: if any entry is invalid or the batch exceeds a plan limit, no schedules are created.



## OpenAPI

````yaml POST /schedules/bulk
openapi: 3.1.0
info:
  title: Cronhost API
  description: >-
    Schedule HTTP requests with cron expressions. Cronhost allows you to
    automate HTTP requests on a schedule using familiar cron syntax.
  license:
    name: MIT
  version: 1.0.0
  contact:
    name: Cronhost Support
    email: help@cronho.st
    url: https://cronho.st
servers:
  - url: https://cronho.st/api/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Schedules
    description: Create, manage, and control scheduled HTTP requests
  - name: Jobs
    description: Monitor and retrieve job execution details
  - name: Notification Channels
    description: Manage the destinations that receive schedule alerts
  - name: Schedule Notifications
    description: Configure which outcomes notify you per schedule
paths:
  /schedules/bulk:
    post:
      tags:
        - Schedules
      summary: Bulk Create Schedules
      description: >-
        Create multiple schedules in a single request. The body is a JSON array
        of schedule objects (1-1000). Validation is all-or-nothing: if any entry
        is invalid or the batch exceeds a plan limit, no schedules are created.
      operationId: bulkCreateSchedules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              maxItems: 1000
              items:
                $ref: '#/components/schemas/CreateScheduleRequest'
            examples:
              twoSchedules:
                summary: Create two schedules
                value:
                  - name: Morning Sync
                    cronExpression: 0 6 * * *
                    timezone: UTC
                    endpoint: https://api.example.com/sync
                    httpMethod: POST
                  - name: Nightly Cleanup
                    cronExpression: 0 2 * * *
                    timezone: UTC
                    endpoint: https://api.example.com/cleanup
                    httpMethod: POST
      responses:
        '201':
          description: Schedules created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    required:
                      - count
                      - schedules
                    properties:
                      count:
                        type: integer
                        description: Number of schedules created
                        example: 2
                      schedules:
                        type: array
                        items:
                          type: object
                          required:
                            - id
                            - name
                          properties:
                            id:
                              type: string
                              example: schedule_123
                            name:
                              type: string
                              example: Morning Sync
                  success:
                    type: boolean
                    example: true
                required:
                  - data
                  - success
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/PlanLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateScheduleRequest:
      type: object
      required:
        - name
        - cronExpression
        - timezone
        - endpoint
        - httpMethod
      properties:
        name:
          type: string
          description: Human-readable schedule name
          example: Daily Health Check
          minLength: 1
          maxLength: 255
        description:
          type: string
          description: Optional description of what the schedule does
          example: Check API health every day at 9 AM
          maxLength: 1000
        cronExpression:
          type: string
          description: Valid cron expression defining when to run
          example: 0 9 * * *
        timezone:
          type: string
          description: IANA timezone identifier
          example: America/New_York
        endpoint:
          type: string
          format: uri
          description: Target HTTP endpoint URL
          example: https://api.example.com/health
        httpMethod:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
          description: HTTP method to use for the request
          example: GET
        body:
          type: string
          description: Request body for POST/PUT/PATCH requests
          example: '{"key": "value"}'
        headers:
          type: string
          description: HTTP headers as JSON string
          example: >-
            {"User-Agent": "Cronhost-Monitor", "Content-Type":
            "application/json"}
        maxRetries:
          type: integer
          description: >-
            Total attempts including the first. Accepted values are clamped to
            1-10 (0 becomes 1); out-of-range values are never rejected. Retries
            fire only for 5xx, 408, 429, timeouts, and network errors.
          example: 3
          default: 3
        timeoutSeconds:
          type: integer
          description: >-
            Request timeout in seconds. Accepted values are clamped to 1-300;
            out-of-range values are never rejected.
          example: 30
          default: 30
        expectedStatusCodes:
          type: string
          description: >-
            Optional. Comma-separated 3-digit status codes and ranges counted as
            success (e.g. "200-299,410"). Omit or leave blank to use the default
            rule (status < 400).
          example: 200-299,410
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - code
          properties:
            message:
              type: string
              description: Human-readable error message
            code:
              type: string
              description: Error code for programmatic handling
            details:
              description: Additional error details
  responses:
    ValidationError:
      description: Validation error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            error:
              message: Validation error
              code: VALIDATION_ERROR
              details:
                fieldErrors:
                  cronExpression:
                    - Invalid cron expression
                  endpoint:
                    - Must be a valid URL
    UnauthorizedError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  message: Missing x-api-key header
                  code: UNAUTHORIZED
            invalidApiKey:
              summary: Invalid API key
              value:
                error:
                  message: Invalid API key
                  code: UNAUTHORIZED
    PlanLimitError:
      description: >-
        The request exceeds a plan limit or uses a feature not available on the
        current plan
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            error:
              message: Your plan does not allow this notification option.
              code: PLAN_LIMIT_EXCEEDED
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            error:
              message: Internal server error
              code: INTERNAL_ERROR
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get your API key from the [Cronhost
        dashboard](https://cronho.st/settings).

````