> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Create a schedule

POST https://api.runtype.com/v1/schedules
Content-Type: application/json

Creates a new schedule for recurring or one-time flow/agent execution.

Reference: https://docs.runtype.com/api-reference/runtype-api/schedules/create-a-schedule

## Authentication

- `Authorization` header (bearer token, required) — API key or Clerk session token

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Response

### 200

Schedule created

- `id` (string, required)
- `status` (enum, required)
  - Allowed values: `created`

## Errors

### 400 Bad Request Error

Validation error, SCHEDULE_AGENT_CONFIG_UNSUPPORTED for an agent a schedule cannot run, or RUNTIME_LANE_INELIGIBLE for a flow the batch host cannot run

- `error` (string, required)
- `code` (string, optional) — Stable error code. SCHEDULE_AGENT_CONFIG_UNSUPPORTED: the target agent uses config a schedule cannot supply; `details[].path` names it. RUNTIME_LANE_INELIGIBLE: the target flow uses capabilities the batch host cannot run; `reasons` names them.
- `details` (list of ScheduleValidationErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.
- `message` (string, optional) — Human-readable error message.
- `reasons` (list of string, optional) — With RUNTIME_LANE_INELIGIBLE: stable `ineligible:*` reason codes, e.g. `ineligible:wait-until`.

### 401 Unauthorized Error

Unauthorized

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 402 Payment Required Error

Limit exceeded

- `error` (string, required)
- `code` (string, optional) — Stable error code (e.g. ACTIVE_SCHEDULE_LIMIT, SCHEDULE_FREQUENCY_LIMIT).
- `details` (list of ScheduleEntitlementErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.
- `message` (string, optional) — Human-readable error message.
- `upgradeUrl` (string, optional) — Dashboard-relative URL to the billing/upgrade page.

### 403 Forbidden Error

Insufficient permissions

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 404 Not Found Error

Target not found

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 500 Internal Server Error

Internal server error

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

## Types

### ScheduleValidationErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### ErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### ScheduleEntitlementErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

## Examples

**Request**

```json
{
  "executionOptions": {
    "chunkSize": 200,
    "progressFlushSize": 25,
    "recordConcurrency": 25,
    "timeoutMs": 900000
  },
  "target": {
    "flowId": "flow_01jv0000000000000000000001",
    "recordType": "company"
  },
  "trigger": {
    "cron": "*/5 * * * *",
    "timezone": "America/Los_Angeles",
    "type": "recurring"
  }
}
```

**Response**

```json
{
  "id": "string",
  "status": "created"
}
```

**SDK Code**

```python Create a recurring flow schedule
import requests

url = "https://api.runtype.com/v1/schedules"

payload = {
    "executionOptions": {
        "chunkSize": 200,
        "progressFlushSize": 25,
        "recordConcurrency": 25,
        "timeoutMs": 900000
    },
    "target": {
        "flowId": "flow_01jv0000000000000000000001",
        "recordType": "company"
    },
    "trigger": {
        "cron": "*/5 * * * *",
        "timezone": "America/Los_Angeles",
        "type": "recurring"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a recurring flow schedule
const url = 'https://api.runtype.com/v1/schedules';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"executionOptions":{"chunkSize":200,"progressFlushSize":25,"recordConcurrency":25,"timeoutMs":900000},"target":{"flowId":"flow_01jv0000000000000000000001","recordType":"company"},"trigger":{"cron":"*/5 * * * *","timezone":"America/Los_Angeles","type":"recurring"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a recurring flow schedule
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.runtype.com/v1/schedules"

	payload := strings.NewReader("{\n  \"executionOptions\": {\n    \"chunkSize\": 200,\n    \"progressFlushSize\": 25,\n    \"recordConcurrency\": 25,\n    \"timeoutMs\": 900000\n  },\n  \"target\": {\n    \"flowId\": \"flow_01jv0000000000000000000001\",\n    \"recordType\": \"company\"\n  },\n  \"trigger\": {\n    \"cron\": \"*/5 * * * *\",\n    \"timezone\": \"America/Los_Angeles\",\n    \"type\": \"recurring\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create a recurring flow schedule
require 'uri'
require 'net/http'

url = URI("https://api.runtype.com/v1/schedules")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"executionOptions\": {\n    \"chunkSize\": 200,\n    \"progressFlushSize\": 25,\n    \"recordConcurrency\": 25,\n    \"timeoutMs\": 900000\n  },\n  \"target\": {\n    \"flowId\": \"flow_01jv0000000000000000000001\",\n    \"recordType\": \"company\"\n  },\n  \"trigger\": {\n    \"cron\": \"*/5 * * * *\",\n    \"timezone\": \"America/Los_Angeles\",\n    \"type\": \"recurring\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Create a recurring flow schedule
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.runtype.com/v1/schedules")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"executionOptions\": {\n    \"chunkSize\": 200,\n    \"progressFlushSize\": 25,\n    \"recordConcurrency\": 25,\n    \"timeoutMs\": 900000\n  },\n  \"target\": {\n    \"flowId\": \"flow_01jv0000000000000000000001\",\n    \"recordType\": \"company\"\n  },\n  \"trigger\": {\n    \"cron\": \"*/5 * * * *\",\n    \"timezone\": \"America/Los_Angeles\",\n    \"type\": \"recurring\"\n  }\n}")
  .asString();
```

```php Create a recurring flow schedule
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/schedules', [
  'body' => '{
  "executionOptions": {
    "chunkSize": 200,
    "progressFlushSize": 25,
    "recordConcurrency": 25,
    "timeoutMs": 900000
  },
  "target": {
    "flowId": "flow_01jv0000000000000000000001",
    "recordType": "company"
  },
  "trigger": {
    "cron": "*/5 * * * *",
    "timezone": "America/Los_Angeles",
    "type": "recurring"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create a recurring flow schedule
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/schedules");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"executionOptions\": {\n    \"chunkSize\": 200,\n    \"progressFlushSize\": 25,\n    \"recordConcurrency\": 25,\n    \"timeoutMs\": 900000\n  },\n  \"target\": {\n    \"flowId\": \"flow_01jv0000000000000000000001\",\n    \"recordType\": \"company\"\n  },\n  \"trigger\": {\n    \"cron\": \"*/5 * * * *\",\n    \"timezone\": \"America/Los_Angeles\",\n    \"type\": \"recurring\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a recurring flow schedule
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "executionOptions": [
    "chunkSize": 200,
    "progressFlushSize": 25,
    "recordConcurrency": 25,
    "timeoutMs": 900000
  ],
  "target": [
    "flowId": "flow_01jv0000000000000000000001",
    "recordType": "company"
  ],
  "trigger": [
    "cron": "*/5 * * * *",
    "timezone": "America/Los_Angeles",
    "type": "recurring"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/schedules")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```