{"openapi":"3.0.3","info":{"title":"postkamer.nl agent API","version":"1.0.0","description":"Prepare a postal mailing to every address in an area of the Netherlands for a user, and hand them the link to check and pay. No authentication. Agents that speak MCP can use https://www.postkamer.nl/mcp instead; step-by-step guide: https://www.postkamer.nl/SKILL.md.","contact":{"email":"info@postkamer.nl"}},"servers":[{"url":"https://www.postkamer.nl"}],"paths":{"/api/agent/v1/estimate":{"post":{"operationId":"estimateMailing","summary":"Count the addresses in an area and price the mailing","description":"Creates nothing. Rate limit: about 30 requests per 5 minutes per IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequest"}}}},"responses":{"200":{"description":"Estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Estimate"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/agent/v1/print-jobs":{"post":{"operationId":"createPrintJob","summary":"Prepare a mailing and get the link for the user","description":"Send JSON, or multipart/form-data with the JSON in a `request` field and the letter (PDF or Word, A4 portrait, address window empty) in `file`. Nothing is sent or charged until the user confirms on reviewUrl. Rate limit: about 20 requests per 15 minutes per IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePrintJobRequest"}},"multipart/form-data":{"schema":{"type":"object","required":["request"],"properties":{"request":{"type":"string","description":"CreatePrintJobRequest as JSON."},"file":{"type":"string","format":"binary","description":"The letter, at most 3 MB. Leave larger letters out: the user uploads them on reviewUrl."}}}}}},"responses":{"201":{"description":"Prepared","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrintJob"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body over 4.5 MB (plain text from the platform). Send the letter without a file and let the user upload it."},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/agent/v1/print-jobs/{id}":{"get":{"operationId":"getPrintJob","summary":"Whether the user has confirmed the mailing","description":"Rate limit: about 120 requests per 15 minutes per IP.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrintJobStatus"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updatePrintJobArea","summary":"Replace the area of a prepared mailing","description":"Only while the user has not confirmed it or opened it in their account. Rate limit: about 30 requests per 15 minutes per IP.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePrintJobRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrintJob"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"EstimateRequest":{"type":"object","properties":{"area":{"type":"object","properties":{"circles":{"description":"Circular areas around a place or coordinate. The simplest way to reach \"the neighbours around X\".","maxItems":20,"type":"array","items":{"type":"object","properties":{"place":{"description":"Address, street, postcode or place in the Netherlands, e.g. \"Keizersgracht 100, Amsterdam\" or \"1015CV\".","type":"string","minLength":2,"maxLength":200},"lat":{"description":"Latitude (WGS84) of the centre, used when `place` is absent.","type":"number","minimum":50.6,"maximum":53.7},"lng":{"description":"Longitude (WGS84) of the centre, used when `place` is absent.","type":"number","minimum":3.2,"maximum":7.3},"radiusMeters":{"type":"number","minimum":25,"maximum":3000,"description":"Radius in metres (25-3000)."}},"required":["radiusMeters"],"additionalProperties":false}},"polygons":{"description":"GeoJSON Polygons with [longitude, latitude] coordinates (WGS84), outer ring closed.","maxItems":20,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"minItems":1,"maxItems":50,"type":"array","items":{"maxItems":5000,"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false}},"bufferMeters":{"description":"Extra margin in metres around every circle and polygon. Default 0.","type":"integer","minimum":0,"maximum":5000},"addresses":{"description":"Single addresses by postcode and house number, on top of or instead of an area.","maxItems":200,"type":"array","items":{"type":"object","properties":{"postalCode":{"type":"string","minLength":6,"maxLength":7,"description":"Dutch postcode, e.g. \"1015CV\"."},"houseNumber":{"type":"string","minLength":1,"maxLength":20,"description":"House number, optionally with letter or addition, e.g. \"100\", \"12A\", \"12-1\"."},"houseNumberSuffix":{"description":"Letter or addition when not part of houseNumber.","type":"string","maxLength":20}},"required":["postalCode","houseNumber"],"additionalProperties":false}}},"additionalProperties":false},"pageCount":{"description":"Pages in the letter (A4). Omit for a 1-page letter.","type":"integer","minimum":1,"maximum":20}},"required":["area"],"additionalProperties":false},"CreatePrintJobRequest":{"type":"object","properties":{"area":{"type":"object","properties":{"circles":{"description":"Circular areas around a place or coordinate. The simplest way to reach \"the neighbours around X\".","maxItems":20,"type":"array","items":{"type":"object","properties":{"place":{"description":"Address, street, postcode or place in the Netherlands, e.g. \"Keizersgracht 100, Amsterdam\" or \"1015CV\".","type":"string","minLength":2,"maxLength":200},"lat":{"description":"Latitude (WGS84) of the centre, used when `place` is absent.","type":"number","minimum":50.6,"maximum":53.7},"lng":{"description":"Longitude (WGS84) of the centre, used when `place` is absent.","type":"number","minimum":3.2,"maximum":7.3},"radiusMeters":{"type":"number","minimum":25,"maximum":3000,"description":"Radius in metres (25-3000)."}},"required":["radiusMeters"],"additionalProperties":false}},"polygons":{"description":"GeoJSON Polygons with [longitude, latitude] coordinates (WGS84), outer ring closed.","maxItems":20,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"minItems":1,"maxItems":50,"type":"array","items":{"maxItems":5000,"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false}},"bufferMeters":{"description":"Extra margin in metres around every circle and polygon. Default 0.","type":"integer","minimum":0,"maximum":5000},"addresses":{"description":"Single addresses by postcode and house number, on top of or instead of an area.","maxItems":200,"type":"array","items":{"type":"object","properties":{"postalCode":{"type":"string","minLength":6,"maxLength":7,"description":"Dutch postcode, e.g. \"1015CV\"."},"houseNumber":{"type":"string","minLength":1,"maxLength":20,"description":"House number, optionally with letter or addition, e.g. \"100\", \"12A\", \"12-1\"."},"houseNumberSuffix":{"description":"Letter or addition when not part of houseNumber.","type":"string","maxLength":20}},"required":["postalCode","houseNumber"],"additionalProperties":false}}},"additionalProperties":false},"name":{"description":"A name for the mailing the user recognises, e.g. \"Bewonersbrief verbouwing Dorpsstraat\".","type":"string","maxLength":255}},"required":["area"],"additionalProperties":false},"UpdatePrintJobRequest":{"type":"object","properties":{"area":{"type":"object","properties":{"circles":{"description":"Circular areas around a place or coordinate. The simplest way to reach \"the neighbours around X\".","maxItems":20,"type":"array","items":{"type":"object","properties":{"place":{"description":"Address, street, postcode or place in the Netherlands, e.g. \"Keizersgracht 100, Amsterdam\" or \"1015CV\".","type":"string","minLength":2,"maxLength":200},"lat":{"description":"Latitude (WGS84) of the centre, used when `place` is absent.","type":"number","minimum":50.6,"maximum":53.7},"lng":{"description":"Longitude (WGS84) of the centre, used when `place` is absent.","type":"number","minimum":3.2,"maximum":7.3},"radiusMeters":{"type":"number","minimum":25,"maximum":3000,"description":"Radius in metres (25-3000)."}},"required":["radiusMeters"],"additionalProperties":false}},"polygons":{"description":"GeoJSON Polygons with [longitude, latitude] coordinates (WGS84), outer ring closed.","maxItems":20,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"minItems":1,"maxItems":50,"type":"array","items":{"maxItems":5000,"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":2}}}},"required":["type","coordinates"],"additionalProperties":false}},"bufferMeters":{"description":"Extra margin in metres around every circle and polygon. Default 0.","type":"integer","minimum":0,"maximum":5000},"addresses":{"description":"Single addresses by postcode and house number, on top of or instead of an area.","maxItems":200,"type":"array","items":{"type":"object","properties":{"postalCode":{"type":"string","minLength":6,"maxLength":7,"description":"Dutch postcode, e.g. \"1015CV\"."},"houseNumber":{"type":"string","minLength":1,"maxLength":20,"description":"House number, optionally with letter or addition, e.g. \"100\", \"12A\", \"12-1\"."},"houseNumberSuffix":{"description":"Letter or addition when not part of houseNumber.","type":"string","maxLength":20}},"required":["postalCode","houseNumber"],"additionalProperties":false}}},"additionalProperties":false},"name":{"description":"A name for the mailing the user recognises, e.g. \"Bewonersbrief verbouwing Dorpsstraat\".","type":"string","maxLength":255}},"required":["area"],"additionalProperties":false},"Estimate":{"type":"object","required":["addressCount","areaAddressCount","postcodeSample","postcodeCount","price","area"],"properties":{"addressCount":{"type":"integer","description":"Letters the mailing would hold."},"areaAddressCount":{"type":"integer","description":"Addresses inside the circles and polygons."},"postcodeSample":{"type":"array","items":{"type":"string"}},"postcodeCount":{"type":"integer"},"price":{"type":"object","properties":{"currency":{"type":"string","enum":["EUR"]},"totalExVat":{"type":"number","description":"Euro, two decimals."},"vat":{"type":"number","description":"Euro, two decimals."},"totalInclVat":{"type":"number","description":"Euro, two decimals."},"perLetterExVat":{"type":"number","description":"Euro, two decimals.","nullable":true},"vatPercent":{"type":"number"},"pageCount":{"type":"integer"},"exact":{"type":"boolean","description":"False while priced as a 1-page letter."},"deliverySpeed":{"type":"string"}}},"area":{"type":"object","properties":{"places":{"type":"array","description":"Where each circle `place` was found.","items":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}}},"unresolvedAddresses":{"type":"array","description":"Addresses that were not found or are ambiguous (with options). They are left out.","items":{"type":"object"}},"bufferMeters":{"type":"number"},"polygonCount":{"type":"integer"}}}}},"PrintJob":{"type":"object","required":["jobId","reviewUrl","expiresAt","hasLetter","estimate"],"properties":{"jobId":{"type":"string"},"reviewUrl":{"type":"string","format":"uri","description":"Give this link to the user: they check the area and letter and pay there."},"expiresAt":{"type":"string","format":"date-time"},"hasLetter":{"type":"boolean"},"estimate":{"$ref":"#/components/schemas/Estimate"}}},"PrintJobStatus":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["pending","in_account","submitted"],"description":"pending: waiting for the user. in_account: the user opened it signed in. submitted: confirmed."},"hasLetter":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time"},"reviewUrl":{"type":"string","format":"uri","nullable":true},"addressCount":{"type":"integer","nullable":true}}},"Error":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string","description":"Message in Dutch."},"code":{"type":"string","example":"NO_ADDRESSES"},"details":{}}}}}}