> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://devin.ferndocs.com/api-reference/v-3/update-schedule/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://devin.ferndocs.com/_mcp/server. # Update schedule PATCH https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id} Content-Type: application/json Update an existing schedule. Reference: https://devin.ferndocs.com/api-reference/v-3/update-schedule ## Authentication - `Authorization` header (bearer token, required) — Personal API Key (apk_user_*) or Service API Key (apk_*) ## Request ### Path parameters - `schedule_id` (string, required) — Schedule ID (prefix: sched-) - `org_id` (string, required) ### Body (application/json) This endpoint expects a ScheduleUpdateRequest. - `agent` (enum, optional, nullable) - Allowed values: `devin`, `data_analyst` - `bypass_approval` (boolean, optional, nullable) - `enabled` (boolean, optional, nullable) - `frequency` (string, optional, nullable) - `interval_count` (integer, optional, nullable) - `name` (string, optional, nullable) - `notify_on` (enum, optional, nullable) - Allowed values: `always`, `failure`, `never` - `playbook_id` (string, optional, nullable) - `prompt` (string, optional, nullable) - `run_as_user_id` (string, optional, nullable) — Set the user ID that this schedule will run as. Requires ImpersonateOrgSessions permission. Setting to null reverts to the default bot user. Omitting the field leaves the current identity unchanged. - `schedule_type` (enum, optional, nullable) - Allowed values: `recurring`, `one_time` - `scheduled_at` (datetime, optional, nullable) - `slack_channel_id` (string, optional, nullable) - `slack_team_id` (string, optional, nullable) - `tags` (list of string, optional, nullable) - `target_devin_id` (string, optional, nullable) ## Response ### 200 Successful Response - `agent` (enum, required) - Allowed values: `devin`, `data_analyst` - `consecutive_failures` (integer, required) — Number of consecutive failed executions. - `created_at` (datetime, required) — ISO 8601 timestamp when the schedule was created. - `created_by` (string, required, nullable) — User ID of the schedule creator. - `enabled` (boolean, required) — Whether the schedule is currently active. - `frequency` (string, required, nullable) — How often the schedule repeats. - `last_error_at` (datetime, required, nullable) — ISO 8601 timestamp of the most recent error. - `last_error_message` (string, required, nullable) — Error message from the most recent failed execution. - `last_executed_at` (datetime, required, nullable) — ISO 8601 timestamp of the last execution. - `name` (string, required) — Display name of the schedule. - `notify_on` (enum, required) - Allowed values: `always`, `failure`, `never` - `org_id` (string, required) — Organization that owns this schedule (prefix org-). - `playbook` (PlaybookInfo, required, nullable) - `prompt` (string, required) - `scheduled_session_id` (string, required) - `updated_at` (datetime, required) - `bypass_approval` (boolean, optional, default: false) - `interval_count` (integer, optional, default: 1) - `last_edited_by` (string, optional, nullable) — User ID of the last person to edit the schedule. - `schedule_type` (enum, optional, default: recurring) - Allowed values: `recurring`, `one_time` - `scheduled_at` (datetime, optional, nullable) - `slack_channel_id` (string, optional, nullable) - `slack_team_id` (string, optional, nullable) - `tags` (list of string, optional, nullable) - `target_devin_id` (string, optional, nullable) ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### PlaybookInfo - `playbook_id` (string, required) - `title` (string, required, nullable) ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItems ## Examples **Request** ```json {} ``` **Response** ```json { "agent": "devin", "consecutive_failures": 1, "created_at": "2024-01-15T09:30:00Z", "created_by": "jane.doe@example.com", "enabled": true, "frequency": "daily", "last_error_at": "2024-01-15T09:30:00Z", "last_error_message": "Timeout error while executing schedule", "last_executed_at": "2024-01-15T09:30:00Z", "name": "Daily Data Sync", "notify_on": "always", "org_id": "org-789xyz123", "playbook": { "playbook_id": "pbk-456def789", "title": "Data Synchronization Playbook" }, "prompt": "Run the daily data synchronization process.", "scheduled_session_id": "sess-123abc456", "updated_at": "2024-01-20T10:00:00Z", "bypass_approval": false, "interval_count": 1, "last_edited_by": "john.smith@example.com", "schedule_type": "recurring", "scheduled_at": "2024-01-15T09:30:00Z", "slack_channel_id": "C1234567890", "slack_team_id": "T0987654321", "tags": [ "data-sync", "daily" ], "target_devin_id": "devin-00123" } ``` **SDK Code** ```python import requests url = "https://api.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456'; const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{}' }; 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.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") 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.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456"); var request = new RestRequest(Method.PATCH); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.devin.ai/v3/organizations/org_id/schedules/sched-abc123def456")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" 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() ```