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

# Create Schedule

POST https://api.catenatelematics.com/v2/integrations/connections/{connection_id}/schedules
Content-Type: application/json

Create a new schedule.

This will create a schedule to fetch data from the TSP.

It also creates a schedule to refresh or exchange the connection details
for a short lived credential, such as an access token.

For now only Catena admins can create schedules.

Reference: https://catena.ferndocs.com/api-reference/integrations/connections/create-schedule

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `connection_id` (string, required)

### Body (application/json)

This endpoint expects a ScheduleCreate.

- `resource` (enum, required) — The type of resource to fetch on this schedule (e.g., VEHICLE, DRIVER, HOS, IFTA).
  - Allowed values: `asset`, `document`, `driver_association`, `driver_vehicle_association`, `driver_event_log`, `driver_safety_event`, `dvir_log`, `dvir_log_defect`, `engine_log`, `engine_status`, `fuel_transaction`, `fuel_card`, `fleet_info`, `hos_availability`, `hos_daily_log`, `hos_daily_snapshot`, `hos_event`, `hos_event_annotation`, `hos_event_attachment`, `hos_violation`, `ifta_summary`, `location_segment`, `message`, `group_message`, `user`, `vehicle`, `vehicle_location`, `vehicle_sensor`, `vehicle_region_segment`, `trailer`, `trailer_association`, `trailer_vehicle_association`, `trailer_location`, `trailer_status`, `workflow`
- `execution_interval_seconds` (integer, optional, default: 600) — The interval between scheduled executions in seconds. Defaults to 10 minutes (600 seconds).
- `consecutive_error_threshold` (integer, optional, default: 15) — The number of consecutive errors allowed before the schedule is automatically set to INACTIVE. Defaults to 15.
- `max_concurrent_executions` (integer, optional, default: 1) — The maximum number of concurrent executions allowed for this schedule. Defaults to 1.
- `status` (enum, optional) — The initial status of the schedule. Defaults to ACTIVE.
  - Allowed values: `inactive`, `active`, `paused`, `stale`, `deleted`, `cancelled`, `cancelled_insufficient_scope`
- `cursor` (string, optional, nullable) — Resource-specific state used to resume incremental fetching.
- `last_data_at` (datetime, optional, nullable) — Timestamp of the most recent data point received from the TSP.
- `fetch_window_end_at` (datetime, optional, nullable) — End timestamp of the last fetch window. Used by chunked adapters to advance backfills across executions.

## Response

### 200

Successful Response

- `id` (string, required) — Unique identifier for the schedule.
- `connection_id` (string, required) — The ID of the connection that this schedule belongs to.
- `resource` (enum, required) — The type of resource being fetched on this schedule (e.g., VEHICLE, DRIVER, HOS, IFTA).
  - Allowed values: `asset`, `document`, `driver_association`, `driver_vehicle_association`, `driver_event_log`, `driver_safety_event`, `dvir_log`, `dvir_log_defect`, `engine_log`, `engine_status`, `fuel_transaction`, `fuel_card`, `fleet_info`, `hos_availability`, `hos_daily_log`, `hos_daily_snapshot`, `hos_event`, `hos_event_annotation`, `hos_event_attachment`, `hos_violation`, `ifta_summary`, `location_segment`, `message`, `group_message`, `user`, `vehicle`, `vehicle_location`, `vehicle_sensor`, `vehicle_region_segment`, `trailer`, `trailer_association`, `trailer_vehicle_association`, `trailer_location`, `trailer_status`, `workflow`
- `execution_interval_seconds` (integer, required) — The interval between scheduled executions in seconds.
- `status` (enum, required) — The current status of the schedule (ACTIVE, INACTIVE).
  - Allowed values: `inactive`, `active`, `paused`, `stale`, `deleted`, `cancelled`, `cancelled_insufficient_scope`
- `consecutive_error_count` (integer, required) — The number of consecutive errors that have occurred for this schedule.
- `consecutive_error_threshold` (integer, required) — The number of consecutive errors allowed before the schedule is automatically set to INACTIVE.
- `max_concurrent_executions` (integer, required) — The maximum number of concurrent executions allowed for this schedule.
- `cursor` (string, optional, nullable) — Resource-specific state used to resume incremental fetching.
- `last_data_at` (datetime, optional, nullable) — Timestamp of the most recent data point received from the TSP.
- `fetch_window_end_at` (datetime, optional, nullable) — End timestamp of the last fetch window. Used by chunked adapters to advance backfills across executions.

## Errors

### 400 Bad Request Error

Bad Request

- `code` (integer, optional, default: 400)
- `message` (string, optional, default: Bad Request)
- `detail` (string, optional, nullable)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, optional, default: 401)
- `message` (string, optional, default: Unauthorized)
- `detail` (string, optional, nullable)

### 403 Forbidden Error

Forbidden

- `code` (integer, optional, default: 403)
- `message` (string, optional, default: Forbidden)
- `detail` (string, optional, nullable)

### 404 Not Found Error

Not Found

- `code` (integer, optional, default: 404)
- `message` (string, optional, default: Not Found)
- `detail` (string, optional, nullable)

### 405 Method Not Allowed Error

Method Not Allowed

- `code` (integer, optional, default: 405)
- `message` (string, optional, default: Method Not Allowed)
- `detail` (string, optional, nullable)

### 409 Conflict Error

Conflict

- `code` (integer, optional, default: 409)
- `message` (string, optional, default: Conflict)
- `detail` (string, optional, nullable)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `code` (integer, optional, default: 422)
- `message` (string, optional, default: Invalid Request Body)
- `detail` (list of ValidationErrorDetail, optional, nullable)

### 429 Too Many Requests Error

Too Many Requests

- `code` (integer, optional, default: 429)
- `message` (string, optional, default: Too Many Requests)
- `detail` (RetryAfterDetail, optional, nullable)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional, default: Internal Server Error)

### 504 Gateway Timeout Error

Gateway Timeout

- `code` (integer, optional, default: 504)
- `message` (string, optional, default: Gateway Timeout)
- `detail` (string, optional, nullable)

## Types

### ValidationErrorDetail

- `path` (string, required)
- `input` (string, required)
- `message` (string, required)
- `error_type` (string, required)

### RetryAfterDetail

- `retry_after_seconds` (integer, required)
- `message` (string, required)

## Examples

**Request**

```json
{
  "resource": "asset"
}
```

**Response**

```json
{
  "id": "string",
  "connection_id": "string",
  "resource": "vehicle",
  "execution_interval_seconds": 600,
  "status": "inactive",
  "consecutive_error_count": 0,
  "consecutive_error_threshold": 15,
  "max_concurrent_executions": 1,
  "cursor": "cursor-1"
}
```

**SDK Code**

```python
import requests

url = "https://api.catenatelematics.com/v2/integrations/connections/connection_id/schedules"

payload = { "resource": "asset" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.catenatelematics.com/v2/integrations/connections/connection_id/schedules';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"resource":"asset"}'
};

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

```go
package main

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

func main() {

	url := "https://api.catenatelematics.com/v2/integrations/connections/connection_id/schedules"

	payload := strings.NewReader("{\n  \"resource\": \"asset\"\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
require 'uri'
require 'net/http'

url = URI("https://api.catenatelematics.com/v2/integrations/connections/connection_id/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  \"resource\": \"asset\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.catenatelematics.com/v2/integrations/connections/connection_id/schedules")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"resource\": \"asset\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.catenatelematics.com/v2/integrations/connections/connection_id/schedules', [
  'body' => '{
  "resource": "asset"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.catenatelematics.com/v2/integrations/connections/connection_id/schedules");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"resource\": \"asset\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["resource": "asset"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.catenatelematics.com/v2/integrations/connections/connection_id/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()
```