curl --request POST \
--url https://api.provenmetal.com/v1/uploads \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form files=@example-fileimport requests
url = "https://api.provenmetal.com/v1/uploads"
files = { "files": ("example-file", open("example-file", "rb")) }
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.provenmetal.com/v1/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.provenmetal.com/v1/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-Key: <api-key>"
],
]);
$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.provenmetal.com/v1/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.provenmetal.com/v1/uploads")
.header("X-API-Key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.provenmetal.com/v1/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"ok": true,
"upload_id": "<string>",
"upload_url": "<string>",
"expires_in_minutes": 123,
"files": [
"<string>"
],
"expires_at": "<string>",
"quote_takes": "<string>",
"command": "<string>"
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}Create an upload
A new upload, with its files when sent as multipart, and a signed upload_url that takes more files.
curl --request POST \
--url https://api.provenmetal.com/v1/uploads \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form files=@example-fileimport requests
url = "https://api.provenmetal.com/v1/uploads"
files = { "files": ("example-file", open("example-file", "rb")) }
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.provenmetal.com/v1/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.provenmetal.com/v1/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-Key: <api-key>"
],
]);
$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.provenmetal.com/v1/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.provenmetal.com/v1/uploads")
.header("X-API-Key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.provenmetal.com/v1/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"ok": true,
"upload_id": "<string>",
"upload_url": "<string>",
"expires_in_minutes": 123,
"files": [
"<string>"
],
"expires_at": "<string>",
"quote_takes": "<string>",
"command": "<string>"
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}{
"error": "<string>",
"message": "<string>",
"ok": false,
"questions": [
{}
],
"known": {},
"parts": [
{}
],
"off_board_parts": [
{}
],
"retry_after_s": 123,
"checkout_url": "<string>",
"fields": [
{}
]
}Authorizations
Your ProvenMetal API key (pm_live_...). Authorization: Bearer <key> also works.
Body
Design files, each as a files part: a KiCad project or Gerber zip, a BOM and pick-and-place for assembly, any fabrication drawing or README. A .tgz is unpacked. Up to 20 files, 50 MB each, 100 MB in all. Leave out to get only the upload link.
Response
Successful Response
A signed link that takes more files for this upload for two hours, without an API key (multipart field files; a .tgz is unpacked).
How long upload_url takes files.
The files the upload holds.
When the upload's files are deleted: six hours after the last arrived.
How long a quote of these files takes, bare and assembled.
A shell command that sends files to upload_url.