# updateSchedule

```graphql
mutation UpdateSchedule($projectReference: String!, $scheduleId: ID!, $input: UpdateScheduleInput!) {
  updateSchedule(projectReference: $projectReference, scheduleId: $scheduleId, input: $input) {
    id
    projectId
    name
    status
    target {
      kind
      id
      conversationMode
      conversationId
    }
    schedule
    timezone
    runtimeTargetKind
    runtimeTargetEnvironmentId
    runtimeTargetBranchId
    config
    timeoutSeconds
    backoffLimit
    concurrencyPolicy
    definitionSource
    sourceTriggerId
    sourcePath
    sourceHash
    lastScheduledAt
    lastSuccessfulAt
    health
    maxRuns
    runCount
    completedAt
    pausedReason
    pausedAt
    lastFailureAt
    lastFailureCode
    lastFailureMessage
    lastFailureRunId
    createdBy
    integrationRequirements {
      integration
      requiredScopes
    }
    createdAt
    updatedAt
  }
}
```

Change the fields of a schedule, or pause and resume it with the status, where an omitted field keeps its value; returns the updated schedule. Requires project.runs.write.

## Arguments

| Name                               | Type                      | Required | Description                                            |
| ---------------------------------- | ------------------------- | -------- | ------------------------------------------------------ |
| `projectReference`                 | String!                   | Yes      |                                                        |
| `scheduleId`                       | ID!                       | Yes      |                                                        |
| `input`                            | UpdateScheduleInput!      | Yes      |                                                        |
| `input.name`                       | String                    |          |                                                        |
| `input.target`                     | ScheduleTargetInput       |          |                                                        |
| `input.schedule`                   | String                    |          |                                                        |
| `input.timezone`                   | String                    |          |                                                        |
| `input.status`                     | ScheduleUpdateStatus      |          | One of `active`, `paused`.                             |
| `input.runtimeTargetKind`          | RuntimeTargetKind         |          | One of `main_branch`, `environment`, `preview_branch`. |
| `input.runtimeTargetEnvironmentId` | ID                        |          |                                                        |
| `input.runtimeTargetBranchId`      | ID                        |          |                                                        |
| `input.config`                     | JSON                      |          |                                                        |
| `input.timeoutSeconds`             | Int                       |          |                                                        |
| `input.backoffLimit`               | Int                       |          |                                                        |
| `input.concurrencyPolicy`          | ScheduleConcurrencyPolicy |          | One of `allow`, `forbid`, `replace`.                   |
| `input.maxRuns`                    | Int                       |          |                                                        |

## Variables

```json
{
  "projectReference": "string",
  "scheduleId": "string",
  "input": {}
}
```

## Responses

| Status | Description                           |
| ------ | ------------------------------------- |
| 200    | The Schedule! in data.updateSchedule. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateSchedule($projectReference: String!, $scheduleId: ID!, $input: UpdateScheduleInput!) {\n  updateSchedule(projectReference: $projectReference, scheduleId: $scheduleId, input: $input) {\n    id\n    projectId\n    name\n    status\n    target {\n      kind\n      id\n      conversationMode\n      conversationId\n    }\n    schedule\n    timezone\n    runtimeTargetKind\n    runtimeTargetEnvironmentId\n    runtimeTargetBranchId\n    config\n    timeoutSeconds\n    backoffLimit\n    concurrencyPolicy\n    definitionSource\n    sourceTriggerId\n    sourcePath\n    sourceHash\n    lastScheduledAt\n    lastSuccessfulAt\n    health\n    maxRuns\n    runCount\n    completedAt\n    pausedReason\n    pausedAt\n    lastFailureAt\n    lastFailureCode\n    lastFailureMessage\n    lastFailureRunId\n    createdBy\n    integrationRequirements {\n      integration\n      requiredScopes\n    }\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "projectReference": "string",
    "scheduleId": "string",
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "updateSchedule": {
      "id": "string",
      "projectId": "string",
      "name": "string",
      "status": "active",
      "target": {
        "kind": "task",
        "id": "string",
        "conversationMode": "create_new",
        "conversationId": "string"
      },
      "schedule": "string",
      "timezone": "string",
      "runtimeTargetKind": "main_branch",
      "runtimeTargetEnvironmentId": "string",
      "runtimeTargetBranchId": "string",
      "config": {},
      "timeoutSeconds": 0,
      "backoffLimit": 0,
      "concurrencyPolicy": "allow",
      "definitionSource": "manual",
      "sourceTriggerId": "string",
      "sourcePath": "string",
      "sourceHash": "string",
      "lastScheduledAt": "2026-01-01T00:00:00Z",
      "lastSuccessfulAt": "2026-01-01T00:00:00Z",
      "health": {},
      "maxRuns": 0,
      "runCount": 0,
      "completedAt": "2026-01-01T00:00:00Z",
      "pausedReason": "string",
      "pausedAt": "2026-01-01T00:00:00Z",
      "lastFailureAt": "2026-01-01T00:00:00Z",
      "lastFailureCode": "string",
      "lastFailureMessage": "string",
      "lastFailureRunId": "string",
      "createdBy": "string",
      "integrationRequirements": [
        {
          "integration": "string",
          "requiredScopes": [
            "string"
          ]
        }
      ],
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```
