Actualizar programación
curl --request PATCH \
--url https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"playbook_id": "<string>",
"skill_ref": {
"plugin_identity": "<string>",
"skill_name": "<string>"
},
"frequency": "<string>",
"interval_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"enabled": true,
"bypass_approval": true,
"run_as_user_id": "<string>",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>",
"platform": "<string>"
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload = {
"name": "<string>",
"prompt": "<string>",
"playbook_id": "<string>",
"skill_ref": {
"plugin_identity": "<string>",
"skill_name": "<string>"
},
"frequency": "<string>",
"interval_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"enabled": True,
"bypass_approval": True,
"run_as_user_id": "<string>",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": ["<string>"],
"target_devin_id": "<string>",
"platform": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
prompt: '<string>',
playbook_id: '<string>',
skill_ref: {plugin_identity: '<string>', skill_name: '<string>'},
frequency: '<string>',
interval_count: 123,
scheduled_at: '2023-11-07T05:31:56Z',
enabled: true,
bypass_approval: true,
run_as_user_id: '<string>',
slack_channel_id: '<string>',
slack_team_id: '<string>',
tags: ['<string>'],
target_devin_id: '<string>',
platform: '<string>'
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'prompt' => '<string>',
'playbook_id' => '<string>',
'skill_ref' => [
'plugin_identity' => '<string>',
'skill_name' => '<string>'
],
'frequency' => '<string>',
'interval_count' => 123,
'scheduled_at' => '2023-11-07T05:31:56Z',
'enabled' => true,
'bypass_approval' => true,
'run_as_user_id' => '<string>',
'slack_channel_id' => '<string>',
'slack_team_id' => '<string>',
'tags' => [
'<string>'
],
'target_devin_id' => '<string>',
'platform' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"skill_ref\": {\n \"plugin_identity\": \"<string>\",\n \"skill_name\": \"<string>\"\n },\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"enabled\": true,\n \"bypass_approval\": true,\n \"run_as_user_id\": \"<string>\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\",\n \"platform\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"skill_ref\": {\n \"plugin_identity\": \"<string>\",\n \"skill_name\": \"<string>\"\n },\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"enabled\": true,\n \"bypass_approval\": true,\n \"run_as_user_id\": \"<string>\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\",\n \"platform\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"skill_ref\": {\n \"plugin_identity\": \"<string>\",\n \"skill_name\": \"<string>\"\n },\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"enabled\": true,\n \"bypass_approval\": true,\n \"run_as_user_id\": \"<string>\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\",\n \"platform\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"scheduled_session_id": "<string>",
"org_id": "<string>",
"created_by": "<string>",
"name": "<string>",
"prompt": "<string>",
"playbook": {
"playbook_id": "<string>",
"title": "<string>"
},
"frequency": "<string>",
"enabled": true,
"last_executed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"last_error_message": "<string>",
"consecutive_failures": 123,
"notify_on": "always",
"agent": "devin",
"last_edited_by": "<string>",
"skill_ref": {
"plugin_identity": "<string>",
"skill_name": "<string>"
},
"interval_count": 1,
"schedule_type": "recurring",
"scheduled_at": "2023-11-07T05:31:56Z",
"bypass_approval": false,
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>",
"platform": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}Programaciones (Organización)
Actualizar programación
deprecated
Actualizar una programación existente.
Deprecado. Las automatizaciones sustituyen a las programaciones: en su lugar, cree una automatización con un trigger schedule:recurring mediante POST /v3/organizations/{org_id}/automations. Este endpoint sigue disponible para las programaciones existentes.
PATCH
/
v3
/
organizations
/
{org_id}
/
schedules
/
{schedule_id}
Actualizar programación
curl --request PATCH \
--url https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"playbook_id": "<string>",
"skill_ref": {
"plugin_identity": "<string>",
"skill_name": "<string>"
},
"frequency": "<string>",
"interval_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"enabled": true,
"bypass_approval": true,
"run_as_user_id": "<string>",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>",
"platform": "<string>"
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload = {
"name": "<string>",
"prompt": "<string>",
"playbook_id": "<string>",
"skill_ref": {
"plugin_identity": "<string>",
"skill_name": "<string>"
},
"frequency": "<string>",
"interval_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"enabled": True,
"bypass_approval": True,
"run_as_user_id": "<string>",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": ["<string>"],
"target_devin_id": "<string>",
"platform": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
prompt: '<string>',
playbook_id: '<string>',
skill_ref: {plugin_identity: '<string>', skill_name: '<string>'},
frequency: '<string>',
interval_count: 123,
scheduled_at: '2023-11-07T05:31:56Z',
enabled: true,
bypass_approval: true,
run_as_user_id: '<string>',
slack_channel_id: '<string>',
slack_team_id: '<string>',
tags: ['<string>'],
target_devin_id: '<string>',
platform: '<string>'
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'prompt' => '<string>',
'playbook_id' => '<string>',
'skill_ref' => [
'plugin_identity' => '<string>',
'skill_name' => '<string>'
],
'frequency' => '<string>',
'interval_count' => 123,
'scheduled_at' => '2023-11-07T05:31:56Z',
'enabled' => true,
'bypass_approval' => true,
'run_as_user_id' => '<string>',
'slack_channel_id' => '<string>',
'slack_team_id' => '<string>',
'tags' => [
'<string>'
],
'target_devin_id' => '<string>',
'platform' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"skill_ref\": {\n \"plugin_identity\": \"<string>\",\n \"skill_name\": \"<string>\"\n },\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"enabled\": true,\n \"bypass_approval\": true,\n \"run_as_user_id\": \"<string>\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\",\n \"platform\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"skill_ref\": {\n \"plugin_identity\": \"<string>\",\n \"skill_name\": \"<string>\"\n },\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"enabled\": true,\n \"bypass_approval\": true,\n \"run_as_user_id\": \"<string>\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\",\n \"platform\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"skill_ref\": {\n \"plugin_identity\": \"<string>\",\n \"skill_name\": \"<string>\"\n },\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"enabled\": true,\n \"bypass_approval\": true,\n \"run_as_user_id\": \"<string>\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\",\n \"platform\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"scheduled_session_id": "<string>",
"org_id": "<string>",
"created_by": "<string>",
"name": "<string>",
"prompt": "<string>",
"playbook": {
"playbook_id": "<string>",
"title": "<string>"
},
"frequency": "<string>",
"enabled": true,
"last_executed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"last_error_message": "<string>",
"consecutive_failures": 123,
"notify_on": "always",
"agent": "devin",
"last_edited_by": "<string>",
"skill_ref": {
"plugin_identity": "<string>",
"skill_name": "<string>"
},
"interval_count": 1,
"schedule_type": "recurring",
"scheduled_at": "2023-11-07T05:31:56Z",
"bypass_approval": false,
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>",
"platform": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}Obsoleto. Las programaciones han sido reemplazadas por las automatizaciones. Este endpoint sigue funcionando para las programaciones existentes; el nuevo trabajo programado debe crearse como una automatización con un trigger
schedule:recurring.Permisos
Se requiere un usuario de servicio o un token de acceso personal con el permisoManageOrgSchedules a nivel de organización.
Notas
Todos los campos son opcionales. Solo se actualizarán los campos incluidos en el cuerpo de la solicitud. Para desactivar una programación, estableceenabled en false.
Establecer playbook_id en null eliminará el playbook asociado.
Puedes cambiar el schedule_type entre recurring y one_time. Al cambiar a one_time, indica scheduled_at con una fecha y hora futura en formato ISO 8601. Al cambiar a recurring, indica frequency con una expresión cron válida.
Identidad de ejecución
El parámetrorun_as_user_id controla con la identidad de qué usuario se ejecuta la programación. Cuando se activa una programación, las sesiones se crean bajo ese usuario: este recibe las notificaciones y la sesión aparece en su historial.
- Establecer un usuario: Proporciona un ID de usuario válido para cambiar la identidad de ejecución. Esto requiere:
- El usuario de servicio debe tener el permiso
ImpersonateOrgSessions - El usuario de destino debe ser miembro de la organización
- El usuario de destino debe tener el permiso
UseDevinSessions
- El usuario de servicio debe tener el permiso
- Borrar (establecer en
null): Hace que la programación vuelva a ejecutarse como el usuario bot predeterminado - Omitir el campo: Deja la identidad de ejecución actual sin cambios
Parámetros de ruta
Cuerpo
application/json
Plataforma de VM para las sesiones generadas por esta programación (p. ej., 'windows'). Si se omite, la plataforma no cambia. El valor debe coincidir con una plataforma configurada para la organización (sin distinguir mayúsculas de minúsculas); los valores desconocidos se rechazan con un 400 que enumera las etiquetas de plataforma disponibles.
Respuesta
Respuesta exitosa

