API – Mail¶
Paths are under https://api.innovanet.com. Header Authorization: Bearer inv_mcp_…. The innovanet() function is in the API chapter.
post_type: 1 incoming, 2 outgoing. Incoming by default.
GET /api/post¶
| Parameter | Type | Required | Description |
|---|---|---|---|
page |
integer | no | default 1 |
limit |
integer | no | default 20 |
year |
integer | no | |
post_type |
integer | no | 1 or 2 |
status |
integer | no | |
project_id |
integer | no | |
company_id |
integer | no | |
search |
string | no | |
sort_by |
string | no | default post_created |
sort_order |
string | no | ASC or DESC |
$res = innovanet('GET', '/api/post?post_type=1&year=2026');
Response 200
{
"success": true,
"data": {
"items": [
{
"id": 7,
"post_type": 1,
"post_subject": "Zmluva",
"post_customer_name": "Acme s.r.o.",
"post_delivered": "2026-11-04",
"post_created_by_name": "Jana Nováková"
}
],
"total": 1,
"page": 1,
"limit": 20,
"total_pages": 1
}
}
Detail: GET /api/post/7.
POST /api/post¶
The delivery or sending date must not be in the future.
| Field | Type | Required | Description |
|---|---|---|---|
post_type |
integer | no | 1 incoming, 2 outgoing |
post_subject |
string | no | |
post_delivered |
date | no | not in the future |
post_customer_id |
integer | no | a partner from the address book |
post_number |
string | no | posting number |
post_owner |
integer | no | responsible person, you by default |
project_id |
integer | no | |
post_desc |
string | no | |
post_note |
string | no | |
notified_user_ids |
array of integers | no | whom to notify |
Request
{
"post_type": 1,
"post_subject": "Zmluva",
"post_delivered": "2026-11-04",
"post_customer_id": 120,
"post_number": "RP123456789SK"
}
PHP
$res = innovanet('POST', '/api/post', [
'post_type' => 1,
'post_subject' => 'Zmluva',
'post_delivered' => '2026-11-04',
'post_customer_id' => 120,
]);
Response 201
{
"success": true,
"message": "Zásielka bola vytvorená",
"data": { "id": 7 }
}
A future date returns 422.
Other paths¶
Each path below belongs to this module. Field names are the ones the API reads. A downloaded file is not JSON.
GET /api/post/list-info¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/post/stats¶
Parameters
| Field | Type | Required |
|---|---|---|
year |
string | no |
scope |
string | no |
The API reads these fields. A field is required when the table says yes.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/post/carriers/{carrierId}/classes¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
POST /api/post/export¶
Body
| Field | Type | Required |
|---|---|---|
carrier_id |
integer | yes |
post_ids |
array | yes |
sender |
object | no |
{
"carrier_id": 1,
"post_ids": [7, 8],
"sender": { "name": "innovanet", "city": "Bratislava" }
}
$res = innovanet('POST', '/api/post/export', [
'carrier_id' => 1,
'post_ids' => [7, 8],
]);
Missing carrier_id or post_ids returns 400. sender fills the sender on the label.
Response – The response is a file, not JSON.
POST /api/post/import¶
This import updates existing shipment numbers using a carrier response. It requires permission to manage all mail. Send multipart/form-data.
| Field | Type | Required | Description |
|---|---|---|---|
carrier_id |
integer | yes | carrier identifier from list-info |
file |
file | yes | carrier response, such as Slovenská pošta XML |
Bash example: replace the carrier identifier and file path with your values.
curl -sS -X POST "https://api.innovanet.com/api/post/import" -H "Authorization: Bearer inv_mcp_…" -H "Accept: application/json" -F "carrier_id=1" -F "file=@response.xml"
PHP cURL: the file must be a CURLFile object. Do not use the JSON innovanet() helper for this request.
$ch = curl_init('https://api.innovanet.com/api/post/import');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer inv_mcp_…',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => [
'carrier_id' => 1,
'file' => new CURLFile(__DIR__ . '/response.xml'),
],
]);
$raw = curl_exec($ch);
$status = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$result = json_decode($raw, true);
Response 200 includes the processed count and any errors. Check the errors array even when the HTTP request succeeds.
{
"success": true,
"data": { "imported": 2, "errors": [] },
"message": "..."
}
Errors: 400 for a missing carrier/file or unsupported import, 403 without permission, 404 for an unknown carrier. This endpoint does not create new shipments.
GET /api/post/{id}/history-attachments¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/post/{id}/history¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
POST /api/post/{id}/comments¶
Body
| Field | Type | Required |
|---|---|---|
body |
string | no |
reason_id |
string | no |
{
"body": "text",
"reason_id": "text"
}
$res = innovanet('POST', '/api/post/1/comments', [
'body' => 'text',
'reason_id' => 'text',
]);
The API reads these fields. A field is required when the table says yes.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/post/{id}/attachments¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
POST /api/post/{id}/attachments¶
Attach a file to an accessible shipment. The file is required. Success: 200 with success: true; missing or invalid file: 400.
| Field | Type | Required |
|---|---|---|
file |
file | yes |
Send the file as multipart/form-data. Bash example:
curl -sS -X POST "https://api.innovanet.com/api/post/7/attachments" -H "Authorization: Bearer inv_mcp_…" -H "Accept: application/json" -F "file=@document.pdf"
DELETE /api/post/{id}/attachments/{attachmentId}¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/post/{id}/attachments/{attachmentId}/download¶
No body.
Response – The response is a file, not JSON.
GET /api/post/{id}/notified¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
PUT /api/post/{id}/notified¶
Body
| Field | Type | Required |
|---|---|---|
user_ids |
string | no |
{
"user_ids": "text"
}
$res = innovanet('PUT', '/api/post/1/notified', [
'user_ids' => 'text',
]);
The API reads these fields. A field is required when the table says yes.
Response 200 – Envelope { "success": true, "data": ... }.
Want to try this feature? Start your innovanet trial →