Publish an artifact
curl --request POST \
--url https://api.example.com/v1/artifacts/{artifact_id}/publication \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 4503599627370496
}
'import requests
url = "https://api.example.com/v1/artifacts/{artifact_id}/publication"
payload = { "version": 4503599627370496 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: 4503599627370496})
};
fetch('https://api.example.com/v1/artifacts/{artifact_id}/publication', 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.example.com/v1/artifacts/{artifact_id}/publication",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => 4503599627370496
]),
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.example.com/v1/artifacts/{artifact_id}/publication"
payload := strings.NewReader("{\n \"version\": 4503599627370496\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/artifacts/{artifact_id}/publication")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 4503599627370496\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/artifacts/{artifact_id}/publication")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 4503599627370496\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "artifact",
"name": "<string>",
"version": 4503599627370496,
"capabilities": {
"database": {
"collections": {}
}
},
"made_from": {
"artifact_id": "<string>",
"version": 4503599627370496
},
"file_count": 4503599627370495,
"total_bytes": 4503599627370495,
"files": [
{
"path": "<string>",
"sha256": "<string>",
"size": 4503599627370495,
"content_type": "<string>"
}
],
"publication": {
"address": "<string>",
"url": "<string>",
"version": 4503599627370496,
"access": "view",
"grants": {},
"published_at": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "not_found_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "conflict_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "payload_too_large",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "unsupported_media_type",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "internal_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "service_unavailable",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}Publish an artifact
Serve an artifact at a public address that anyone who has it can view. Publishing again changes the version served and keeps the address; after an unpublish, the next publish gets a new address. A retry with the same Idempotency-Key is not applied again, so it cannot undo a later unpublish; the same key with another version, or one used to unpublish, answers 409
POST
/
v1
/
artifacts
/
{artifact_id}
/
publication
Publish an artifact
curl --request POST \
--url https://api.example.com/v1/artifacts/{artifact_id}/publication \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 4503599627370496
}
'import requests
url = "https://api.example.com/v1/artifacts/{artifact_id}/publication"
payload = { "version": 4503599627370496 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: 4503599627370496})
};
fetch('https://api.example.com/v1/artifacts/{artifact_id}/publication', 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.example.com/v1/artifacts/{artifact_id}/publication",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => 4503599627370496
]),
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.example.com/v1/artifacts/{artifact_id}/publication"
payload := strings.NewReader("{\n \"version\": 4503599627370496\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/artifacts/{artifact_id}/publication")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 4503599627370496\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/artifacts/{artifact_id}/publication")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 4503599627370496\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "artifact",
"name": "<string>",
"version": 4503599627370496,
"capabilities": {
"database": {
"collections": {}
}
},
"made_from": {
"artifact_id": "<string>",
"version": 4503599627370496
},
"file_count": 4503599627370495,
"total_bytes": 4503599627370495,
"files": [
{
"path": "<string>",
"sha256": "<string>",
"size": 4503599627370495,
"content_type": "<string>"
}
],
"publication": {
"address": "<string>",
"url": "<string>",
"version": 4503599627370496,
"access": "view",
"grants": {},
"published_at": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "not_found_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "conflict_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "payload_too_large",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "unsupported_media_type",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "internal_error",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}{
"type": "error",
"error": {
"type": "service_unavailable",
"message": "<string>",
"code": "session_awaiting_action"
},
"request_id": "<string>",
"accepted": "<array>",
"failed_index": 123,
"unconfirmed_index": 123
}Headers
Body
application/json
What anyone with the address may do with the artifact's data: view (files only), read or write. Each collection still allows at most what the version served declares for visitors. Collections a later version adds stay closed to visitors until a level is set again. Omit it to keep the level already set; a new publication starts at view
Available options:
view, read, write Response
Success