# Binect — Letter mail as a service (Portal & REST API) **Spec-Version 1.4.0 · Stand: 2026-11-10** > Binect sends **physical letter mail**: your documents are printed, enveloped, franked and > delivered via mail service providers in Germany — **not only Deutsche Post**. You upload a > document, it is validated, and then dispatched. Binect offers both a web **Portal** and a > **REST API**, and is suitable for **private**, **small-business** and **enterprise** customers. This file gives AI agents a quick, accurate overview so they can understand the product and integrate the API against both Test and Production. The full, machine-readable, bilingual (DE/EN) contract is the OpenAPI spec — see "API reference" below. ## What it is - Send documents as **physical mail** (print, envelope, franking, delivery in Germany). - Two ways to use it: - **Portal** (web UI): https://app.binect.de - **REST API** (the focus of this file). - Single letters and **serial letters** (split into many letters). - Postal products: standard letter; **Einschreiben** / registered mail (Standard, Einwurf, International); **PremiumAdress** (Report, Basic — paid activation required); **franked** and **DV-Freimachung** (DV-prepaid, the modern method with the maximum feature set). - Keywords: physische Briefpost, Brief, Serienbrief, Einschreiben, PremiumAdress, DV-Freimachung, Frankierung, PDF/A-2b, Base64, Validierung, Versand, Stornierung, Sendungsstatus, Tracking, Custom-Attributes, Kostenstellen, Portal, REST API. ## Audience - **Private**, **small-business** and **large/enterprise** customers — the same Portal and API serve all of them. ## Environments (each has its own separate user accounts!) - **Production** — real, chargeable dispatch. - Portal: https://app.binect.de - API base URL: https://app.binect.de/binectapi/v1 - **Test** — free of charge, **simulates** dispatch (nothing is really sent). - Portal: https://test-app.binect.de - API base URL: https://test-app.binect.de/binectapi/v1 - The Test environment may run a newer version; handling and response behaviour are intentionally identical. - You need a **dedicated account in each environment** (Test and Production user management are separate). - Create an account on the login page: Production https://app.binect.de/index.jsp?id=login · Test https://test-app.binect.de/index.jsp?id=login ## API reference (All URLs in this section point to **the environment you fetched this file from**, so you always stay on the same environment — Production or Test, both listed under "Environments" above.) - **Swagger UI:** https://app.binect.de/binectapi (interactive; offers a per-language DE/EN view) - **OpenAPI spec (Swagger 2.0, machine-readable)** — language-pure & compact (no duplicated bilingual block): - German: https://app.binect.de/binectapi/v1_swagger_api_kernel_de.json - English: https://app.binect.de/binectapi/v1_swagger_api_kernel_en.json - **Error codes (machine-readable):** https://app.binect.de/binectapi/error-codes.json (code → meaning, DE/EN; `Error.code` stays a free integer) - **Reachability check (no auth):** `GET https://app.binect.de/binectapi/v1/internal/health` → `{ "status": "UP" }` — probe base URL/availability before sending credentials. - **Authentication:** **API key** (recommended) or HTTP Basic with **email + password**. - Create API keys in the customer portal under **Mein Konto → API-Keys** (My account → API keys). There you also choose per login what the REST API accepts: the password only (default), password and API key, or API keys only. - Send **exactly one** sign-in per request: `Authorization: Bearer ` (recommended), `X-API-Key: `, or — for clients that only support Basic — the key as the Basic password (the user name is ignored; use your email). More than one sign-in → `400` (`44015`). - A key stays valid when the password or email changes. **Never** send a key as a query parameter in the URL. - API keys are created, deactivated, renamed and deleted **only in the customer portal**; the REST API does not manage keys. `GET /accounts/authentication` shows how a request was signed in and the client IP address an IP allow list is checked against. - Rejections: `401` with `WWW-Authenticate: Bearer realm="binectapi"` for missing or malformed credentials (`4401`), with `WWW-Authenticate: Bearer realm="binectapi", error="invalid_token"` for an invalid, deactivated or expired key (`44012`, `44013`, `44014`); `403` for a wrong email or password, a locked login or no permission (`4403`), password sign-in disabled for this login (`44034`), keys not enabled for this login (`44031`) or blocked by your main account (`44036`), a key not allowed from this IP address (`44032`), or a read-only key on a writing request (`44033`, `error="insufficient_scope"`); `503` with `Retry-After` if the sign-in cannot be verified temporarily (`4503`). ## Key facts for integration - **File input:** PDF (preferred) or PostScript. Recommended: **PDF/A-2b**, embedded fonts, CMYK. **Max 20 MB**, at most **192 sheets** per document (192 pages simplex / 384 pages duplex). Content is **Base64-encoded** in the `content` field. - **Addressing & exclusion zones** (measured from the top-left page corner): recipient address field 85×21 mm at 20 mm left / 69 mm top; sender address field 85×5.5 mm at 20 mm left / 45 mm top; DV exclusion zone 85×17.5 mm at 20 mm left / 51 mm top (must be empty — no text/images; the DV franking is printed here). The address must be visible in the DIN-lang envelope window. DV validation is the platform standard; the older zones remain valid. Full template: https://app.binect.de/downloadFile?fileId=24 (FAQ: "Welche Datei- und Formatanforderungen gelten für meinen Brief?"). Invalid placement can be fixed via the transformations or cover-page endpoints. - **Your references:** send your own id in the field `externalReferenceId` (max 64 chars, ideally a UUID) to find the document later via `GET /documents/findByExternalReferenceId`; `externalReferenceIdUnique: true` rejects a second document with the same id (`409`, `4409`). Cost-center billing (individual invoice) via the field `tenantId` (max 32 chars). Both fields replace the former custom attributes `documentID` and `tenant`; free `key`/`value` custom attributes remain available. - **Reliability / idempotency (protection against double submissions):** the dispatch endpoints `POST /sendings/document`, `POST /sendings` and `POST /sendings/{documentID}` accept an `Idempotency-Key` header (1–128 visible ASCII chars, no spaces; scope: account + endpoint + key, at least 7 days). Create **one new key per letter**, store it, and on timeout/connection loss retry with the **same key and unchanged payload**: - first request succeeded (`2xx`) → stored response replayed with `Idempotent-Replayed: true`; nothing is paid or sent twice - still running → `409` (`44010`), retry later with the same key · same key, different payload → `422` (`44011`) - first request rejected with `4xx` → key released, the corrected request may reuse it - first request ended with `5xx` → the letter **may still have been created**; the key stays locked and every retry gets the same status with `44016`. Check via `GET /documents/findByExternalReferenceId` (match = arrived, do not resend; no match = resend with a **new** key) - `POST /documents` (plain upload) takes no key: protect it with `externalReferenceId` + `externalReferenceIdUnique: true` and check via `findByExternalReferenceId` after a timeout or `5xx` - `503`/`429` with `Retry-After`: nothing was executed, retry after that many seconds. Use growing intervals and a limited number of attempts; do not repeat other `4xx` unchanged. Synchronous uploads (`responseFormat` `FULL`) can take minutes under load: client timeout ≥ 25 minutes. - **Errors:** HTTP status + plain-text body; the Binect error code is in the `X-Error-Code` header. Every response carries `X-Request-Id` — quote it in support requests. - **Deadlines:** documents are handed to production daily at **14:30**; cancellation is possible until shortly before. Dispatch status is only meaningful from **05:00 the next day** (and only if the 14:30 window was met). Maintenance window: Tuesdays 21:00–23:00. - **Status model:** `status = { code, text }`. `text` is localized to the account language. Codes: 1 being created, 2 ready to ship, 3 processing, 4 printing, 5 sent, 6 cancelled, 7 faulty, 8 delivered and 9 returned to sender (registered mail only). - **Notifications:** there is **no webhook** yet — poll the status endpoints actively (a webhook may be added in the future). - **Payment:** default is **prepaid** (PayPal, credit card, Sofortüberweisung); on request an account can be enabled for **invoicing (on account)**. - **Production country:** on request, customers from Austria can have documents produced in Austria (`productionCountry: AT`). - **Sales partners:** partner options can be discussed with sales (info@binect.de). ## Happy path (typical integration) 1. **Upload & validate** — `POST /documents` - Body: `{ "content": { "filename": "letter.pdf", "content": "" }, "externalReferenceId": "3f2504e0-4f89-41d3-9a0c-0305e82c3301", "externalReferenceIdUnique": true }` - Returns the document incl. `status` (`code` 2 = ready to ship, 7 = faulty; 1 = still being validated with `responseFormat=SHORT`). - Optional: `responseFormat=SHORT` returns immediately without the validation result; poll `GET /documents/status` afterwards. - If validation fails, correct instead of re-uploading: `PUT /documents/{documentID}/transformations` (move/scale) or `PUT /documents/{documentID}/coverpage`. 2. **Send (dispatch release)** — `POST /sendings` - Body: `[ , ... ]` (only documents with `status.code` 2), header `Idempotency-Key: `. From here a document is managed under `/sendings`, no longer under `/documents`. - **One-step alternative:** `POST /sendings/document` — upload and, if valid, dispatch directly. Minimal `curl` (full curl/Python/JS/PHP examples are in the OpenAPI spec / Swagger UI): ```bash KEY=$(uuidgen) # once per letter; reuse the same key (and payload) on a retry curl -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $KEY" \ -X POST "https://app.binect.de/binectapi/v1/sendings/document" \ -d '{"content":{"filename":"letter.pdf","content":""},"externalReferenceId":"3f2504e0-4f89-41d3-9a0c-0305e82c3301"}' # HTTP Basic instead of an API key: replace the Authorization header with -u "$EMAIL:$PASSWORD" ``` 3. **Query status** - Before dispatch (validation outcome): `GET /documents/status` - After dispatch: `GET /sendings/status` (codes 1, 3–9). Registered-mail tracking: `GET /regmails`. 4. **Cancel** — `PUT /sendings` - Body: `[ , ... ]` — only not-yet-shipped documents, until shortly before the 14:30 window. ## Terminology - A document's ID is also referred to at Binect as **BinectID**, **DokumentenID** or **VorgangsID**. ## Contact - Technical support: kontakt@binect.de - Integration support / sales: info@binect.de