Upload a plugin, or replace it.
curl --request PUT \
--url https://api.devin.ai/v3beta1/enterprise/plugins/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"content": "<string>",
"path": "<string>",
"is_binary": false
}
],
"revision_token": "<string>"
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/plugins/uploads"
payload = {
"files": [
{
"content": "<string>",
"path": "<string>",
"is_binary": False
}
],
"revision_token": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{content: '<string>', path: '<string>', is_binary: false}],
revision_token: '<string>'
})
};
fetch('https://api.devin.ai/v3beta1/enterprise/plugins/uploads', 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/v3beta1/enterprise/plugins/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'content' => '<string>',
'path' => '<string>',
'is_binary' => false
]
],
'revision_token' => '<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/v3beta1/enterprise/plugins/uploads"
payload := strings.NewReader("{\n \"files\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"is_binary\": false\n }\n ],\n \"revision_token\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.devin.ai/v3beta1/enterprise/plugins/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"is_binary\": false\n }\n ],\n \"revision_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/plugins/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"is_binary\": false\n }\n ],\n \"revision_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"plugin_id": "<string>",
"revision_token": "<string>"
}{
"name": "<string>",
"plugin_id": "<string>",
"revision_token": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Plugins [Beta]
Upload a plugin, or replace it.
Store an uploaded file listing as the plugin its manifest names, replacing the whole plugin when it already exists, and require it for the enterprise.
PUT
/
v3beta1
/
enterprise
/
plugins
/
uploads
Upload a plugin, or replace it.
curl --request PUT \
--url https://api.devin.ai/v3beta1/enterprise/plugins/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"content": "<string>",
"path": "<string>",
"is_binary": false
}
],
"revision_token": "<string>"
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/plugins/uploads"
payload = {
"files": [
{
"content": "<string>",
"path": "<string>",
"is_binary": False
}
],
"revision_token": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{content: '<string>', path: '<string>', is_binary: false}],
revision_token: '<string>'
})
};
fetch('https://api.devin.ai/v3beta1/enterprise/plugins/uploads', 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/v3beta1/enterprise/plugins/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'content' => '<string>',
'path' => '<string>',
'is_binary' => false
]
],
'revision_token' => '<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/v3beta1/enterprise/plugins/uploads"
payload := strings.NewReader("{\n \"files\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"is_binary\": false\n }\n ],\n \"revision_token\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.devin.ai/v3beta1/enterprise/plugins/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"is_binary\": false\n }\n ],\n \"revision_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/plugins/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"is_binary\": false\n }\n ],\n \"revision_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"plugin_id": "<string>",
"revision_token": "<string>"
}{
"name": "<string>",
"plugin_id": "<string>",
"revision_token": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Uploads a plugin’s files to the enterprise, creating the plugin or replacing it with a new version. Use it to publish a plugin from CI to every organization. See Publish an uploaded plugin from CI for a script that builds the request from a plugin folder.
Permissions
Requires a service user or personal access token with theManageAccountPlugins permission at the enterprise level.
Behavior
- The request is JSON with a
fileslist holding every file of the plugin. Each entry has apathrelative to the plugin root and itscontent. Send text files as UTF-8 text. For any other file, send the bytes base64-encoded and setis_binarytotrue. The whole request is limited to 75 MB. - The plugin ID comes from the
namein the plugin manifest, lowercased with every run of other characters turned into-. The files must include a manifest. There is no ID in the URL. - If no plugin with that ID is stored at this scope, the upload creates it. Otherwise the upload becomes the plugin’s next version: its files are exactly the files in the request, and earlier versions stay in Version history.
- A plugin that the enterprise manifest does not list yet is added to it as required, so it is installed in every organization. A plugin that is already listed keeps its current entry.
- An upload replaces the stored plugin without checking who changed it last. To avoid overwriting a change you have not seen, send
revision_tokenwith the value a previous upload returned: the upload is then refused with409if the plugin has changed since. - The API does not accept a
.zip. Unpack the plugin and send its files. - New sessions load the uploaded version. Running sessions keep what they loaded at start.
Status codes
-
201: the upload created a new plugin. A201you did not expect usually means the manifestnamechanged. -
200: the upload replaced an existing plugin with a new version. -
400: a path is unsafe or repeated, binary content is not valid base64, or the files exceed the file-count or total-size limits. -
403: the caller lacks the permission, uploaded plugins are disabled for the account, or the ID is reserved for Devin. -
409: the ID belongs to a plugin that cannot be replaced by an upload, orrevision_tokenwas sent and the plugin has changed since that revision.
Body
application/json

