Mettre à jour la planification
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>"
}Planifications (Organisation)
Mettre à jour la planification
deprecated
Mettre à jour une planification existante.
Obsolète. Les planifications sont remplacées par les automatisations : créez plutôt une automatisation avec un déclencheur schedule:recurring via POST /v3/organizations/{org_id}/automations. Cet endpoint reste disponible pour les planifications existantes.
PATCH
/
v3
/
organizations
/
{org_id}
/
schedules
/
{schedule_id}
Mettre à jour la planification
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>"
}Obsolète. Les planifications sont remplacées par les automatisations. Cet endpoint continue de fonctionner pour les planifications existantes ; toute nouvelle tâche planifiée doit être créée sous forme d’automatisation avec un trigger
schedule:recurring.ManageOrgSchedules au niveau de l’organisation.
Remarques
Tous les champs sont facultatifs. Seuls les champs fournis dans le corps de la requête seront mis à jour. Pour désactiver une planification, définissezenabled sur false.
Définir playbook_id sur null effacera l’association avec le playbook.
Vous pouvez modifier schedule_type entre recurring et one_time. Lorsque vous passez à one_time, renseignez scheduled_at avec une date et heure ISO 8601 ultérieure. Lorsque vous passez à recurring, renseignez frequency avec une expression cron valide.
Identité d’exécution
Le paramètrerun_as_user_id contrôle l’identité utilisateur sous laquelle la planification s’exécute. Lorsqu’une planification se déclenche, les sessions sont créées pour cet utilisateur : il reçoit les notifications et la session apparaît dans son historique.
- Définir un utilisateur : fournissez un ID utilisateur valide pour modifier l’identité d’exécution. Cela nécessite :
- Le compte de service doit disposer de l’autorisation
ImpersonateOrgSessions - L’utilisateur cible doit être membre de l’organisation
- L’utilisateur cible doit disposer de l’autorisation
UseDevinSessions
- Le compte de service doit disposer de l’autorisation
- Effacer (définir sur
null) : rétablit l’exécution de la planification sous le bot par défaut - Omettre le champ : laisse l’identité d’exécution actuelle inchangée
Paramètres de chemin
Corps
application/json
Plateforme VM des sessions déclenchées par cette planification (p. ex. 'windows'). Lorsqu’elle est omise, la plateforme reste inchangée. La valeur doit correspondre à une plateforme configurée pour l’organisation (sans distinction entre majuscules et minuscules) ; les valeurs inconnues sont rejetées avec une erreur 400 qui répertorie les libellés de plateforme disponibles.
Réponse
Réponse réussie

