Skip to main content
PUT
Upload a plugin, or replace it.
Uploads a plugin’s files to the organization, creating the plugin or replacing it with a new version. Use it to publish a plugin from CI instead of uploading a .zip by hand in Customize. 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 the ManageOrgPlugins permission at the organization level. Tokens used by a running Devin session are rejected.

Behavior

  • The request is JSON with a files list holding every file of the plugin. Each entry has a path relative to the plugin root and its content. Send text files as UTF-8 text. For any other file, send the bytes base64-encoded and set is_binary to true. The whole request is limited to 75 MB.
  • The plugin ID comes from the name in 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 organization’s manifest does not list yet is added to it as required, so it is installed for everyone in the 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_token with the value a previous upload returned: the upload is then refused with 409 if 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. A 201 you did not expect usually means the manifest name changed.
  • 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 or is a session token, 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, or revision_token was sent and the plugin has changed since that revision.

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

org_id
string
required

Organization ID (prefix: org-)

Example:

"org-abc123def456"

Body

application/json
files
PluginUploadFile · object[]
required

Every file of the plugin, as the plugin's whole tree.

Required array length: 1 - 100000 elements
revision_token
string | null

Only upload if the plugin is still at this revision.

Response

Successful Response

name
string
required

The plugin's display name.

plugin_id
string
required

The plugin's id, from its manifest name.

revision_token
string
required

Revision the upload was stored as.