Create an artifact
curl --request POST \
--url https://api.example.com/v1/artifacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"files": [
{
"path": "<string>",
"content": "<string>",
"content_type": "<string>"
}
]
}
'import requests
url = "https://api.example.com/v1/artifacts"
payload = {
"name": "<string>",
"files": [
{
"path": "<string>",
"content": "<string>",
"content_type": "<string>"
}
]
}
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({
name: '<string>',
files: [{path: '<string>', content: '<string>', content_type: '<string>'}]
})
};
fetch('https://api.example.com/v1/artifacts', 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",
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([
'name' => '<string>',
'files' => [
[
'path' => '<string>',
'content' => '<string>',
'content_type' => '<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.example.com/v1/artifacts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\"\n }\n ]\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/artifacts")
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 \"name\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\"\n }\n ]\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>"
}{
"id": "<string>",
"type": "artifact",
"pending": true
}{
"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
}Create an artifact
Create an artifact from a set of files (version 1). An Idempotency-Key retries the same request, including the source version and file descriptors when supplied. A version holds at most 1000 files, 100 MiB each and 1024 MiB in total. Content sent inline in JSON is at most 1 MiB per file and 4 MiB per request, in a body of at most 16183296 bytes; upload a larger file with POST /v1/files and name it by its id.
POST
/
v1
/
artifacts
Create an artifact
curl --request POST \
--url https://api.example.com/v1/artifacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"files": [
{
"path": "<string>",
"content": "<string>",
"content_type": "<string>"
}
]
}
'import requests
url = "https://api.example.com/v1/artifacts"
payload = {
"name": "<string>",
"files": [
{
"path": "<string>",
"content": "<string>",
"content_type": "<string>"
}
]
}
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({
name: '<string>',
files: [{path: '<string>', content: '<string>', content_type: '<string>'}]
})
};
fetch('https://api.example.com/v1/artifacts', 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",
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([
'name' => '<string>',
'files' => [
[
'path' => '<string>',
'content' => '<string>',
'content_type' => '<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.example.com/v1/artifacts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\"\n }\n ]\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/artifacts")
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 \"name\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\"\n }\n ]\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>"
}{
"id": "<string>",
"type": "artifact",
"pending": true
}{
"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
Response
Success