Depot software
Registers the catalog CRUD and the installer upload.
This page is generated from the Depot route table. Every operation carries the permission it needs and the anchor an agent can link to.
GET /api/v1/software/packages
Section titled “GET /api/v1/software/packages”GETsoftware:readshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
List software packages
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
category | query | string | No | |
dir | query | string, one of asc, desc | No | Sort direction. |
page | query | integer | No | One-based page number. Defaults to 1. |
pageSize | query | integer | No | Rows per page, 1 to 200. Defaults to 50. |
q | query | string | No | Free-text search term. |
query | query | string | No | Older spelling of q, kept so saved links keep working. |
sort | query | string, one of category, created, name, publisher | No | Sort key. |
source | query | string | No |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, PagedResultSoftwarePackageSummaryView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold software:read. |
500 | application/problem+json, ProblemDetails | The request failed. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
200 response body
| Field | Type | Description |
|---|---|---|
itemsrequired | array of SoftwarePackageSummaryView | |
items[].approvalStatusrequired | string, one of approved, not_allowed, unreviewed | |
items[].builtInrequired | boolean | |
items[].categoryrequired | string | |
items[].installedCountrequired | integer | |
items[].licenseTyperequired | string | |
items[].managedByProviderrequired | boolean | |
items[].namerequired | string | |
items[].publicIdrequired | string | |
items[].publisherrequired | string | |
items[].requiresApprovalrequired | boolean | |
items[].selfServiceVisiblerequired | boolean | |
items[].sourceRefrequired | string | |
items[].sourceTyperequired | string, one of apt, brew, choco, custom_upload, direct_url, dnf, manifest, pkg, winget | |
items[].updatedAtrequired | string (date-time) | |
items[].versionCountrequired | integer | |
pagerequired | integer | |
pageSizerequired | integer | |
totalrequired | integer |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/software/packages?category=<category>&dir=asc&page=0&pageSize=0&q=<q>&query=<query>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/software/packages?category=<category>&dir=asc&page=0&pageSize=0&q=<q>&query=<query>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/software/packages"params = { "category": "<category>", "dir": "asc", "page": "0", "pageSize": "0", "q": "<q>", "query": "<query>",}headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/software/packages?category=<category>&dir=asc&page=0&pageSize=0&q=<q>&query=<query>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = new URL("https://depot.example.com/api/v1/software/packages");url.searchParams.set("category", "<category>");url.searchParams.set("dir", "asc");url.searchParams.set("page", "0");url.searchParams.set("pageSize", "0");url.searchParams.set("q", "<q>");url.searchParams.set("query", "<query>");
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/software/packages?category=<category>&dir=asc&page=0&pageSize=0&q=<q>&query=<query>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/software/packages
Section titled “POST /api/v1/software/packages”POSTsoftware:manageshared facehosteditmspremote
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
Create software package
Request body
Section titled “Request body”Required, sent as application/json.
| Field | Type | Description |
|---|---|---|
approvalStatus | string or null | |
autoUpdate | boolean or null | |
category | string or null | |
defaultInstallArgs | string or null | |
defaultUninstallArgs | string or null | |
description | string or null | |
detection | array of DetectionRuleView or null | |
detection[].expected | string | |
detection[].kindrequired | string | |
detection[].pathrequired | string | |
detection[].valueName | string | |
iconText | string or null | |
licenseType | string or null | |
name | string or null | |
pinnedVersion | string or null | |
publisher | string or null | |
requiresApproval | boolean or null | |
selfServiceVisible | boolean or null | |
sourceRef | string or null | |
sourceSha256 | string or null | |
sourceType | string or null | |
successExitCodes | array of integer or null | |
tags | array of string or null | |
timeoutSeconds | integer or null |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
201 | application/json, SoftwarePackageDetailView | Created. |
400 | application/problem+json, ProblemDetails | The request body is not valid JSON. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold software:manage. |
404 | application/problem+json, ProblemDetails | Package not found. |
409 | application/problem+json, ProblemDetails | That application is already in the catalog. |
500 | application/problem+json, ProblemDetails | Could not create the package. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
201 response body
| Field | Type | Description |
|---|---|---|
approvalStatusrequired | string, one of approved, not_allowed, unreviewed | |
autoUpdaterequired | boolean | |
builtInrequired | boolean | |
categoryrequired | string | |
defaultInstallArgsrequired | string | |
defaultUninstallArgsrequired | string | |
descriptionrequired | string | |
detectionrequired | array of DetectionRuleView | |
detection[].expected | string | |
detection[].kindrequired | string | |
detection[].pathrequired | string | |
detection[].valueName | string | |
iconTextrequired | string | |
installedCountrequired | integer | |
licenseTyperequired | string | |
managedByProviderrequired | boolean | |
namerequired | string | |
pinnedVersionrequired | string | |
publicIdrequired | string | |
publisherrequired | string | |
requiresApprovalrequired | boolean | |
selfServiceVisiblerequired | boolean | |
sourceRefrequired | string | |
sourceSha256required | string | |
sourceTyperequired | string, one of apt, brew, choco, custom_upload, direct_url, dnf, manifest, pkg, winget | |
successExitCodesrequired | array of integer | |
tagsrequired | array of string | |
timeoutSecondsrequired | integer | |
updatedAtrequired | string (date-time) | |
versionCountrequired | integer |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.curl -X POST 'https://depot.example.com/api/v1/software/packages' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}'# Sign in first. outpost_console is a session cookie, so send it with every request.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/software/packages' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.
import requests
url = "https://depot.example.com/api/v1/software/packages"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = { "approvalStatus": "string", "autoUpdate": False, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string", }, ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": False, "selfServiceVisible": False, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0, ], "tags": [ "string", ], "timeoutSeconds": 0,}
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/software/packages", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/software/packages";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify({ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0 }),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/software/packages");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/software/packages/{packageId}
Section titled “GET /api/v1/software/packages/{packageId}”GETsoftware:readshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
Get software package
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
packageId | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoftwarePackageDetailView | Success. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold software:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
500 | application/problem+json, ProblemDetails | Could not read the package. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
200 response body
| Field | Type | Description |
|---|---|---|
approvalStatusrequired | string, one of approved, not_allowed, unreviewed | |
autoUpdaterequired | boolean | |
builtInrequired | boolean | |
categoryrequired | string | |
defaultInstallArgsrequired | string | |
defaultUninstallArgsrequired | string | |
descriptionrequired | string | |
detectionrequired | array of DetectionRuleView | |
detection[].expected | string | |
detection[].kindrequired | string | |
detection[].pathrequired | string | |
detection[].valueName | string | |
iconTextrequired | string | |
installedCountrequired | integer | |
licenseTyperequired | string | |
managedByProviderrequired | boolean | |
namerequired | string | |
pinnedVersionrequired | string | |
publicIdrequired | string | |
publisherrequired | string | |
requiresApprovalrequired | boolean | |
selfServiceVisiblerequired | boolean | |
sourceRefrequired | string | |
sourceSha256required | string | |
sourceTyperequired | string, one of apt, brew, choco, custom_upload, direct_url, dnf, manifest, pkg, winget | |
successExitCodesrequired | array of integer | |
tagsrequired | array of string | |
timeoutSecondsrequired | integer | |
updatedAtrequired | string (date-time) | |
versionCountrequired | integer |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/software/packages/<packageId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/software/packages/<packageId>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/software/packages/<packageId>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/software/packages/<packageId>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/software/packages/<packageId>";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/software/packages/<packageId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());PUT /api/v1/software/packages/{packageId}
Section titled “PUT /api/v1/software/packages/{packageId}”PUTsoftware:manageshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
Update software package
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
packageId | path | string | Yes | A uuid. |
Request body
Section titled “Request body”Required, sent as application/json.
| Field | Type | Description |
|---|---|---|
approvalStatus | string or null | |
autoUpdate | boolean or null | |
category | string or null | |
defaultInstallArgs | string or null | |
defaultUninstallArgs | string or null | |
description | string or null | |
detection | array of DetectionRuleView or null | |
detection[].expected | string | |
detection[].kindrequired | string | |
detection[].pathrequired | string | |
detection[].valueName | string | |
iconText | string or null | |
licenseType | string or null | |
name | string or null | |
pinnedVersion | string or null | |
publisher | string or null | |
requiresApproval | boolean or null | |
selfServiceVisible | boolean or null | |
sourceRef | string or null | |
sourceSha256 | string or null | |
sourceType | string or null | |
successExitCodes | array of integer or null | |
tags | array of string or null | |
timeoutSeconds | integer or null |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoftwarePackageDetailView | Success. |
400 | application/problem+json, ProblemDetails | The request body is not valid JSON. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold the required permission. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | What a package IS cannot be changed after it is created, because every deployment that already named it would silently start installing something else. Retire this entry and add a new one. |
500 | application/problem+json, ProblemDetails | Could not read the package. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
200 response body
| Field | Type | Description |
|---|---|---|
approvalStatusrequired | string, one of approved, not_allowed, unreviewed | |
autoUpdaterequired | boolean | |
builtInrequired | boolean | |
categoryrequired | string | |
defaultInstallArgsrequired | string | |
defaultUninstallArgsrequired | string | |
descriptionrequired | string | |
detectionrequired | array of DetectionRuleView | |
detection[].expected | string | |
detection[].kindrequired | string | |
detection[].pathrequired | string | |
detection[].valueName | string | |
iconTextrequired | string | |
installedCountrequired | integer | |
licenseTyperequired | string | |
managedByProviderrequired | boolean | |
namerequired | string | |
pinnedVersionrequired | string | |
publicIdrequired | string | |
publisherrequired | string | |
requiresApprovalrequired | boolean | |
selfServiceVisiblerequired | boolean | |
sourceRefrequired | string | |
sourceSha256required | string | |
sourceTyperequired | string, one of apt, brew, choco, custom_upload, direct_url, dnf, manifest, pkg, winget | |
successExitCodesrequired | array of integer | |
tagsrequired | array of string | |
timeoutSecondsrequired | integer | |
updatedAtrequired | string (date-time) | |
versionCountrequired | integer |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X PUT 'https://depot.example.com/api/v1/software/packages/<packageId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}'@
$response = Invoke-RestMethod ` -Method Put ` -Uri 'https://depot.example.com/api/v1/software/packages/<packageId>' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/software/packages/<packageId>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = { "approvalStatus": "string", "autoUpdate": False, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string", }, ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": False, "selfServiceVisible": False, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0, ], "tags": [ "string", ], "timeoutSeconds": 0,}
response = requests.put(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}`)
req, err := http.NewRequest(http.MethodPut, "https://depot.example.com/api/v1/software/packages/<packageId>", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/software/packages/<packageId>";
const response = await fetch(url, { method: "PUT", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify({ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0 }),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """{ "approvalStatus": "string", "autoUpdate": false, "category": "string", "defaultInstallArgs": "string", "defaultUninstallArgs": "string", "description": "string", "detection": [ { "expected": "string", "kind": "string", "path": "string", "valueName": "string" } ], "iconText": "string", "licenseType": "string", "name": "string", "pinnedVersion": "string", "publisher": "string", "requiresApproval": false, "selfServiceVisible": false, "sourceRef": "string", "sourceSha256": "string", "sourceType": "string", "successExitCodes": [ 0 ], "tags": [ "string" ], "timeoutSeconds": 0}""";
var request = new HttpRequestMessage(HttpMethod.Put, "https://depot.example.com/api/v1/software/packages/<packageId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());DELETE /api/v1/software/packages/{packageId}
Section titled “DELETE /api/v1/software/packages/{packageId}”DELETEsoftware:manageshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
Delete software package
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
packageId | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
204 | None | Success, with no body. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold the required permission. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state. |
500 | application/problem+json, ProblemDetails | Could not read the package. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X DELETE 'https://depot.example.com/api/v1/software/packages/<packageId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Delete ` -Uri 'https://depot.example.com/api/v1/software/packages/<packageId>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/software/packages/<packageId>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.delete(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodDelete, "https://depot.example.com/api/v1/software/packages/<packageId>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/software/packages/<packageId>";
const response = await fetch(url, { method: "DELETE", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://depot.example.com/api/v1/software/packages/<packageId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/software/packages/{packageId}/versions
Section titled “GET /api/v1/software/packages/{packageId}/versions”GETsoftware:readshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
List software versions
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
packageId | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, object | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold software:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
500 | application/problem+json, ProblemDetails | Could not read the package. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/software/packages/<packageId>/versions' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/software/packages/<packageId>/versions' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/software/packages/<packageId>/versions"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/software/packages/<packageId>/versions", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/software/packages/<packageId>/versions";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/software/packages/<packageId>/versions");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/software/packages/{packageId}/versions
Section titled “POST /api/v1/software/packages/{packageId}/versions”POSTsoftware:manageshared facehosteditmspremote
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
uploadSoftwareVersion takes one installer as a multipart body: a JSON “metadata” part, then the file as “installer”.
MULTIPART AND STREAMED, unlike the ticket attachment route next door, and both halves are deliberate. Multipart because there are two things to send and the metadata has to arrive FIRST so a bad version string is refused before two gigabytes cross the wire; streamed through r.MultipartReader rather than ParseMultipartForm because that one buffers and spools the whole form before a handler sees any of it, which for this size is the difference between a temp file and an out-of-memory.
The bytes are spooled to a temp file all the same, because the destination needs an exact Content-Length before the first byte goes out and a multipart part does not declare one. The digest is computed on the way past, so the spool is read once and hashed once.
A version row may also be written with NO file, which is what pins a winget or choco package to one version. The store enforces the other half: a custom_upload package’s version cannot exist without kind, digest and key.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
packageId | path | string | Yes | A uuid. |
storageProfileId | query | string | No |
Request body
Section titled “Request body”Required, sent as multipart/form-data.
The body is object.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
201 | application/json, SoftwareVersionView | Created. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold the required permission. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | That version is already recorded for this package. |
413 | application/problem+json, ProblemDetails | The request was refused. |
500 | application/problem+json, ProblemDetails | Could not read the package. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
507 | application/problem+json, ProblemDetails | The storage this catalog writes to is full. Raise the quota or remove old installers. |
201 response body
| Field | Type | Description |
|---|---|---|
createdAtrequired | string (date-time) | |
fileNamerequired | string | |
installerKindrequired | string | |
publicIdrequired | string | |
sha256required | string | |
silentArgs | string | |
sizeBytesrequired | integer | int64. |
uploadedByrequired | string | |
versionrequired | string |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.curl -X POST 'https://depot.example.com/api/v1/software/packages/<packageId>/versions?storageProfileId=<storageProfileId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -b 'outpost_console=<console-session>' \ --data '{}'# Sign in first. outpost_console is a session cookie, so send it with every request.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'multipart/form-data' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'{}'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/software/packages/<packageId>/versions?storageProfileId=<storageProfileId>' ` -Headers $headers ` -ContentType 'multipart/form-data' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.
import requests
url = "https://depot.example.com/api/v1/software/packages/<packageId>/versions"params = { "storageProfileId": "<storageProfileId>",}headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "multipart/form-data",}cookies = { "outpost_console": "<console-session>",}payload = {}
response = requests.post(url, params=params, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`{}`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/software/packages/<packageId>/versions?storageProfileId=<storageProfileId>", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "multipart/form-data") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// The session cookie is set by signing in. A script cannot set it itself.
const url = new URL("https://depot.example.com/api/v1/software/packages/<packageId>/versions");url.searchParams.set("storageProfileId", "<storageProfileId>");
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "multipart/form-data", }, credentials: "include", body: JSON.stringify({}),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """{}""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/software/packages/<packageId>/versions?storageProfileId=<storageProfileId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "multipart/form-data");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());DELETE /api/v1/software/versions/{versionId}
Section titled “DELETE /api/v1/software/versions/{versionId}”DELETEsoftware:manageshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
deleteSoftwareVersion removes a version row and the bytes it points at.
THE OBJECT GOES FIRST, which is the opposite order to a ticket attachment, and the difference is that there is no sweeper on this side. An attachment whose object outlives its row is reconciled by the storage accountant; an installer in that state is billed forever with nothing in any database pointing at it, because SumInstallerBytesByProfile counts ROWS. So a failed object delete is fatal here: the row stays, the operator can see the version and try again, and nothing is orphaned.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
versionId | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
204 | None | Success, with no body. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | That installer belongs to the shared catalog, so it is managed for every client at once and cannot be removed here. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
500 | application/problem+json, ProblemDetails | Could not read the version. |
502 | application/problem+json, ProblemDetails | The stored installer could not be removed, so the version was kept. Try again. |
503 | application/problem+json, ProblemDetails | The software catalog is not available on this Depot. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X DELETE 'https://depot.example.com/api/v1/software/versions/<versionId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Delete ` -Uri 'https://depot.example.com/api/v1/software/versions/<versionId>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/software/versions/<versionId>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.delete(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodDelete, "https://depot.example.com/api/v1/software/versions/<versionId>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/software/versions/<versionId>";
const response = await fetch(url, { method: "DELETE", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://depot.example.com/api/v1/software/versions/<versionId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either license.