Trinsfer Developer Guide
Everything you need to integrate Trinsfer into your stack. The API is REST + JSON,
authenticated with a Bearer API key, and respects standard HTTP semantics. All examples
below were tested against the live https://trinsfer.com/api/v1 base URL.
Introduction
The Trinsfer API gives you programmatic access to two products:
- Transfers โ create file-transfer envelopes, query metadata, update title/recipient/expiration, soft-delete.
- Speed tests โ submit and retrieve internet-speed test results from your own infrastructure.
All endpoints live under https://trinsfer.com/api/v1 and return JSON with a consistent envelope:
Quickstart (60 seconds)
Create an account
Free signup, no card required. OAuth (Google / Discord / Telegram / X / Steam) also works.
2Generate a key
Profile โ API keys โ "+ New API key". Copy the secret โ it is shown only once.
3Make your first call
GET /api/v1/account returns your plan, limits and current usage.
Build something
Create transfers, manage speed tests or wire into your CI/CD.
Fire your first request right away:
Authentication
Every request must include the header Authorization: Bearer <your-key>. Keys look like tk_a1b2c3d4_โฆ โ the first 11 characters (tk_xxxxxxxx) are the prefix and identify the key. The full secret is stored only as SHA-256 on our side; we never see it again after creation.
Listing and rotating keys
From /profile#api-keys you can:
- Generate new keys with custom scopes.
- Regenerate a key โ old secret stops working immediately, you receive the new one once.
- Revoke or permanently delete a key.
Error handling
Every non-2xx response carries error.code and error.message. The cheat-sheet below maps codes to HTTP statuses and what you should do.
expires_days below your plan's max_expiry_days.Retry-After seconds and retry. Consider exponential backoff.pay_url (your /profile#api-keys).Rate limit & quota headers
Every response (including errors) carries headers that describe your remaining quota โ no need to call /account for that:
X-RateLimit-Limitโ requests per minute allowed by your plan.X-RateLimit-Remainingโ how many you have left in the current minute.X-RateLimit-Resetโ seconds until the counter resets.X-Quota-Limit-Monthโ free requests included this month.X-Quota-Used-Monthโ how many you have already used.X-Quota-Overageโ request count above your free quota.X-Quota-Overage-USDโ money owed at current pricing.X-Trinsfer-Planโ your plan:free,monthly,annual.
Scopes & permissions
Scopes restrict what a key can do โ assign the minimum required:
transfers:readโ list and read transfers + files.transfers:writeโ create, update, delete transfers.speed:readโ list speed test history.speed:writeโ submit and delete speed test results.
Requesting an endpoint without the matching scope returns HTTP 403 insufficient_scope.
Transfer expiration limits
The expires_days field on POST /transfers and PATCH /transfers/<token> is capped by your plan. Exceeding it returns HTTP 422 expiry_too_long.
Pay-per-use billing
Each plan ships with a generous free monthly request quota. Past that, every request adds a tiny pay-per-use charge that you can settle on demand from /profile#api-keys.
- Overage is computed monthly and reset every 1st of the month.
- While you owe less than $20, the API keeps responding normally โ you only see the bill grow.
- Above $20 unpaid, the API returns
HTTP 402 quota_payment_requiredwith apay_urlthat opens PayPal at the exact owed amount.
Account
Returns the current user, active plan, rate-limit ceiling, monthly quota and current overage. Useful as a health-check / ping endpoint for your SDK.
Transfers
List your transfers, newest first. Supports ?limit=<1-100> (default 20) and ?offset=<0+>.
Create a transfer envelope. Returns token + upload_url โ the upload itself uses TUS resumable chunks (see "Recipes" below).
Retrieve a single transfer with its file list and signed per-file download URLs.
Updatable fields: title, recipient_email, message, expires_days (capped by your plan).
Soft-deletes the transfer. Files are purged after the grace period.
Speed tests
List your stored speed test history. Same pagination as transfers.
Recipe: upload a file with chunks
Trinsfer uses its own lightweight chunk-upload endpoint at POST /upload_chunk.php. Each chunk is a raw binary POST; metadata travels in X-* headers. When the last chunk arrives the server auto-assembles the final file โ no separate "finalize" call needed.
Protocol
- Create the transfer envelope with
POST /api/v1/transfersand keep the returnedtoken. - Pick a chunk size (5โ10 MB works great) and split the file.
- For each chunk,
POST /upload_chunk.phpwith the raw bytes as the body and these headers:X-Tokenโ the transfer token.X-File-Idโ a stable identifier you generate per file (UUID).X-Chunk-Indexโ zero-based chunk number.X-Total-Chunksโ how many chunks the file will be.X-File-Nameโ original file name.X-File-Sizeโ total file size in bytes.Content-Type: application/octet-stream.
- The transfer flips from
uploadingโreadyautomatically as soon as the last chunk completes.
X-Chunk-Index to retry a failed upload, the server overwrites that chunk and recounts.Webhooks
Subscribe to events that happen on your account from /profile#webhooks. Every delivery includes:
X-Trinsfer-Eventโ event name.X-Trinsfer-Deliveryโ unique delivery id (for idempotency).X-Trinsfer-Signatureโsha256=<hex>of the body using your webhook secret.
Events emitted
transfer.createdโ fires when a transfer is created via the API or web app.transfer.downloadedโ fires every time someone downloads from a transfer link.transfer.expiredโ fires when a transfer crosses its expiration date.transfer.password_failedโ fires on a wrong password attempt.speed_test.submittedโ fires when a speed test is stored.api_key.usedโ fires when an API key is used to authenticate a request (throttled to at most once per 60s per key).
Verify a delivery (PHP)
Libraries
Until we ship official SDKs you can use any HTTP client. We've validated the API works with:
- JavaScript โ native
fetch, axios, ky. - Python โ
requests,httpx. - PHP โ Guzzle, Symfony HttpClient, raw cURL.
- Go โ
net/httpwithhttp.Header{Authorization: "Bearer โฆ"}. - Postman โ import any cURL above with "Import โ Raw text".
Want to publish a community SDK? Open a PR or email dev@trinsfer.com.