Aggiorna la pianificazione
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>"
}Pianificazioni (Organizzazione)
Aggiorna la pianificazione
deprecated
Aggiorna una pianificazione esistente.
Deprecato. Le pianificazioni sono state sostituite dalle automazioni: crea invece un’automazione con un trigger schedule:recurring tramite POST /v3/organizations/{org_id}/automations. Questo endpoint rimane disponibile per le pianificazioni esistenti.
PATCH
/
v3
/
organizations
/
{org_id}
/
schedules
/
{schedule_id}
Aggiorna la pianificazione
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>"
}Deprecato. Le pianificazioni sono state sostituite dalle automazioni. Questo endpoint continua a funzionare per le pianificazioni esistenti; le nuove attività pianificate dovrebbero essere create come automazione con un trigger
schedule:recurring.Autorizzazioni
Richiede un utente di servizio o un token di accesso personale con l’autorizzazioneManageOrgSchedules a livello di organizzazione.
Note
Tutti i campi sono facoltativi. Verranno aggiornati solo i campi forniti nel corpo della richiesta. Per disabilitare una pianificazione, impostaenabled su false.
Impostare playbook_id su null rimuoverà il playbook associato.
Puoi modificare schedule_type tra recurring e one_time. Quando lo imposti su one_time, fornisci scheduled_at con una data e ora futura nel formato ISO 8601. Quando lo imposti su recurring, fornisci frequency con una espressione cron valida.
Identità di esecuzione
Il parametrorun_as_user_id controlla con quale identità utente viene eseguita la pianificazione. Quando una pianificazione viene attivata, le sessioni vengono create con questo utente: riceve le notifiche e la sessione appare nella sua cronologia.
- Imposta un utente: Fornisci un ID utente valido per modificare l’identità di esecuzione. Questo richiede:
- L’utente di servizio deve avere l’autorizzazione
ImpersonateOrgSessions - L’utente di destinazione deve essere un membro dell’organizzazione
- L’utente di destinazione deve avere l’autorizzazione
UseDevinSessions
- L’utente di servizio deve avere l’autorizzazione
- Reimposta (imposta a
null): Fa sì che la pianificazione venga nuovamente eseguita come utente bot predefinito - Ometti il campo: Lascia invariata l’identità di esecuzione corrente
Parametri del percorso
Corpo
application/json
Piattaforma VM per le sessioni generate da questa pianificazione (ad es. 'windows'). Se omessa, la piattaforma rimane invariata. Il valore deve corrispondere a una piattaforma configurata per l'organizzazione (senza distinzione tra maiuscole e minuscole); i valori sconosciuti vengono rifiutati con un 400 che elenca le etichette di piattaforma disponibili.
Risposta
Risposta di successo

