Every Dataroom resource is reachable from a stock HTTP client: bearer-token auth, JSON in and out, no client-side state to manage. The snippets below are complete, working programs — they authenticate, upload a PDF as a Document, and create a shared link for it — in four languages. Copy whichever fits your stack and run it today.
cURL
# 1. Upload a document
DOC=$(curl -s https://api.sendmint.com/v1/documents \
-H "Authorization: Bearer $SENDMINT_API_KEY" \
-F "file=@deck.pdf" \
-F "name=Series A Pitch" | jq -r .id)
# 2. Create a shared, email-gated link for it
curl https://api.sendmint.com/v1/links \
-H "Authorization: Bearer $SENDMINT_API_KEY" \
-H "Content-Type: application/json" \
-d "{ \"document_id\": \"$DOC\", \"email_required\": true }"Node.js (fetch)
import { readFile } from "node:fs/promises";
const BASE = "https://api.sendmint.com/v1";
const auth = { Authorization: `Bearer ${process.env.SENDMINT_API_KEY}` };
// 1. Upload a document (multipart)
const file = await readFile("./deck.pdf");
const form = new FormData();
form.set("file", new Blob([file], { type: "application/pdf" }), "deck.pdf");
form.set("name", "Series A Pitch");
const doc = await fetch(`${BASE}/documents`, {
method: "POST",
headers: auth,
body: form,
}).then((r) => r.json());
// 2. Create a shared link for it (JSON)
const link = await fetch(`${BASE}/links`, {
method: "POST",
headers: { ...auth, "Content-Type": "application/json" },
body: JSON.stringify({ document_id: doc.id, email_required: true }),
}).then((r) => r.json());
console.log(link.url); // ready to sharePython (requests)
import os, requests
BASE = "https://api.sendmint.com/v1"
auth = {"Authorization": f"Bearer {os.environ['SENDMINT_API_KEY']}"}
# 1. Upload a document (multipart)
with open("deck.pdf", "rb") as fp:
doc = requests.post(
f"{BASE}/documents",
headers=auth,
files={"file": fp},
data={"name": "Series A Pitch"},
)
doc.raise_for_status()
doc_id = doc.json()["id"]
# 2. Create a shared link for it (JSON)
link = requests.post(
f"{BASE}/links",
headers={**auth, "Content-Type": "application/json"},
json={"document_id": doc_id, "email_required": True},
)
link.raise_for_status()
print(link.json()["url"]) # ready to shareGo (net/http)
package main
import (
"bytes"
"encoding/json"
"mime/multipart"
"net/http"
"os"
)
const base = "https://api.sendmint.com/v1"
func main() {
key := os.Getenv("SENDMINT_API_KEY")
// 1. Upload a document (multipart)
f, _ := os.Open("deck.pdf")
defer f.Close()
var body bytes.Buffer
w := multipart.NewWriter(&body)
fw, _ := w.CreateFormFile("file", "deck.pdf")
_, _ = fw.ReadFrom(f)
_ = w.WriteField("name", "Series A Pitch")
w.Close()
req, _ := http.NewRequest("POST", base+"/documents", &body)
req.Header.Set("Authorization", "Bearer "+key)
req.Header.Set("Content-Type", w.FormDataContentType())
res, _ := http.DefaultClient.Do(req)
var doc struct{ ID string `json:"id"` }
json.NewDecoder(res.Body).Decode(&doc)
res.Body.Close()
// 2. Create a shared link for it (JSON)
payload, _ := json.Marshal(map[string]any{
"document_id": doc.ID, "email_required": true,
})
lreq, _ := http.NewRequest("POST", base+"/links", bytes.NewReader(payload))
lreq.Header.Set("Authorization", "Bearer "+key)
lreq.Header.Set("Content-Type", "application/json")
http.DefaultClient.Do(lreq)
}Because auth is a single header and every response is JSON, a typed client is just a thin wrapper around fetch. Drop this into your codebase and call any endpoint in the API reference — no dependency, no generated bindings to keep in sync.
TypeScript · sendmint.ts
export function sendmint(apiKey = process.env.SENDMINT_API_KEY!) {
const base = "https://api.sendmint.com/v1";
const auth = { Authorization: `Bearer ${apiKey}` };
return {
async get(path: string) {
const r = await fetch(base + path, { headers: auth });
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
return r.json();
},
async post(path: string, body: unknown) {
const r = await fetch(base + path, {
method: "POST",
headers: { ...auth, "Content-Type": "application/json" },
body: JSON.stringify(body),
});
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
return r.json();
},
};
}
// usage
const sm = sendmint();
const link = await sm.post("/links", { document_id: "doc_2j9hf2", email_required: true });One header to authenticate
Authorization: Bearer + a workspace-scoped key from Settings → API keys. Rotatable, scoped, revocable.
JSON everywhere
Every request and response is JSON (uploads use multipart). Stable v1 field names you can type by hand.
Runs anywhere
curl, fetch, requests, net/http — the same four calls work in any language with an HTTP client.
Published a client library?
The v1 contract is stable, so community wrappers stay current with zero maintenance. If you publish one, send us the link and we'll feature it here.