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

# Create a schedule



## OpenAPI

````yaml /api-reference/openapi.json post /schedules
openapi: 3.1.0
info:
  title: Gecko Security API
  version: 1.0.0
  description: >-
    Programmatic access to scans, vulnerabilities, repositories, schedules,
    webhooks, and scanner image releases. Authenticate with an API key via the
    `X-API-Key` header or `Authorization: Bearer <key>`.
servers:
  - url: https://app.gecko.security/api/v1
security:
  - ApiKeyHeader: []
  - BearerAuth: []
paths:
  /schedules:
    post:
      summary: Create a schedule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduleRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Authorization error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateScheduleRequest:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        name:
          type: string
          minLength: 1
        repository_ids:
          minItems: 1
          type: array
          items:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        cron_expression:
          type: string
          minLength: 1
        branch:
          type: string
          minLength: 1
        timezone:
          type: string
          minLength: 1
        scan_mode:
          type: string
          enum:
            - full
            - diff
      required:
        - name
        - repository_ids
        - cron_expression
      additionalProperties: false
    Schedule:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        object:
          type: string
          const: schedule
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        name:
          type: string
        repository_ids:
          type: array
          items:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        branch:
          anyOf:
            - type: string
            - type: 'null'
        cron_expression:
          type: string
        timezone:
          anyOf:
            - type: string
            - type: 'null'
        scan_mode:
          type: string
        is_active:
          type: boolean
        next_run_at:
          anyOf:
            - type: string
            - type: 'null'
        last_run_at:
          anyOf:
            - type: string
            - type: 'null'
        created_at:
          type: string
      required:
        - object
        - id
        - name
        - repository_ids
        - branch
        - cron_expression
        - timezone
        - scan_mode
        - is_active
        - next_run_at
        - last_run_at
        - created_at
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            param:
              type: string
            doc_url:
              type: string
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - doc_url
            - request_id
      required:
        - error
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````