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

# Create a new schedule

> Create a new schedule for a specific project, pipeline and environment



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml post /v1/projects/{projectId}/schedules
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/projects/{projectId}/schedules:
    post:
      tags:
        - Schedules
      summary: Create a new schedule
      description: Create a new schedule for a specific project, pipeline and environment
      operationId: createSchedule
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            examples:
              Schedule Request:
                description: Schedule Request
                value:
                  pipeline:
                    pipelineName: Pipeline 1
                    environmentName: Dev Environment
                  schedule:
                    cronExpression: 0 * * ? * * *
                    cronTimezone: Europe/Dublin
                    effectiveFrom: '2022-05-19T12:37:44.000Z'
                    name: Nightly database backup
                    scheduleEnabled: false
              Schedule Request With Optional Agent:
                description: Schedule Request With Optional Agent
                value:
                  pipeline:
                    agentId: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    pipelineName: Dev Pipeline
                    environmentName: Dev Environment
                  schedule:
                    cronExpression: 0 * * ? * * *
                    cronTimezone: Europe/Dublin
                    effectiveFrom: '2022-05-19T12:37:44.000Z'
                    name: Nightly database backup
                    scheduleEnabled: false
              Schedule Request With Optional variable overrides:
                description: Schedule Request With Optional variable overrides
                value:
                  pipeline:
                    scalarVariables:
                      var1: value1
                    gridVariables:
                      gridVar:
                        - - col1
                    pipelineName: Dev Pipeline
                    environmentName: Dev Environment
                  schedule:
                    cronExpression: 0 * * ? * * *
                    cronTimezone: Europe/Dublin
                    effectiveFrom: '2022-05-19T12:37:44.000Z'
                    name: Nightly database backup
                    scheduleEnabled: false
              Schedule Request With Optional version name:
                description: Schedule Request With Optional version name
                value:
                  pipeline:
                    versionName: 1.0.1
                    pipelineName: Dev Pipeline
                    environmentName: Dev Environment
                  schedule:
                    cronExpression: 0 * * ? * * *
                    cronTimezone: Europe/Dublin
                    effectiveFrom: '2022-05-19T12:37:44.000Z'
                    name: Nightly database backup
                    scheduleEnabled: false
            schema:
              $ref: '#/components/schemas/ScheduleRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleResponse'
          description: Schedule created
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Wrong request parameters used
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unauthorized
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Pipeline not Found
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unexpected error occurred
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Gateway timeout
components:
  schemas:
    ScheduleRequest:
      type: object
      description: >-
        Schedule request body for creating a new scheduled request for the
        pipeline
      properties:
        pipeline:
          $ref: '#/components/schemas/ScheduledPipelineExecutionRequest'
          description: Pipeline and environment details
        schedule:
          $ref: '#/components/schemas/ScheduleRequestDetails'
          description: Scheduler details
      required:
        - pipeline
        - schedule
    ScheduleResponse:
      type: object
      properties:
        scheduleId:
          type: string
          description: >-
            The generated unique schedule Id used to identify a specific
            schedule
          example: a2239897-51f8-4c09-83ab-0b2c28bd5a37
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
    ScheduledPipelineExecutionRequest:
      type: object
      properties:
        agentId:
          type: string
          description: >-
            Optional agentId to execute the pipeline. If not specified the
            default agent for the provided environment will be used
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        environmentName:
          type: string
          description: Environment pipeline is published to
          example: Dev Env
          maxLength: 255
          minLength: 0
        gridVariables:
          type: object
          additionalProperties:
            type: array
            items:
              type: array
              items:
                type: string
          description: >-
            Optional map of grid variable names to two-dimensional string
            arrays, used to override grid variable values for this execution
            without modifying the published pipeline definition
        pipelineName:
          type: string
          description: Name of the pipeline to execute
          example: My pipeline
          minLength: 1
        scalarVariables:
          type: object
          additionalProperties:
            type: string
          description: >-
            Optional map of scalar variable names to their override values for
            this execution, without modifying the published pipeline definition
        versionName:
          type: string
          description: >-
            Optional artifact version name of the pipeline to execute. If not
            specified the latest version will be executed
          example: 1.1.0
      required:
        - environmentName
        - pipelineName
    ScheduleRequestDetails:
      type: object
      description: Schedule request body for creating a new scheduled request
      properties:
        allowConcurrentExecutions:
          type: boolean
          description: >-
            An optional boolean flag for whether the scheduled pipeline should
            be allowed to execute concurrently. If set to false the pipeline
            will not be executed if it is already running. This defaults to true
            if not specified.
          example: false
        cronExpression:
          type: string
          description: >-
            This is a cronExpression must be provided for a schedule. This
            should be cronExpression in the Quartz format.
          example: 0 * * ? * * *
        cronTimezone:
          type: string
          description: >
            An optional timezone region value to use with the schedule
            expression.


            If a timezone region is provided, it will be used to in combination
            with the cronExpression to

            determine the schedule run times in the specified timezone region.


            If no value is specified then this be set to UTC Zulu time to
            indicate +00:00 from the UTC Offset.
          example: Europe/Dublin
        effectiveFrom:
          type: string
          format: date-time
          description: >
            An optional date time value for when the schedule should start to
            run. If no value is specified then the

            effective from time will be set to when the schedule is created.


            If a effective from time is specified, this should be specified in
            the offset date time format as per ISO 8601.

            It should include an offset from UTC, specifying how far ahead or
            behind UTC the specified time is.


            The format of the date time will be one of the following:

            - "yyyy-MM-dd'T'HH:mm:ss+hh:mm" to represent a time ahead of UTC by
            +hh:mm

            - "yyyy-MM-dd'T'HH:mm:ss-hh:mm" to represent a time behind of UTC by
            -hh:mm

            - "yyyy-MM-dd'T'HH:mm:ssZ" to represent a time in UTC


            For example 2022-01-01T12:00:00+02:00 represents two hours ahead of
            UTC time 2022-01-01T10:00:00Z
          example: '2022-05-19T11:37:44.024Z'
        name:
          type: string
          description: The user provided name for the schedule
          example: Nightly database backup
        scheduleEnabled:
          type: boolean
          description: >-
            An optional enabled boolean flag for whether the schedule should be
            enabled. This defaults to true if not specified.
          example: false
      required:
        - cronExpression
        - name
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````