MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your API key from the API Keys section in the admin panel of Metrotec GPS web application.

Files

APIs for managing files

Get all files for a pivot

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/files?pivot_type=route_tasks&pivot_id=12345" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/files"
);

const params = {
    "pivot_type": "route_tasks",
    "pivot_id": "12345",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/files';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'pivot_type' => 'route_tasks',
            'pivot_id' => '12345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/files'
params = {
  'pivot_type': 'route_tasks',
  'pivot_id': '12345',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


[
    {
        "id": 1,
        "pivot_id": "12345",
        "pivot_type": "route_tasks",
        "defined_name": "document.pdf",
        "mime": "application/pdf",
        "file_type": "other",
        "uploaded_at": "2025-11-28T10:00:00.000000Z",
        "url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
    }
]
 

Request      

GET api/files

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

pivot_type   string     

The entity type Example: route_tasks

pivot_id   string     

The entity ID Example: 12345

Upload a new file

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/files" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "pivot_type=route_tasks"\
    --form "pivot_id=12345"\
    --form "max_files=5"\
    --form "hidden="\
    --form "file_type=image"\
    --form "auto_crop="\
    --form "auto_type=webp"\
    --form "file=@/tmp/phpnmjd1hlqfi4jcIQ2ZQU" 
const url = new URL(
    "https://api2.metrotec.ee/api/files"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('pivot_type', 'route_tasks');
body.append('pivot_id', '12345');
body.append('max_files', '5');
body.append('hidden', '');
body.append('file_type', 'image');
body.append('auto_crop', '');
body.append('auto_type', 'webp');
body.append('file', document.querySelector('input[name="file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/files';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'pivot_type',
                'contents' => 'route_tasks'
            ],
            [
                'name' => 'pivot_id',
                'contents' => '12345'
            ],
            [
                'name' => 'max_files',
                'contents' => '5'
            ],
            [
                'name' => 'hidden',
                'contents' => ''
            ],
            [
                'name' => 'file_type',
                'contents' => 'image'
            ],
            [
                'name' => 'auto_crop',
                'contents' => ''
            ],
            [
                'name' => 'auto_type',
                'contents' => 'webp'
            ],
            [
                'name' => 'file',
                'contents' => fopen('/tmp/phpnmjd1hlqfi4jcIQ2ZQU', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/files'
files = {
  'pivot_type': (None, 'route_tasks'),
  'pivot_id': (None, '12345'),
  'max_files': (None, '5'),
  'hidden': (None, ''),
  'file_type': (None, 'image'),
  'auto_crop': (None, ''),
  'auto_type': (None, 'webp'),
  'file': open('/tmp/phpnmjd1hlqfi4jcIQ2ZQU', 'rb')}
payload = {
    "pivot_type": "route_tasks",
    "pivot_id": "12345",
    "max_files": 5,
    "hidden": false,
    "file_type": "image",
    "auto_crop": false,
    "auto_type": "webp"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, files=files)
response.json()

Example response (201):


{
    "id": 1,
    "pivot_id": "12345",
    "pivot_type": "route_tasks",
    "defined_name": "document.pdf",
    "mime": "application/pdf",
    "file_type": "other",
    "uploaded_at": "2025-11-28T10:00:00.000000Z",
    "url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
 

Request      

POST api/files

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

file   file     

The file to upload. Must be a file. Example: /tmp/phpnmjd1hlqfi4jcIQ2ZQU

pivot_type   string     

Type of entity the file belongs to. Example: route_tasks

Must be one of:
  • accounts
  • logos
  • route_tasks
  • vehicle_faults
  • feedback_answers
  • tech_card_works
  • signatures
  • fish_documents
  • fish_document_signatures
pivot_id   string     

ID of the entity the file belongs to. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 12345

max_files   integer  optional    

Maximum number of files allowed for this entity. Väli value peab olema vähemalt 1. Example: 5

hidden   boolean  optional    

Whether the file should be hidden. Example: false

file_type   string  optional    

Type of file (image, cmr, delivery_note, etc.). Example: image

Must be one of:
  • image
  • cmr
  • delivery_note
  • order
  • other
  • receiver_signature
  • sender_signature
  • carrier_signature
  • fish_document
auto_crop   boolean  optional    

Automatically crop whitespace from images. Example: false

auto_type   string  optional    

Convert image to specified format. Example: webp

Must be one of:
  • jpg
  • gif
  • png
  • webp

Get a specific file

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/files/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/files/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/files/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/files/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "pivot_id": "12345",
    "pivot_type": "route_tasks",
    "defined_name": "document.pdf",
    "mime": "application/pdf",
    "file_type": "other",
    "uploaded_at": "2025-11-28T10:00:00.000000Z",
    "url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
 

Request      

GET api/files/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the file. Example: 1

file   integer     

File ID Example: 1

Update a file

requires authentication

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/files/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_type\": \"cmr\"
}"
const url = new URL(
    "https://api2.metrotec.ee/api/files/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "file_type": "cmr"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/files/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_type' => 'cmr',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/files/1'
payload = {
    "file_type": "cmr"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "pivot_id": "12345",
    "pivot_type": "route_tasks",
    "defined_name": "document.pdf",
    "mime": "application/pdf",
    "file_type": "cmr",
    "uploaded_at": "2025-11-28T10:00:00.000000Z",
    "url": "https://api.example.com/cli_img/metrotec_12345_abc123.pdf"
}
 

Request      

PUT api/files/{id}

PATCH api/files/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the file. Example: 1

file   integer     

File ID Example: 1

Body Parameters

file_type   string     

Type of file (image, cmr, delivery_note, etc.). Example: cmr

Must be one of:
  • image
  • cmr
  • delivery_note
  • order
  • other
  • receiver_signature
  • sender_signature
  • carrier_signature
  • fish_document

Delete a file

requires authentication

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/files/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/files/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/files/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/files/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

Empty response
 

Request      

DELETE api/files/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the file. Example: 1

file   integer     

File ID Example: 1

Add drawing overlay to an existing image

requires authentication

Takes an existing image file and overlays a PNG drawing on top of it. The original file is replaced with the new combined image.

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/drawing/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "file=@/tmp/php2jf8kapvso9l54ceGtK" 
const url = new URL(
    "https://api2.metrotec.ee/api/drawing/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/drawing/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'file',
                'contents' => fopen('/tmp/php2jf8kapvso9l54ceGtK', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/drawing/1'
files = {
  'file': open('/tmp/php2jf8kapvso9l54ceGtK', 'rb')}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, files=files)
response.json()

Example response (201):


{
    "id": 1,
    "pivot_id": "12345",
    "pivot_type": "route_tasks",
    "defined_name": "photo.png",
    "mime": "image/png",
    "file_type": "image",
    "uploaded_at": "2025-11-28T10:00:00.000000Z",
    "url": "https://api.example.com/cli_img/metrotec_12345_abc123.png"
}
 

Request      

POST api/drawing/{file_id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

file_id   integer     

The ID of the file. Example: 1

file   integer     

The file ID Example: 1

Body Parameters

file   file     

The PNG overlay image with transparency. Must be a file. Väli value peab olema pilt. Example: /tmp/php2jf8kapvso9l54ceGtK

Upload signature for route tasks

requires authentication

Uploads a signature image and associates it with one or more route tasks.

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/signature" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "ids[]=16"\
    --form "pivot_type=signatures"\
    --form "file_type=receiver_signature"\
    --form "signature=@/tmp/php88np7enjgtp14mgF4kH" 
const url = new URL(
    "https://api2.metrotec.ee/api/signature"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('ids[]', '16');
body.append('pivot_type', 'signatures');
body.append('file_type', 'receiver_signature');
body.append('signature', document.querySelector('input[name="signature"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/signature';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'ids[]',
                'contents' => '16'
            ],
            [
                'name' => 'pivot_type',
                'contents' => 'signatures'
            ],
            [
                'name' => 'file_type',
                'contents' => 'receiver_signature'
            ],
            [
                'name' => 'signature',
                'contents' => fopen('/tmp/php88np7enjgtp14mgF4kH', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/signature'
files = {
  'ids[]': (None, '16'),
  'pivot_type': (None, 'signatures'),
  'file_type': (None, 'receiver_signature'),
  'signature': open('/tmp/php88np7enjgtp14mgF4kH', 'rb')}
payload = {
    "ids": [
        16
    ],
    "pivot_type": "signatures",
    "file_type": "receiver_signature"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, files=files)
response.json()

Example response (201):


[
    {
        "id": 1,
        "pivot_id": "12345",
        "pivot_type": "signatures",
        "defined_name": "signature.png",
        "mime": "image/png",
        "file_type": "receiver_signature",
        "uploaded_at": "2025-11-28T10:00:00.000000Z",
        "url": "https://api.example.com/signatures/metrotec_12345_abc123.png"
    }
]
 

Request      

POST api/signature

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

Body Parameters

signature   file     

The signature image file. Must be a file. Väli value peab olema pilt. Example: /tmp/php88np7enjgtp14mgF4kH

ids   integer[]     
pivot_type   string  optional    

Type of pivot for signature storage. Example: signatures

Must be one of:
  • signatures
  • fish_document_signatures
file_type   string  optional    

Type of signature. Example: receiver_signature

Must be one of:
  • receiver_signature
  • sender_signature
  • carrier_signature

Fish Documents

APIs for managing fish transport documents

Get all fish documents

requires authentication

Returns documents that are not sent/finished, or sent/finished today.

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/fishdocuments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/fishdocuments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/fishdocuments';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/fishdocuments'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 1,
        "document_number": "FD-2026-001",
        "object_id": "ABC123",
        "ship_name": "Aurora",
        "receiver_id": 1,
        "receiver": {
            "id": 1,
            "company_name": "Fish Processing Ltd"
        },
        "destination_address": "Harbor Street 1, Tallinn",
        "quantity": 500.5,
        "status": 0,
        "created_at": "2026-01-14T10:00:00.000000Z",
        "updated_at": "2026-01-14T10:00:00.000000Z"
    }
]
 

Request      

GET api/fishdocuments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Create a new fish document

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/fishdocuments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"ABC123\",
    \"trailer_nr\": \"TRL-456\",
    \"ship_id\": 1,
    \"ship_name\": \"Aurora\",
    \"owner_name\": \"John Smith\",
    \"board_number\": \"EST-1234\",
    \"license_number\": \"LIC-2026-001\",
    \"voyage_number\": \"VOY-2026-005\",
    \"receiver_id\": 1,
    \"receiver_name\": \"Jane Doe\",
    \"destination_address\": \"Harbor Street 1, Tallinn\",
    \"destination_lat\": 59.437,
    \"destination_lon\": 24.753,
    \"products\": [
        {
            \"product_id\": 1,
            \"quantity\": 500,
            \"fishing_area\": \"IIId\"
        }
    ],
    \"category\": \"A\",
    \"captain_name\": \"Captain Jack\",
    \"carrier_id\": 1,
    \"unloading_at\": \"2026-01-15 10:00:00\",
    \"unloading_location\": \"Dock B\",
    \"status\": 0
}"
const url = new URL(
    "https://api2.metrotec.ee/api/fishdocuments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "ABC123",
    "trailer_nr": "TRL-456",
    "ship_id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "license_number": "LIC-2026-001",
    "voyage_number": "VOY-2026-005",
    "receiver_id": 1,
    "receiver_name": "Jane Doe",
    "destination_address": "Harbor Street 1, Tallinn",
    "destination_lat": 59.437,
    "destination_lon": 24.753,
    "products": [
        {
            "product_id": 1,
            "quantity": 500,
            "fishing_area": "IIId"
        }
    ],
    "category": "A",
    "captain_name": "Captain Jack",
    "carrier_id": 1,
    "unloading_at": "2026-01-15 10:00:00",
    "unloading_location": "Dock B",
    "status": 0
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/fishdocuments';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'ABC123',
            'trailer_nr' => 'TRL-456',
            'ship_id' => 1,
            'ship_name' => 'Aurora',
            'owner_name' => 'John Smith',
            'board_number' => 'EST-1234',
            'license_number' => 'LIC-2026-001',
            'voyage_number' => 'VOY-2026-005',
            'receiver_id' => 1,
            'receiver_name' => 'Jane Doe',
            'destination_address' => 'Harbor Street 1, Tallinn',
            'destination_lat' => 59.437,
            'destination_lon' => 24.753,
            'products' => [
                [
                    'product_id' => 1,
                    'quantity' => 500,
                    'fishing_area' => 'IIId',
                ],
            ],
            'category' => 'A',
            'captain_name' => 'Captain Jack',
            'carrier_id' => 1,
            'unloading_at' => '2026-01-15 10:00:00',
            'unloading_location' => 'Dock B',
            'status' => 0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/fishdocuments'
payload = {
    "object_id": "ABC123",
    "trailer_nr": "TRL-456",
    "ship_id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "license_number": "LIC-2026-001",
    "voyage_number": "VOY-2026-005",
    "receiver_id": 1,
    "receiver_name": "Jane Doe",
    "destination_address": "Harbor Street 1, Tallinn",
    "destination_lat": 59.437,
    "destination_lon": 24.753,
    "products": [
        {
            "product_id": 1,
            "quantity": 500,
            "fishing_area": "IIId"
        }
    ],
    "category": "A",
    "captain_name": "Captain Jack",
    "carrier_id": 1,
    "unloading_at": "2026-01-15 10:00:00",
    "unloading_location": "Dock B",
    "status": 0
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "id": 1,
    "document_number": "FD-2026-001",
    "object_id": "ABC123",
    "ship_name": "Aurora",
    "status": 0,
    "created_at": "2026-01-14T10:00:00.000000Z",
    "updated_at": "2026-01-14T10:00:00.000000Z"
}
 

Request      

POST api/fishdocuments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Vehicle/object identifier. Väli value ei tohi olla pikem kui 50 tähemärki. Example: ABC123

trailer_nr   string     

Trailer number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: TRL-456

ship_id   integer     

ID of the associated ship. The id of an existing record in the ships table. Example: 1

ship_name   string     

Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Aurora

owner_name   string     

Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Smith

board_number   string     

Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: EST-1234

license_number   string     

Fishing license number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: LIC-2026-001

voyage_number   string     

Voyage number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: VOY-2026-005

receiver_id   integer     

ID of the receiver party. The id of an existing record in the parties table. Example: 1

receiver_name   string  optional    

Receiver person name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Jane Doe

destination_address   string     

Destination address. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Harbor Street 1, Tallinn

destination_lat   number  optional    

Destination latitude. Example: 59.437

destination_lon   number  optional    

Destination longitude. Example: 24.753

products   object[]     

Array of products with quantities. Väljal value peab olema vähemalt 1 elementi.

id   integer  optional    

ID of the existing fish document product record (for updates). Example: 1

product_id   integer     

ID of the fish product type. The id of an existing record in the products table. Example: 1

quantity   integer     

Quantity of fish in kg. Väli value peab olema vähemalt 0. Example: 500

fishing_area   string  optional    

Fishing area code or name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: IIId

size_category   string  optional    

Size category. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Large

freshness_category   string  optional    

Freshness category. Väli value ei tohi olla pikem kui 255 tähemärki. Example: A

purpose   string  optional    

Purpose of the product. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Human consumption

count_number   string  optional    

Count number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 100

category   string  optional    

Fish category. Väli value ei tohi olla pikem kui 255 tähemärki. Example: A

captain_name   string     

Name of the captain. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Captain Jack

carrier_id   integer     

ID of the carrier party. The id of an existing record in the parties table. Example: 1

unloading_at   string  optional    

Unloading date and time. Väli value peab olema kehtiv kuupäev. Example: 2026-01-15 10:00:00

unloading_location   string  optional    

Unloading location. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Dock B

status   integer  optional    

Document status (0=new, 1=in progress, 2=completed). Väli value peab olema vähemalt 0. Väli value ei tohi olla suurem kui 255. Example: 0

Get a specific fish document

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/fishdocuments/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/fishdocuments/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/fishdocuments/16';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/fishdocuments/16'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "document_number": "FD-2026-001",
    "object_id": "ABC123",
    "trailer_nr": "TRL-456",
    "ship_id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "license_number": "LIC-2026-001",
    "voyage_number": "VOY-2026-005",
    "receiver_id": 1,
    "receiver": {
        "id": 1,
        "company_name": "Fish Processing Ltd"
    },
    "receiver_name": "Jane Doe",
    "destination_address": "Harbor Street 1, Tallinn",
    "destination_lat": 59.437,
    "destination_lon": 24.753,
    "product_id": 1,
    "quantity": 500.5,
    "fishing_area": "IIId",
    "containers": 10,
    "category": "A",
    "captain_name": "Captain Jack",
    "carrier_name": "Transport Co",
    "unloading_at": "2026-01-15T10:00:00.000000Z",
    "unloading_location": "Dock B",
    "status": 0,
    "captain_signed": false,
    "carrier_signed": false,
    "receiver_signed": false,
    "created_at": "2026-01-14T10:00:00.000000Z",
    "updated_at": "2026-01-14T10:00:00.000000Z"
}
 

Request      

GET api/fishdocuments/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the fishdocument. Example: 16

fishDocument   integer     

Fish Document ID Example: 1

Update a fish document

requires authentication

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/fishdocuments/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"ABC123\",
    \"trailer_nr\": \"TRL-456\",
    \"ship_id\": 1,
    \"ship_name\": \"Aurora\",
    \"owner_name\": \"John Smith\",
    \"board_number\": \"EST-1234\",
    \"license_number\": \"LIC-2026-001\",
    \"voyage_number\": \"VOY-2026-005\",
    \"receiver_id\": 1,
    \"receiver_name\": \"Jane Doe\",
    \"destination_address\": \"Harbor Street 1, Tallinn\",
    \"destination_lat\": 59.437,
    \"destination_lon\": 24.753,
    \"products\": [
        {
            \"product_id\": 1,
            \"quantity\": 500,
            \"fishing_area\": \"IIId\"
        }
    ],
    \"category\": \"A\",
    \"captain_name\": \"Captain Jack\",
    \"carrier_id\": 1,
    \"unloading_at\": \"2026-01-15 10:00:00\",
    \"unloading_location\": \"Dock B\",
    \"status\": 0
}"
const url = new URL(
    "https://api2.metrotec.ee/api/fishdocuments/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "ABC123",
    "trailer_nr": "TRL-456",
    "ship_id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "license_number": "LIC-2026-001",
    "voyage_number": "VOY-2026-005",
    "receiver_id": 1,
    "receiver_name": "Jane Doe",
    "destination_address": "Harbor Street 1, Tallinn",
    "destination_lat": 59.437,
    "destination_lon": 24.753,
    "products": [
        {
            "product_id": 1,
            "quantity": 500,
            "fishing_area": "IIId"
        }
    ],
    "category": "A",
    "captain_name": "Captain Jack",
    "carrier_id": 1,
    "unloading_at": "2026-01-15 10:00:00",
    "unloading_location": "Dock B",
    "status": 0
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/fishdocuments/16';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'ABC123',
            'trailer_nr' => 'TRL-456',
            'ship_id' => 1,
            'ship_name' => 'Aurora',
            'owner_name' => 'John Smith',
            'board_number' => 'EST-1234',
            'license_number' => 'LIC-2026-001',
            'voyage_number' => 'VOY-2026-005',
            'receiver_id' => 1,
            'receiver_name' => 'Jane Doe',
            'destination_address' => 'Harbor Street 1, Tallinn',
            'destination_lat' => 59.437,
            'destination_lon' => 24.753,
            'products' => [
                [
                    'product_id' => 1,
                    'quantity' => 500,
                    'fishing_area' => 'IIId',
                ],
            ],
            'category' => 'A',
            'captain_name' => 'Captain Jack',
            'carrier_id' => 1,
            'unloading_at' => '2026-01-15 10:00:00',
            'unloading_location' => 'Dock B',
            'status' => 0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/fishdocuments/16'
payload = {
    "object_id": "ABC123",
    "trailer_nr": "TRL-456",
    "ship_id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "license_number": "LIC-2026-001",
    "voyage_number": "VOY-2026-005",
    "receiver_id": 1,
    "receiver_name": "Jane Doe",
    "destination_address": "Harbor Street 1, Tallinn",
    "destination_lat": 59.437,
    "destination_lon": 24.753,
    "products": [
        {
            "product_id": 1,
            "quantity": 500,
            "fishing_area": "IIId"
        }
    ],
    "category": "A",
    "captain_name": "Captain Jack",
    "carrier_id": 1,
    "unloading_at": "2026-01-15 10:00:00",
    "unloading_location": "Dock B",
    "status": 0
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "document_number": "FD-2026-001",
    "object_id": "ABC123",
    "ship_name": "Aurora Updated",
    "status": 1,
    "created_at": "2026-01-14T10:00:00.000000Z",
    "updated_at": "2026-01-14T11:00:00.000000Z"
}
 

Request      

PUT api/fishdocuments/{id}

PATCH api/fishdocuments/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the fishdocument. Example: 16

fishDocument   integer     

Fish Document ID Example: 1

Body Parameters

object_id   string     

Vehicle/object identifier. Väli value ei tohi olla pikem kui 50 tähemärki. Example: ABC123

trailer_nr   string     

Trailer number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: TRL-456

ship_id   integer     

ID of the associated ship. The id of an existing record in the ships table. Example: 1

ship_name   string     

Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Aurora

owner_name   string     

Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Smith

board_number   string     

Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: EST-1234

license_number   string     

Fishing license number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: LIC-2026-001

voyage_number   string     

Voyage number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: VOY-2026-005

receiver_id   integer     

ID of the receiver party. The id of an existing record in the parties table. Example: 1

receiver_name   string  optional    

Receiver person name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Jane Doe

destination_address   string     

Destination address. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Harbor Street 1, Tallinn

destination_lat   number  optional    

Destination latitude. Example: 59.437

destination_lon   number  optional    

Destination longitude. Example: 24.753

products   object[]     

Array of products with quantities. Väljal value peab olema vähemalt 1 elementi.

id   integer  optional    

ID of the existing fish document product record (for updates). Example: 1

product_id   integer     

ID of the fish product type. The id of an existing record in the products table. Example: 1

quantity   integer     

Quantity of fish in kg. Väli value peab olema vähemalt 0. Example: 500

fishing_area   string  optional    

Fishing area code or name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: IIId

size_category   string  optional    

Size category. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Large

freshness_category   string  optional    

Freshness category. Väli value ei tohi olla pikem kui 255 tähemärki. Example: A

purpose   string  optional    

Purpose of the product. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Human consumption

count_number   string  optional    

Count number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 100

category   string  optional    

Fish category. Väli value ei tohi olla pikem kui 255 tähemärki. Example: A

captain_name   string     

Name of the captain. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Captain Jack

carrier_id   integer     

ID of the carrier party. The id of an existing record in the parties table. Example: 1

unloading_at   string  optional    

Unloading date and time. Väli value peab olema kehtiv kuupäev. Example: 2026-01-15 10:00:00

unloading_location   string  optional    

Unloading location. Example: Dock B

status   integer  optional    

Document status (0=new, 1=in progress, 2=completed). Väli value peab olema vähemalt 0. Väli value ei tohi olla suurem kui 255. Example: 0

Fish Documents Report

API for fish documents report

Get fish documents report

requires authentication

Returns fish documents filtered by date range and other criteria.

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/fishdocuments/report?filter[start_time][]=2026-01-01&filter[start_time][]=2026-01-31&filter[status]=1&filter[ship_id]=1&filter[object_id]=ABC123&filter[carrier_id]=1&filter%5Bstart_time%5D[]=2026-01-01&filter%5Bstart_time%5D[]=2026-01-31&filter%5Bstatus%5D=1&filter%5Bship_id%5D=1&filter%5Bobject_id%5D=ABC123&filter%5Bcarrier_id%5D=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/fishdocuments/report"
);

const params = {
    "filter[start_time][0]": "2026-01-01",
    "filter[start_time][1]": "2026-01-31",
    "filter[status]": "1",
    "filter[ship_id]": "1",
    "filter[object_id]": "ABC123",
    "filter[carrier_id]": "1",
    "filter[start_time][0]": "2026-01-01",
    "filter[start_time][1]": "2026-01-31",
    "filter[status]": "1",
    "filter[ship_id]": "1",
    "filter[object_id]": "ABC123",
    "filter[carrier_id]": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/fishdocuments/report';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter[start_time][0]' => '2026-01-01',
            'filter[start_time][1]' => '2026-01-31',
            'filter[status]' => '1',
            'filter[ship_id]' => '1',
            'filter[object_id]' => 'ABC123',
            'filter[carrier_id]' => '1',
            'filter[start_time][0]' => '2026-01-01',
            'filter[start_time][1]' => '2026-01-31',
            'filter[status]' => '1',
            'filter[ship_id]' => '1',
            'filter[object_id]' => 'ABC123',
            'filter[carrier_id]' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/fishdocuments/report'
params = {
  'filter[start_time][0]': '2026-01-01',
  'filter[start_time][1]': '2026-01-31',
  'filter[status]': '1',
  'filter[ship_id]': '1',
  'filter[object_id]': 'ABC123',
  'filter[carrier_id]': '1',
  'filter[start_time][0]': '2026-01-01',
  'filter[start_time][1]': '2026-01-31',
  'filter[status]': '1',
  'filter[ship_id]': '1',
  'filter[object_id]': 'ABC123',
  'filter[carrier_id]': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/fishdocuments/report

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter.start_time   object  optional    
filter   object  optional    
filter.start_time.0   string     

Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga filter.start_time.1. Example: 2026-01-01

filter.start_time.1   string     

End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga filter.start_time.0. Example: 2026-01-31

filter.status   integer  optional    

Filter by status (0=New, 1=InWorks, 2=Sent, 3=Finished). Example: 1

filter.ship_id   integer  optional    

Filter by ship ID. Example: 1

filter.object_id   string  optional    

Filter by vehicle/object ID. Väli value ei tohi olla pikem kui 255 tähemärki. Example: ABC123

filter.carrier_id   integer  optional    

Filter by carrier ID. Example: 1

filter[start_time]   string[]     

Date range [from, to] in YYYY-MM-DD format

filter[status]   integer  optional    

Filter by status Example: 1

filter[ship_id]   integer  optional    

Filter by ship ID Example: 1

filter[object_id]   string  optional    

Filter by vehicle/object ID Example: ABC123

filter[carrier_id]   integer  optional    

Filter by carrier ID Example: 1

Export fish documents report to Excel

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/xls/fishdocuments?filter[start_time][]=2026-01-01&filter[start_time][]=2026-01-31&filter[status]=1&filter[ship_id]=1&filter[object_id]=ABC123&filter[carrier_id]=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/xls/fishdocuments"
);

const params = {
    "filter[start_time][0]": "2026-01-01",
    "filter[start_time][1]": "2026-01-31",
    "filter[status]": "1",
    "filter[ship_id]": "1",
    "filter[object_id]": "ABC123",
    "filter[carrier_id]": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/xls/fishdocuments';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter[start_time][0]' => '2026-01-01',
            'filter[start_time][1]' => '2026-01-31',
            'filter[status]' => '1',
            'filter[ship_id]' => '1',
            'filter[object_id]' => 'ABC123',
            'filter[carrier_id]' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/xls/fishdocuments'
params = {
  'filter[start_time][0]': '2026-01-01',
  'filter[start_time][1]': '2026-01-31',
  'filter[status]': '1',
  'filter[ship_id]': '1',
  'filter[object_id]': 'ABC123',
  'filter[carrier_id]': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
set-cookie: XSRF-TOKEN=eyJpdiI6ImU1ZCsrRS9QZHZadVpHNGo0UEJLUHc9PSIsInZhbHVlIjoiSVZVL0grekM5Wmo3aTRCZjZJeUIwUFh6RlBNZElhcFVBZDhQaGlBNFNBdTJ0MmpUTXFPODVySFU5dUwvTjF1QkVQdGEwaW53c0l4VlVqemZNNloyVGVDcnk1d2dJM3VCNnQyVmxZZ0dlalRrYmlNcmZUMVlZUTJ6dHFxdjVlZ2EiLCJtYWMiOiI2MTNlNDgwNGU0NDgxNzVlMWFmNTUyYTM3OThhNDE1ZTY5MWY4ZDY2MjMyMTE1NDE0ZjBhYTk1YTBlNzM4NjUwIiwidGFnIjoiIn0%3D; expires=Mon, 13 Apr 2026 09:54:27 GMT; Max-Age=7200; path=/; secure; samesite=lax; metrotec_session=eyJpdiI6Iks3a2wxeVhOSHVNV2xYYTlIMGtvdGc9PSIsInZhbHVlIjoiT09ub1U4WXpwdlY0UEtSUjF6c2Z0YkdRMVBQZTIyYlBJdXU1ZjY2QVNLcHlmcjd2VWVVekZ5a3ZDUnV1dzFRVmhWVFJtNENZYVYyNEUxQklLWlJOellYdk9rSWdyRGFWY2xXOWkrYWZ6NHcrVkpXZlBkU0VORytzVUYyN2w2MGEiLCJtYWMiOiI4ZjJlMzU1MWIyNTZmZDAwZGJhYzQ1ZGNjNTk5NTFkZTI3ZTNiZmMyMjQwNWIxYWNkNzRhZmNiMGE4MTAyODE1IiwidGFnIjoiIn0%3D; expires=Mon, 13 Apr 2026 09:54:27 GMT; Max-Age=7200; path=/; secure; httponly; samesite=lax
 

{
    "message": "Unauthenticated."
}
 

Request      

GET xls/fishdocuments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter.start_time   object  optional    
filter   object  optional    
filter.start_time.0   string     

Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga filter.start_time.1. Example: 2026-01-01

filter.start_time.1   string     

End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga filter.start_time.0. Example: 2026-01-31

filter.status   integer  optional    

Filter by status (0=New, 1=InWorks, 2=Sent, 3=Finished). Example: 1

filter.ship_id   integer  optional    

Filter by ship ID. Example: 1

filter.object_id   string  optional    

Filter by vehicle/object ID. Väli value ei tohi olla pikem kui 255 tähemärki. Example: ABC123

filter.carrier_id   integer  optional    

Filter by carrier ID. Example: 1

Export fish documents report to PDF

requires authentication

Combines all fish document PDFs into a single file.

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/pdf/fishdocuments?filter[start_time][]=2026-01-01&filter[start_time][]=2026-01-31&filter[status]=1&filter[ship_id]=1&filter[object_id]=ABC123&filter[carrier_id]=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/pdf/fishdocuments"
);

const params = {
    "filter[start_time][0]": "2026-01-01",
    "filter[start_time][1]": "2026-01-31",
    "filter[status]": "1",
    "filter[ship_id]": "1",
    "filter[object_id]": "ABC123",
    "filter[carrier_id]": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/pdf/fishdocuments';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter[start_time][0]' => '2026-01-01',
            'filter[start_time][1]' => '2026-01-31',
            'filter[status]' => '1',
            'filter[ship_id]' => '1',
            'filter[object_id]' => 'ABC123',
            'filter[carrier_id]' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/pdf/fishdocuments'
params = {
  'filter[start_time][0]': '2026-01-01',
  'filter[start_time][1]': '2026-01-31',
  'filter[status]': '1',
  'filter[ship_id]': '1',
  'filter[object_id]': 'ABC123',
  'filter[carrier_id]': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
set-cookie: XSRF-TOKEN=eyJpdiI6IncrUS9lUld3Z2JNVzBKRC9rRXNRRHc9PSIsInZhbHVlIjoiK0l4YkFJQmxNYmt1TmVpZDFTZGlRcmo3N2xCWVRGSCtFVzFjeXdQcmI3QVlmTWxyNjhzRHBSTGhRbUpsUVRwUVl0b1FwZkdLakpDYlhLVXkzcW9ocmYxeEVJVStCRlRZTVBWWDRITlZ0TGlIa0xGM1dSdFZ1czBBSENUV2cxQy8iLCJtYWMiOiJlNzVjMWE0MTU2ZDJjNTE3YzBmOGFjNWMwYmFkOWY1YzI2ZjkwNTI0OTdkMGIzOGU0NTcxYjlmYTVhZTU0ZWExIiwidGFnIjoiIn0%3D; expires=Mon, 13 Apr 2026 09:54:27 GMT; Max-Age=7200; path=/; secure; samesite=lax; metrotec_session=eyJpdiI6InNaME82SldON1ppTlkyNkxGRlk0K1E9PSIsInZhbHVlIjoiWUF4MjYrUURENm5uTkFDbXNMN0RFSXBpK0wrSkpObTBtMTE2SnU4dWpKQy9wUkdsOE1kVzZNTlJxK0NlUFk0SDIwRXV3eDc0NDJ0WVRNUDFqelFFS1ZZeGttc3kxMjRIUDcrb0k0SzBjeGpibXpBZG94R1dxNVAwaDhYSlUwK0wiLCJtYWMiOiI1YzUzNWIzYjliODQ1NTdmZDhhOTE5OWY0OTU5MTdmZjUxN2I1MDIzMzhjY2VjMTZkNzU3ODY2NjkwMDZkYmViIiwidGFnIjoiIn0%3D; expires=Mon, 13 Apr 2026 09:54:27 GMT; Max-Age=7200; path=/; secure; httponly; samesite=lax
 

{
    "message": "Unauthenticated."
}
 

Request      

GET pdf/fishdocuments

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter.start_time   object  optional    
filter   object  optional    
filter.start_time.0   string     

Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga filter.start_time.1. Example: 2026-01-01

filter.start_time.1   string     

End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga filter.start_time.0. Example: 2026-01-31

filter.status   integer  optional    

Filter by status (0=New, 1=InWorks, 2=Sent, 3=Finished). Example: 1

filter.ship_id   integer  optional    

Filter by ship ID. Example: 1

filter.object_id   string  optional    

Filter by vehicle/object ID. Väli value ei tohi olla pikem kui 255 tähemärki. Example: ABC123

filter.carrier_id   integer  optional    

Filter by carrier ID. Example: 1

Parties

APIs for managing parties

Get all parties

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/parties?filter%5Barchived%5D=1&filter%5Brole%5D=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/parties"
);

const params = {
    "filter[archived]": "1",
    "filter[role]": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/parties';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter[archived]' => '1',
            'filter[role]' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/parties'
params = {
  'filter[archived]': '1',
  'filter[role]': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


[
    {
        "id": 1,
        "oid": "metrotec",
        "role": [
            1,
            2
        ],
        "lang": "est",
        "company_name": "Example Company",
        "company_no": "12345678",
        "company_vat_no": "EE123456789",
        "company_country_code": "+372",
        "company_phone_nr": "5555 5555",
        "company_email": "info@example.com",
        "company_address": "Example Street 1, Tallinn",
        "contact_name": "John Doe",
        "contact_country_code": "+372",
        "contact_phone_nr": "5555 5556",
        "contact_email": "john@example.com",
        "active": true,
        "default": false,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-11-28T10:00:00.000000Z"
    }
]
 

Request      

GET api/parties

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[archived]   boolean  optional    

Show all parties including inactive Example: true

filter[role]   integer  optional    

Filter by role ID (searches in JSON array) Example: 1

Create a new party

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/parties" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"company_name\": \"Example Company\",
    \"role\": [
        1
    ],
    \"lang\": \"est\",
    \"company_no\": \"12345678\",
    \"company_vat_no\": \"EE123456789\",
    \"company_country_code\": \"+372\",
    \"company_phone_nr\": \"5555 5555\",
    \"company_email\": \"info@example.com\",
    \"company_address\": \"Example Street 1, Tallinn\",
    \"contact_name\": \"John Doe\",
    \"contact_country_code\": \"+372\",
    \"contact_phone_nr\": \"5555 5556\",
    \"contact_email\": \"john@example.com\",
    \"active\": false,
    \"default\": false
}"
const url = new URL(
    "https://api2.metrotec.ee/api/parties"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "company_name": "Example Company",
    "role": [
        1
    ],
    "lang": "est",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": false,
    "default": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/parties';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'company_name' => 'Example Company',
            'role' => [
                1,
            ],
            'lang' => 'est',
            'company_no' => '12345678',
            'company_vat_no' => 'EE123456789',
            'company_country_code' => '+372',
            'company_phone_nr' => '5555 5555',
            'company_email' => 'info@example.com',
            'company_address' => 'Example Street 1, Tallinn',
            'contact_name' => 'John Doe',
            'contact_country_code' => '+372',
            'contact_phone_nr' => '5555 5556',
            'contact_email' => 'john@example.com',
            'active' => false,
            'default' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/parties'
payload = {
    "company_name": "Example Company",
    "role": [
        1
    ],
    "lang": "est",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": false,
    "default": false
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "id": 1,
    "oid": "metrotec",
    "role": [
        1,
        2
    ],
    "def_lang": "est",
    "company_name": "Example Company",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": true,
    "default": false,
    "created_at": "2025-11-28T10:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

POST api/parties

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

company_name   string     

Company name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Example Company

role   integer[]     

Role IDs (1 = Customer, 2 = Sender, 3 = Carrier).

Must be one of:
  • 1
  • 2
  • 3
lang   string     

Default language for communications (est, rus, eng, swe, lat). Example: est

Must be one of:
  • est
  • rus
  • eng
  • swe
  • lat
company_no   string     

Company registration number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 12345678

company_vat_no   string  optional    

VAT number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: EE123456789

company_country_code   string  optional    

Company phone country code. Väli value ei tohi olla pikem kui 10 tähemärki. Example: +372

company_phone_nr   string  optional    

Company phone number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 5555 5555

company_email   string  optional    

Company email address. Väli value peab olema kehtiv e-posti aadress. Väli value ei tohi olla pikem kui 255 tähemärki. Example: info@example.com

company_address   string  optional    

Company legal address. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Example Street 1, Tallinn

contact_name   string  optional    

Contact person name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Doe

contact_country_code   string  optional    

Contact person phone country code. Väli value ei tohi olla pikem kui 10 tähemärki. Example: +372

contact_phone_nr   string  optional    

Contact person phone number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 5555 5556

contact_email   string  optional    

Contact person email. Väli value peab olema kehtiv e-posti aadress. Väli value ei tohi olla pikem kui 255 tähemärki. Example: john@example.com

active   boolean  optional    

Whether the party is active. Example: false

default   boolean  optional    

Whether this is the default party for the role (only one per role per organization). Example: false

Get a specific party

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/parties/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/parties/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/parties/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/parties/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "oid": "metrotec",
    "role": [
        1,
        2
    ],
    "def_lang": "est",
    "company_name": "Example Company",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": true,
    "default": false,
    "created_at": "2025-01-01T00:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

GET api/parties/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the party. Example: 1

party   integer     

Party ID Example: 1

Update a party

requires authentication

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/parties/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"company_name\": \"Example Company\",
    \"role\": [
        1
    ],
    \"lang\": \"est\",
    \"company_no\": \"12345678\",
    \"company_vat_no\": \"EE123456789\",
    \"company_country_code\": \"+372\",
    \"company_phone_nr\": \"5555 5555\",
    \"company_email\": \"info@example.com\",
    \"company_address\": \"Example Street 1, Tallinn\",
    \"contact_name\": \"John Doe\",
    \"contact_country_code\": \"+372\",
    \"contact_phone_nr\": \"5555 5556\",
    \"contact_email\": \"john@example.com\",
    \"active\": false,
    \"default\": false
}"
const url = new URL(
    "https://api2.metrotec.ee/api/parties/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "company_name": "Example Company",
    "role": [
        1
    ],
    "lang": "est",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": false,
    "default": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/parties/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'company_name' => 'Example Company',
            'role' => [
                1,
            ],
            'lang' => 'est',
            'company_no' => '12345678',
            'company_vat_no' => 'EE123456789',
            'company_country_code' => '+372',
            'company_phone_nr' => '5555 5555',
            'company_email' => 'info@example.com',
            'company_address' => 'Example Street 1, Tallinn',
            'contact_name' => 'John Doe',
            'contact_country_code' => '+372',
            'contact_phone_nr' => '5555 5556',
            'contact_email' => 'john@example.com',
            'active' => false,
            'default' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/parties/1'
payload = {
    "company_name": "Example Company",
    "role": [
        1
    ],
    "lang": "est",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": false,
    "default": false
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "oid": "metrotec",
    "role": [
        1,
        2
    ],
    "def_lang": "est",
    "company_name": "Updated Company",
    "company_no": "12345678",
    "company_vat_no": "EE123456789",
    "company_country_code": "+372",
    "company_phone_nr": "5555 5555",
    "company_email": "info@example.com",
    "company_address": "Example Street 1, Tallinn",
    "contact_name": "John Doe",
    "contact_country_code": "+372",
    "contact_phone_nr": "5555 5556",
    "contact_email": "john@example.com",
    "active": true,
    "default": false,
    "created_at": "2025-01-01T00:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

PUT api/parties/{id}

PATCH api/parties/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the party. Example: 1

party   integer     

Party ID Example: 1

Body Parameters

company_name   string     

Company name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Example Company

role   integer[]     

Role IDs (1 = Customer, 2 = Sender, 3 = Carrier).

Must be one of:
  • 1
  • 2
  • 3
lang   string     

Default language for communications (est, rus, eng, swe, lat). Example: est

Must be one of:
  • est
  • rus
  • eng
  • swe
  • lat
company_no   string     

Company registration number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 12345678

company_vat_no   string  optional    

VAT number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: EE123456789

company_country_code   string  optional    

Company phone country code. Väli value ei tohi olla pikem kui 10 tähemärki. Example: +372

company_phone_nr   string  optional    

Company phone number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 5555 5555

company_email   string  optional    

Company email address. Väli value peab olema kehtiv e-posti aadress. Väli value ei tohi olla pikem kui 255 tähemärki. Example: info@example.com

company_address   string  optional    

Company legal address. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Example Street 1, Tallinn

contact_name   string  optional    

Contact person name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Doe

contact_country_code   string  optional    

Contact person phone country code. Väli value ei tohi olla pikem kui 10 tähemärki. Example: +372

contact_phone_nr   string  optional    

Contact person phone number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 5555 5556

contact_email   string  optional    

Contact person email. Väli value peab olema kehtiv e-posti aadress. Väli value ei tohi olla pikem kui 255 tähemärki. Example: john@example.com

active   boolean  optional    

Whether the party is active. Example: false

default   boolean  optional    

Whether this is the default party for the role (only one per role per organization). Example: false

Delete a party

requires authentication

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/parties/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/parties/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/parties/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/parties/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

Empty response
 

Request      

DELETE api/parties/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the party. Example: 1

party   integer     

Party ID Example: 1

Products

APIs for managing route task products

Get all products

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/products?archived=1&show_type=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/products"
);

const params = {
    "archived": "1",
    "show_type": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/products';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'archived' => '1',
            'show_type' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/products'
params = {
  'archived': '1',
  'show_type': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


[
    {
        "id": 1,
        "oid": "metrotec",
        "value": "PROD001",
        "text": "Product Name",
        "external_id": "EXT123",
        "active": true,
        "default": false,
        "show_type": 1,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-11-28T10:00:00.000000Z"
    }
]
 

Request      

GET api/products

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

archived   boolean  optional    

Show all products including inactive Example: true

show_type   integer  optional    

Filter by show type (1 = RouteTask, 2 = FishDocument) Example: 1

Create a new product

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/products" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"value\": \"PROD001\",
    \"text\": \"Product Name\",
    \"external_id\": \"EXT123\",
    \"comment\": \"Additional product information\",
    \"active\": false,
    \"default\": false,
    \"show_type\": 1
}"
const url = new URL(
    "https://api2.metrotec.ee/api/products"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "value": "PROD001",
    "text": "Product Name",
    "external_id": "EXT123",
    "comment": "Additional product information",
    "active": false,
    "default": false,
    "show_type": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/products';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'value' => 'PROD001',
            'text' => 'Product Name',
            'external_id' => 'EXT123',
            'comment' => 'Additional product information',
            'active' => false,
            'default' => false,
            'show_type' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/products'
payload = {
    "value": "PROD001",
    "text": "Product Name",
    "external_id": "EXT123",
    "comment": "Additional product information",
    "active": false,
    "default": false,
    "show_type": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "id": 1,
    "oid": "metrotec",
    "value": "PROD001",
    "text": "Product Name",
    "external_id": "EXT123",
    "active": true,
    "default": false,
    "created_at": "2025-11-28T10:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

POST api/products

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

value   string     

Product code. Väli value ei tohi olla pikem kui 10 tähemärki. Example: PROD001

text   string     

Product name. Väli value ei tohi olla pikem kui 150 tähemärki. Example: Product Name

external_id   string  optional    

External system identifier. Väli value ei tohi olla pikem kui 30 tähemärki. Example: EXT123

comment   string  optional    

Product comment. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Additional product information

active   boolean  optional    

Whether the product is active. Example: false

default   boolean  optional    

Whether this is the default product (only one per organization). Example: false

show_type   integer  optional    

Where the product should be shown (1 = RouteTask, 2 = FishDocument). Example: 1

Must be one of:
  • 1
  • 2

Get a specific product

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/products/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/products/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/products/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/products/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "oid": "metrotec",
    "value": "PROD001",
    "text": "Product Name",
    "external_id": "EXT123",
    "active": true,
    "default": false,
    "created_at": "2025-01-01T00:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

GET api/products/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

product   integer     

Product ID Example: 1

Update a product

requires authentication

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/products/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"value\": \"PROD001\",
    \"text\": \"Product Name\",
    \"external_id\": \"EXT123\",
    \"comment\": \"Additional product information\",
    \"active\": false,
    \"default\": false,
    \"show_type\": 1
}"
const url = new URL(
    "https://api2.metrotec.ee/api/products/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "value": "PROD001",
    "text": "Product Name",
    "external_id": "EXT123",
    "comment": "Additional product information",
    "active": false,
    "default": false,
    "show_type": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/products/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'value' => 'PROD001',
            'text' => 'Product Name',
            'external_id' => 'EXT123',
            'comment' => 'Additional product information',
            'active' => false,
            'default' => false,
            'show_type' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/products/1'
payload = {
    "value": "PROD001",
    "text": "Product Name",
    "external_id": "EXT123",
    "comment": "Additional product information",
    "active": false,
    "default": false,
    "show_type": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "oid": "metrotec",
    "value": "PROD001",
    "text": "Updated Product Name",
    "external_id": "EXT123",
    "active": true,
    "default": false,
    "created_at": "2025-01-01T00:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

PUT api/products/{id}

PATCH api/products/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

product   integer     

Product ID Example: 1

Body Parameters

value   string     

Product code. Väli value ei tohi olla pikem kui 10 tähemärki. Example: PROD001

text   string     

Product name. Väli value ei tohi olla pikem kui 150 tähemärki. Example: Product Name

external_id   string  optional    

External system identifier. Väli value ei tohi olla pikem kui 30 tähemärki. Example: EXT123

comment   string  optional    

Product comment. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Additional product information

active   boolean  optional    

Whether the product is active. Example: false

default   boolean  optional    

Whether this is the default product (only one per organization). Example: false

show_type   integer  optional    

Where the product should be shown (1 = RouteTask, 2 = FishDocument). Example: 1

Must be one of:
  • 1
  • 2

Delete a product

requires authentication

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/products/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/products/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/products/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/products/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

Empty response
 

Request      

DELETE api/products/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

product   integer     

Product ID Example: 1

Route Tasks

APIs for managing route tasks. Route tasks support different task types based on user profile:

Get all tasks

Returns a list of route tasks for the authenticated user. By default, only active tasks are returned.

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/tasks?all=&offset=0&limit=30&files=" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/tasks"
);

const params = {
    "all": "0",
    "offset": "0",
    "limit": "30",
    "files": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/tasks';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'all' => '0',
            'offset' => '0',
            'limit' => '30',
            'files' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/tasks'
params = {
  'all': '0',
  'offset': '0',
  'limit': '30',
  'files': '0',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Standard Task):


[
    {
        "id": 12346,
        "oid": "metrotec",
        "object_id": "ABC123",
        "lat": 59.437,
        "lon": 24.754,
        "start_lat": null,
        "start_lon": null,
        "start_address": null,
        "start_time": "2025-01-20 08:00:00",
        "stop_time": "2025-01-20 17:00:00",
        "order_ref": "ORDER-2025-001",
        "order_details": null,
        "task_address": "Tallinn, Estonia",
        "task_description": "Standard delivery task",
        "cancel_reason": null,
        "status": 1,
        "created_at": "2025-01-19 16:00:00",
        "updated_at": "2025-01-19 16:00:00",
        "work_started_at": null,
        "work_finished_at": null,
        "sender": "DispatchSystem",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": null,
        "active": true,
        "group_id": null,
        "is_not_own_vehicle": false,
        "products": []
    }
]
 

Example response (200, Rudus Task):


[
    {
        "id": 12345,
        "oid": "metrotec",
        "object_id": "RUDUS-01",
        "lat": 59.437,
        "lon": 24.754,
        "start_lat": 59.395,
        "start_lon": 24.662,
        "start_address": "Factory, Tallinn",
        "start_time": "2025-01-20 08:00:00",
        "stop_time": "2025-01-20 12:00:00",
        "order_ref": "RUDUS-2025-001",
        "order_details": "Client: Construction Site A",
        "task_address": "Construction Site A, Tallinn",
        "task_description": "Concrete delivery C30/37",
        "cancel_reason": null,
        "status": 2,
        "created_at": "2025-01-19 15:30:00",
        "updated_at": "2025-01-20 08:15:00",
        "work_started_at": "2025-01-20 08:05:00",
        "work_finished_at": "2025-01-20 11:45:00",
        "sender": "RudusAPI",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": "Special delivery",
        "active": true,
        "group_id": 10,
        "is_not_own_vehicle": false,
        "preparation_time": "2025-01-20 07:30:00",
        "volume": 8.5,
        "client_id": "CLIENT123",
        "ordered_volume": 10,
        "delivered_volume": 8.2,
        "pumped_volume": 8,
        "dn_trash": "0.5",
        "dn_plastic": "1.2",
        "dn_water": "10.5",
        "categoryID": 15,
        "client_emails": [
            "client@example.com",
            "manager@example.com"
        ],
        "last_cargo": 0,
        "geozone_entered_at": "2025-01-20 11:20:00",
        "arrived_at": "2025-01-20 11:15:00",
        "geozone_left_at": "2025-01-20 11:50:00",
        "concrete_type": "C30/37",
        "concrete_strength_class": "C30",
        "environmental_class": "XC3",
        "dmax": "16",
        "consistency_class": "S3",
        "cement_type": "CEM II/A-LL 42,5N",
        "additives": "Superplasticizer",
        "concrete_extra_info": "High durability",
        "concrete_extra_info2": "Special finish required",
        "unload_method": "Pump",
        "driving_instructions": "Use back entrance",
        "offer_number": "OFF-2025-123",
        "work_order_number": "WO-2025-456",
        "notes": "Handle with care",
        "operator_name": "John Smith",
        "pumper_name": "ABC Pumping Ltd",
        "pump_type": "Stationary",
        "factory_id": 5,
        "client_address": "123 Construction Ave",
        "other_object_id": "PUMP-01",
        "products": []
    }
]
 

Example response (200, Padapigi Task):


[
    {
        "id": 12347,
        "oid": "metrotec",
        "object_id": "TRUCK-05",
        "lat": 59.437,
        "lon": 24.754,
        "start_lat": 59.395,
        "start_lon": 24.662,
        "start_address": "Warehouse A, Tallinn",
        "start_time": "2025-01-20 06:00:00",
        "stop_time": "2025-01-20 18:00:00",
        "order_ref": "PAD-2025-100",
        "order_details": "CMR delivery to Latvia",
        "task_address": "Warehouse District, Tallinn",
        "task_description": "International delivery to Latvia",
        "cancel_reason": null,
        "status": 2,
        "created_at": "2025-01-19 14:00:00",
        "updated_at": "2025-01-20 06:30:00",
        "work_started_at": "2025-01-20 06:15:00",
        "work_finished_at": null,
        "sender": "PadapigiAPI",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": "CMR documents prepared",
        "active": true,
        "group_id": 15,
        "is_not_own_vehicle": false,
        "contact_name": "John Doe",
        "contact_email": "john.doe@example.com",
        "contact_sender": "SENDER123",
        "contact_receiver": "ABC Logistics Ltd",
        "contact_trailer": "TRL456",
        "contact_order": "ORD-PAD-100",
        "contact_delivery_term": "DAP",
        "contact_language": "en",
        "delivery_name": "ABC Logistics Ltd",
        "delivery_address1": "Industrial Street 15",
        "delivery_address2": "Riga, LV-1234",
        "delivery_address3": "Latvia",
        "start_address1": "Warehouse A",
        "start_address2": "Tallinn Port",
        "start_address3": "Estonia",
        "weight": 15000,
        "amount": 24,
        "hash": "abc123def456",
        "products": []
    }
]
 

Example response (200, Directo Task):


[
    {
        "id": 12348,
        "oid": "metrotec",
        "object_id": "INT-TRUCK-02",
        "lat": 54.687,
        "lon": 25.279,
        "start_lat": 59.437,
        "start_lon": 24.754,
        "start_address": "Tallinn Logistics Center",
        "start_time": "2025-01-20 05:00:00",
        "stop_time": "2025-01-21 18:00:00",
        "order_ref": "DIR-2025-055",
        "order_details": "Electronics to Lithuania",
        "task_address": "Vilnius, Lithuania",
        "task_description": "Electronics transport to Lithuania",
        "cancel_reason": null,
        "status": 2,
        "created_at": "2025-01-19 12:00:00",
        "updated_at": "2025-01-20 05:45:00",
        "work_started_at": "2025-01-20 05:30:00",
        "work_finished_at": null,
        "sender": "DirectoAPI",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": "Border documents ready",
        "active": true,
        "group_id": 20,
        "is_not_own_vehicle": false,
        "amount": 150,
        "contact_name": "Maria Vasileva",
        "contact_country_code": "+370",
        "contact_phone_nr": "61234567",
        "product_name": "Electronic Components",
        "project_nr": "PROJ-2025-10",
        "weight": 12000,
        "carrier": "Baltic Express",
        "receiver_email": "receiver@example.lt",
        "receiver_name": "Tech Solutions UAB",
        "directo_invoice": "987654",
        "driver_notes": "Contact receiver 1 hour before arrival",
        "own_transport": true,
        "products": []
    }
]
 

Example response (200, Esvika Task):


[
    {
        "id": 12349,
        "oid": "metrotec",
        "object_id": "ESV-TRUCK-08",
        "lat": 60.169,
        "lon": 24.938,
        "start_lat": 59.437,
        "start_lon": 24.754,
        "start_address": "Tallinn Distribution Center",
        "start_time": "2025-01-20 07:00:00",
        "stop_time": "2025-01-20 16:00:00",
        "order_ref": "ESV-2025-220",
        "order_details": "Container to Helsinki Port",
        "task_address": "Helsinki Port, Finland",
        "task_description": "Container transport to Helsinki",
        "cancel_reason": null,
        "status": 2,
        "created_at": "2025-01-19 13:30:00",
        "updated_at": "2025-01-20 07:20:00",
        "work_started_at": "2025-01-20 07:10:00",
        "work_finished_at": null,
        "sender": "EsvikaAPI",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": "Ferry booking confirmed",
        "active": true,
        "group_id": 25,
        "is_not_own_vehicle": false,
        "contact_name": "Pekka Virtanen",
        "contact_country_code": "+358",
        "contact_phone_nr": "401234567",
        "amount": 1,
        "weight": 22000,
        "vehicle_type": "Curtainsider",
        "carrier": "Nordic Transport Oy",
        "order_number": "ORD-FI-2025-100",
        "unloading_time": 45,
        "products": []
    }
]
 

Example response (200, Olaret Task):


[
    {
        "id": 12350,
        "oid": "metrotec",
        "object_id": "CONTAINER-TRUCK-03",
        "lat": 59.437,
        "lon": 24.754,
        "start_lat": null,
        "start_lon": null,
        "start_address": null,
        "start_time": "2025-01-20 09:00:00",
        "stop_time": "2025-01-20 15:00:00",
        "order_ref": "OLA-2025-456",
        "order_details": "Container pickup",
        "task_address": "Container Terminal, Port of Tallinn",
        "task_description": "Container pickup and delivery",
        "cancel_reason": null,
        "status": 1,
        "created_at": "2025-01-19 17:00:00",
        "updated_at": "2025-01-19 17:00:00",
        "work_started_at": null,
        "work_finished_at": null,
        "sender": "OlaretAPI",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": "Terminal gate code: 1234",
        "active": true,
        "group_id": null,
        "is_not_own_vehicle": false,
        "worder": "WO_2025_456",
        "containerno": "MSCU1234567",
        "do_send": true,
        "products": []
    }
]
 

Example response (200, LotusTimber Task):


[
    {
        "id": 12351,
        "oid": "metrotec",
        "object_id": "TIMBER-TRUCK-01",
        "lat": 58.378,
        "lon": 26.729,
        "start_lat": 59.437,
        "start_lon": 24.754,
        "start_address": "Timber Yard, Tallinn",
        "start_time": "2025-01-20 06:00:00",
        "stop_time": "2025-01-20 14:00:00",
        "order_ref": "LOTUS-2025-001",
        "order_details": "Timber delivery to sawmill",
        "customer_id": 1,
        "carrier_id": 2,
        "trailer_nr": "TRL-789",
        "task_address": "Sawmill, Tartu",
        "task_description": "Timber transport",
        "cancel_reason": null,
        "status": 2,
        "created_at": "2025-01-19 15:00:00",
        "updated_at": "2025-01-20 06:30:00",
        "work_started_at": "2025-01-20 06:15:00",
        "work_finished_at": null,
        "sender": "LotusTimberAPI",
        "tracking_nr": "abc123xyz789def456",
        "task_notes": "Handle with care",
        "active": true,
        "group_id": null,
        "is_not_own_vehicle": false,
        "products": []
    }
]
 

Request      

GET api/tasks

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

all   boolean  optional    

Show all tasks including completed ones. Example: false

offset   integer  optional    

Pagination offset. Example: 0

limit   integer  optional    

Number of records to return. Example: 30

files   boolean  optional    

Include files with tasks. Example: false

Create a new task

Creates a new route task. The available fields depend on the user's profile type. All task types share common base fields, with additional fields available per type.

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/tasks" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"ABC123\",
    \"lat\": 59.437,
    \"lon\": 24.754,
    \"start_time\": \"2025-01-20 08:00:00\",
    \"stop_time\": \"2025-01-20 17:00:00\",
    \"start_lat\": 59.395,
    \"start_lon\": 24.662,
    \"start_address\": \"Tallinn, Estonia\",
    \"task_address\": \"Tartu, Estonia\",
    \"order_ref\": \"ORD-2025-001\",
    \"order_details\": \"Delivery of goods\",
    \"task_description\": \"Deliver package\",
    \"task_notes\": \"Call before arrival\",
    \"cancel_reason\": \"architecto\",
    \"status\": 1,
    \"planned_km\": 150.5,
    \"is_not_own_vehicle\": false,
    \"active\": true,
    \"group_id\": 1,
    \"products\": [
        {
            \"product_id\": 1,
            \"quantity\": 10.5,
            \"weight\": 150
        }
    ],
    \"preparation_time\": \"2025-01-20 07:30:00\",
    \"volume\": 8.5,
    \"client_id\": \"CLIENT123\",
    \"ordered_volume\": 10,
    \"delivered_volume\": 8.2,
    \"pumped_volume\": 8,
    \"dn_trash\": \"0.5\",
    \"dn_plastic\": \"1.2\",
    \"dn_water\": \"10.5\",
    \"categoryID\": 15,
    \"client_emails\": [
        \"client@example.com\"
    ],
    \"last_cargo\": 0,
    \"geozone_entered_at\": \"2025-01-20 11:20:00\",
    \"arrived_at\": \"2025-01-20 11:15:00\",
    \"geozone_left_at\": \"2025-01-20 11:50:00\",
    \"work_finished_at\": \"2025-01-20 11:45:00\",
    \"concrete_type\": \"C30\\/37\",
    \"concrete_strength_class\": \"C30\",
    \"environmental_class\": \"XC3\",
    \"dmax\": \"16\",
    \"consistency_class\": \"S3\",
    \"cement_type\": \"CEM II\\/A-LL 42,5N\",
    \"additives\": \"Superplasticizer\",
    \"concrete_extra_info\": \"High durability\",
    \"concrete_extra_info2\": \"Special finish\",
    \"unload_method\": \"Pump\",
    \"driving_instructions\": \"Use back entrance\",
    \"offer_number\": \"OFF-2025-123\",
    \"work_order_number\": \"WO-2025-456\",
    \"notes\": \"Handle with care\",
    \"operator_name\": \"John Smith\",
    \"pumper_name\": \"ABC Pumping Ltd\",
    \"pump_type\": \"Stationary\",
    \"factory_id\": 5,
    \"client_address\": \"123 Construction Ave\",
    \"other_object_id\": \"PUMP-01\",
    \"contact_name\": \"John Doe\",
    \"contact_email\": \"john@example.com\",
    \"contact_sender\": \"SENDER123\",
    \"contact_receiver\": \"ABC Logistics Ltd\",
    \"contact_trailer\": \"TRL456\",
    \"contact_order\": \"ORD-PAD-100\",
    \"contact_delivery_term\": \"DAP\",
    \"contact_language\": \"en\",
    \"delivery_name\": \"ABC Logistics Ltd\",
    \"delivery_address1\": \"Industrial Street 15\",
    \"delivery_address2\": \"Riga, LV-1234\",
    \"delivery_address3\": \"Latvia\",
    \"start_address1\": \"Warehouse A\",
    \"start_address2\": \"Tallinn Port\",
    \"start_address3\": \"Estonia\",
    \"hash\": \"abc123def456\",
    \"contact_country_code\": \"+372\",
    \"contact_phone_nr\": \"5551234\",
    \"product_name\": \"Electronic Components\",
    \"project_nr\": \"PROJ-2025-10\",
    \"receiver_email\": \"receiver@example.lt\",
    \"receiver_name\": \"Tech Solutions UAB\",
    \"directo_invoice\": \"987654\",
    \"driver_notes\": \"Call 1h before\",
    \"own_transport\": true,
    \"weight\": 15000,
    \"amount\": 24,
    \"carrier\": \"Baltic Express\",
    \"vehicle_type\": \"Curtainsider\",
    \"order_number\": \"ORD-FI-2025-100\",
    \"unloading_time\": 45,
    \"worder\": \"WO_2025_456\",
    \"containerno\": \"MSCU1234567\",
    \"do_send\": true,
    \"customer_id\": 1,
    \"carrier_id\": 2,
    \"trailer_nr\": \"TRL-789\"
}"
const url = new URL(
    "https://api2.metrotec.ee/api/tasks"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "ABC123",
    "lat": 59.437,
    "lon": 24.754,
    "start_time": "2025-01-20 08:00:00",
    "stop_time": "2025-01-20 17:00:00",
    "start_lat": 59.395,
    "start_lon": 24.662,
    "start_address": "Tallinn, Estonia",
    "task_address": "Tartu, Estonia",
    "order_ref": "ORD-2025-001",
    "order_details": "Delivery of goods",
    "task_description": "Deliver package",
    "task_notes": "Call before arrival",
    "cancel_reason": "architecto",
    "status": 1,
    "planned_km": 150.5,
    "is_not_own_vehicle": false,
    "active": true,
    "group_id": 1,
    "products": [
        {
            "product_id": 1,
            "quantity": 10.5,
            "weight": 150
        }
    ],
    "preparation_time": "2025-01-20 07:30:00",
    "volume": 8.5,
    "client_id": "CLIENT123",
    "ordered_volume": 10,
    "delivered_volume": 8.2,
    "pumped_volume": 8,
    "dn_trash": "0.5",
    "dn_plastic": "1.2",
    "dn_water": "10.5",
    "categoryID": 15,
    "client_emails": [
        "client@example.com"
    ],
    "last_cargo": 0,
    "geozone_entered_at": "2025-01-20 11:20:00",
    "arrived_at": "2025-01-20 11:15:00",
    "geozone_left_at": "2025-01-20 11:50:00",
    "work_finished_at": "2025-01-20 11:45:00",
    "concrete_type": "C30\/37",
    "concrete_strength_class": "C30",
    "environmental_class": "XC3",
    "dmax": "16",
    "consistency_class": "S3",
    "cement_type": "CEM II\/A-LL 42,5N",
    "additives": "Superplasticizer",
    "concrete_extra_info": "High durability",
    "concrete_extra_info2": "Special finish",
    "unload_method": "Pump",
    "driving_instructions": "Use back entrance",
    "offer_number": "OFF-2025-123",
    "work_order_number": "WO-2025-456",
    "notes": "Handle with care",
    "operator_name": "John Smith",
    "pumper_name": "ABC Pumping Ltd",
    "pump_type": "Stationary",
    "factory_id": 5,
    "client_address": "123 Construction Ave",
    "other_object_id": "PUMP-01",
    "contact_name": "John Doe",
    "contact_email": "john@example.com",
    "contact_sender": "SENDER123",
    "contact_receiver": "ABC Logistics Ltd",
    "contact_trailer": "TRL456",
    "contact_order": "ORD-PAD-100",
    "contact_delivery_term": "DAP",
    "contact_language": "en",
    "delivery_name": "ABC Logistics Ltd",
    "delivery_address1": "Industrial Street 15",
    "delivery_address2": "Riga, LV-1234",
    "delivery_address3": "Latvia",
    "start_address1": "Warehouse A",
    "start_address2": "Tallinn Port",
    "start_address3": "Estonia",
    "hash": "abc123def456",
    "contact_country_code": "+372",
    "contact_phone_nr": "5551234",
    "product_name": "Electronic Components",
    "project_nr": "PROJ-2025-10",
    "receiver_email": "receiver@example.lt",
    "receiver_name": "Tech Solutions UAB",
    "directo_invoice": "987654",
    "driver_notes": "Call 1h before",
    "own_transport": true,
    "weight": 15000,
    "amount": 24,
    "carrier": "Baltic Express",
    "vehicle_type": "Curtainsider",
    "order_number": "ORD-FI-2025-100",
    "unloading_time": 45,
    "worder": "WO_2025_456",
    "containerno": "MSCU1234567",
    "do_send": true,
    "customer_id": 1,
    "carrier_id": 2,
    "trailer_nr": "TRL-789"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/tasks';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'ABC123',
            'lat' => 59.437,
            'lon' => 24.754,
            'start_time' => '2025-01-20 08:00:00',
            'stop_time' => '2025-01-20 17:00:00',
            'start_lat' => 59.395,
            'start_lon' => 24.662,
            'start_address' => 'Tallinn, Estonia',
            'task_address' => 'Tartu, Estonia',
            'order_ref' => 'ORD-2025-001',
            'order_details' => 'Delivery of goods',
            'task_description' => 'Deliver package',
            'task_notes' => 'Call before arrival',
            'cancel_reason' => 'architecto',
            'status' => 1,
            'planned_km' => 150.5,
            'is_not_own_vehicle' => false,
            'active' => true,
            'group_id' => 1,
            'products' => [
                [
                    'product_id' => 1,
                    'quantity' => 10.5,
                    'weight' => 150.0,
                ],
            ],
            'preparation_time' => '2025-01-20 07:30:00',
            'volume' => 8.5,
            'client_id' => 'CLIENT123',
            'ordered_volume' => 10.0,
            'delivered_volume' => 8.2,
            'pumped_volume' => 8.0,
            'dn_trash' => '0.5',
            'dn_plastic' => '1.2',
            'dn_water' => '10.5',
            'categoryID' => 15,
            'client_emails' => [
                'client@example.com',
            ],
            'last_cargo' => 0,
            'geozone_entered_at' => '2025-01-20 11:20:00',
            'arrived_at' => '2025-01-20 11:15:00',
            'geozone_left_at' => '2025-01-20 11:50:00',
            'work_finished_at' => '2025-01-20 11:45:00',
            'concrete_type' => 'C30/37',
            'concrete_strength_class' => 'C30',
            'environmental_class' => 'XC3',
            'dmax' => '16',
            'consistency_class' => 'S3',
            'cement_type' => 'CEM II/A-LL 42,5N',
            'additives' => 'Superplasticizer',
            'concrete_extra_info' => 'High durability',
            'concrete_extra_info2' => 'Special finish',
            'unload_method' => 'Pump',
            'driving_instructions' => 'Use back entrance',
            'offer_number' => 'OFF-2025-123',
            'work_order_number' => 'WO-2025-456',
            'notes' => 'Handle with care',
            'operator_name' => 'John Smith',
            'pumper_name' => 'ABC Pumping Ltd',
            'pump_type' => 'Stationary',
            'factory_id' => 5,
            'client_address' => '123 Construction Ave',
            'other_object_id' => 'PUMP-01',
            'contact_name' => 'John Doe',
            'contact_email' => 'john@example.com',
            'contact_sender' => 'SENDER123',
            'contact_receiver' => 'ABC Logistics Ltd',
            'contact_trailer' => 'TRL456',
            'contact_order' => 'ORD-PAD-100',
            'contact_delivery_term' => 'DAP',
            'contact_language' => 'en',
            'delivery_name' => 'ABC Logistics Ltd',
            'delivery_address1' => 'Industrial Street 15',
            'delivery_address2' => 'Riga, LV-1234',
            'delivery_address3' => 'Latvia',
            'start_address1' => 'Warehouse A',
            'start_address2' => 'Tallinn Port',
            'start_address3' => 'Estonia',
            'hash' => 'abc123def456',
            'contact_country_code' => '+372',
            'contact_phone_nr' => '5551234',
            'product_name' => 'Electronic Components',
            'project_nr' => 'PROJ-2025-10',
            'receiver_email' => 'receiver@example.lt',
            'receiver_name' => 'Tech Solutions UAB',
            'directo_invoice' => '987654',
            'driver_notes' => 'Call 1h before',
            'own_transport' => true,
            'weight' => 15000,
            'amount' => 24.0,
            'carrier' => 'Baltic Express',
            'vehicle_type' => 'Curtainsider',
            'order_number' => 'ORD-FI-2025-100',
            'unloading_time' => 45,
            'worder' => 'WO_2025_456',
            'containerno' => 'MSCU1234567',
            'do_send' => true,
            'customer_id' => 1,
            'carrier_id' => 2,
            'trailer_nr' => 'TRL-789',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/tasks'
payload = {
    "object_id": "ABC123",
    "lat": 59.437,
    "lon": 24.754,
    "start_time": "2025-01-20 08:00:00",
    "stop_time": "2025-01-20 17:00:00",
    "start_lat": 59.395,
    "start_lon": 24.662,
    "start_address": "Tallinn, Estonia",
    "task_address": "Tartu, Estonia",
    "order_ref": "ORD-2025-001",
    "order_details": "Delivery of goods",
    "task_description": "Deliver package",
    "task_notes": "Call before arrival",
    "cancel_reason": "architecto",
    "status": 1,
    "planned_km": 150.5,
    "is_not_own_vehicle": false,
    "active": true,
    "group_id": 1,
    "products": [
        {
            "product_id": 1,
            "quantity": 10.5,
            "weight": 150
        }
    ],
    "preparation_time": "2025-01-20 07:30:00",
    "volume": 8.5,
    "client_id": "CLIENT123",
    "ordered_volume": 10,
    "delivered_volume": 8.2,
    "pumped_volume": 8,
    "dn_trash": "0.5",
    "dn_plastic": "1.2",
    "dn_water": "10.5",
    "categoryID": 15,
    "client_emails": [
        "client@example.com"
    ],
    "last_cargo": 0,
    "geozone_entered_at": "2025-01-20 11:20:00",
    "arrived_at": "2025-01-20 11:15:00",
    "geozone_left_at": "2025-01-20 11:50:00",
    "work_finished_at": "2025-01-20 11:45:00",
    "concrete_type": "C30\/37",
    "concrete_strength_class": "C30",
    "environmental_class": "XC3",
    "dmax": "16",
    "consistency_class": "S3",
    "cement_type": "CEM II\/A-LL 42,5N",
    "additives": "Superplasticizer",
    "concrete_extra_info": "High durability",
    "concrete_extra_info2": "Special finish",
    "unload_method": "Pump",
    "driving_instructions": "Use back entrance",
    "offer_number": "OFF-2025-123",
    "work_order_number": "WO-2025-456",
    "notes": "Handle with care",
    "operator_name": "John Smith",
    "pumper_name": "ABC Pumping Ltd",
    "pump_type": "Stationary",
    "factory_id": 5,
    "client_address": "123 Construction Ave",
    "other_object_id": "PUMP-01",
    "contact_name": "John Doe",
    "contact_email": "john@example.com",
    "contact_sender": "SENDER123",
    "contact_receiver": "ABC Logistics Ltd",
    "contact_trailer": "TRL456",
    "contact_order": "ORD-PAD-100",
    "contact_delivery_term": "DAP",
    "contact_language": "en",
    "delivery_name": "ABC Logistics Ltd",
    "delivery_address1": "Industrial Street 15",
    "delivery_address2": "Riga, LV-1234",
    "delivery_address3": "Latvia",
    "start_address1": "Warehouse A",
    "start_address2": "Tallinn Port",
    "start_address3": "Estonia",
    "hash": "abc123def456",
    "contact_country_code": "+372",
    "contact_phone_nr": "5551234",
    "product_name": "Electronic Components",
    "project_nr": "PROJ-2025-10",
    "receiver_email": "receiver@example.lt",
    "receiver_name": "Tech Solutions UAB",
    "directo_invoice": "987654",
    "driver_notes": "Call 1h before",
    "own_transport": true,
    "weight": 15000,
    "amount": 24,
    "carrier": "Baltic Express",
    "vehicle_type": "Curtainsider",
    "order_number": "ORD-FI-2025-100",
    "unloading_time": 45,
    "worder": "WO_2025_456",
    "containerno": "MSCU1234567",
    "do_send": true,
    "customer_id": 1,
    "carrier_id": 2,
    "trailer_nr": "TRL-789"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201, Standard Task):


{
    "id": 12346,
    "oid": "metrotec",
    "object_id": "ABC123",
    "lat": 59.437,
    "lon": 24.754,
    "start_lat": null,
    "start_lon": null,
    "start_address": null,
    "start_time": "2025-01-20 08:00:00",
    "stop_time": "2025-01-20 17:00:00",
    "order_ref": "ORDER-2025-001",
    "order_details": null,
    "task_address": "Tallinn, Estonia",
    "task_description": "Standard delivery task",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 16:00:00",
    "updated_at": "2025-01-19 16:00:00",
    "sender": "DispatchSystem",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": null,
    "active": true,
    "group_id": null,
    "is_not_own_vehicle": false,
    "products": [],
    "files": [],
    "signatures": []
}
 

Example response (201, Rudus Task):


{
    "id": 12345,
    "oid": "metrotec",
    "object_id": "RUDUS-01",
    "lat": 59.437,
    "lon": 24.754,
    "start_lat": 59.395,
    "start_lon": 24.662,
    "start_address": "Factory, Tallinn",
    "start_time": "2025-01-20 08:00:00",
    "stop_time": "2025-01-20 12:00:00",
    "order_ref": "RUDUS-2025-001",
    "order_details": "Client: Construction Site A",
    "task_address": "Construction Site A, Tallinn",
    "task_description": "Concrete delivery C30/37",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 15:30:00",
    "updated_at": "2025-01-19 15:30:00",
    "sender": "RudusAPI",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": "Special delivery",
    "active": true,
    "group_id": 10,
    "is_not_own_vehicle": false,
    "preparation_time": "2025-01-20 07:30:00",
    "volume": 8.5,
    "client_id": "CLIENT123",
    "ordered_volume": 10,
    "delivered_volume": 8.2,
    "pumped_volume": 8,
    "dn_trash": "0.5",
    "dn_plastic": "1.2",
    "dn_water": "10.5",
    "categoryID": 15,
    "client_emails": [
        "client@example.com",
        "manager@example.com"
    ],
    "last_cargo": 0,
    "concrete_type": "C30/37",
    "concrete_strength_class": "C30",
    "environmental_class": "XC3",
    "dmax": "16",
    "consistency_class": "S3",
    "cement_type": "CEM II/A-LL 42,5N",
    "additives": "Superplasticizer",
    "concrete_extra_info": "High durability",
    "concrete_extra_info2": "Special finish required",
    "unload_method": "Pump",
    "driving_instructions": "Use back entrance",
    "offer_number": "OFF-2025-123",
    "work_order_number": "WO-2025-456",
    "notes": "Handle with care",
    "operator_name": "John Smith",
    "pumper_name": "ABC Pumping Ltd",
    "pump_type": "Stationary",
    "factory_id": 5,
    "client_address": "123 Construction Ave",
    "other_object_id": "PUMP-01",
    "products": [],
    "files": [],
    "signatures": []
}
 

Example response (201, Padapigi Task):


{
    "id": 12347,
    "oid": "metrotec",
    "object_id": "TRUCK-05",
    "lat": 59.437,
    "lon": 24.754,
    "start_lat": 59.395,
    "start_lon": 24.662,
    "start_address": "Warehouse A, Tallinn",
    "start_time": "2025-01-20 06:00:00",
    "stop_time": "2025-01-20 18:00:00",
    "order_ref": "PAD-2025-100",
    "order_details": "CMR delivery to Latvia",
    "task_address": "Warehouse District, Tallinn",
    "task_description": "International delivery to Latvia",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 14:00:00",
    "updated_at": "2025-01-19 14:00:00",
    "sender": "PadapigiAPI",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": "CMR documents prepared",
    "active": false,
    "group_id": 15,
    "is_not_own_vehicle": false,
    "contact_name": "John Doe",
    "contact_email": "john.doe@example.com",
    "contact_sender": "SENDER123",
    "contact_receiver": "ABC Logistics Ltd",
    "contact_trailer": "TRL456",
    "contact_order": "ORD-PAD-100",
    "contact_delivery_term": "DAP",
    "contact_language": "en",
    "delivery_name": "ABC Logistics Ltd",
    "delivery_address1": "Industrial Street 15",
    "delivery_address2": "Riga, LV-1234",
    "delivery_address3": "Latvia",
    "start_address1": "Warehouse A",
    "start_address2": "Tallinn Port",
    "start_address3": "Estonia",
    "weight": 15000,
    "amount": 24,
    "hash": "abc123def456",
    "products": [],
    "files": [],
    "signatures": []
}
 

Example response (201, Directo Task):


{
    "id": 12348,
    "oid": "metrotec",
    "object_id": "INT-TRUCK-02",
    "lat": 54.687,
    "lon": 25.279,
    "start_lat": 59.437,
    "start_lon": 24.754,
    "start_address": "Tallinn Logistics Center",
    "start_time": "2025-01-20 05:00:00",
    "stop_time": "2025-01-21 18:00:00",
    "order_ref": "DIR-2025-055",
    "order_details": "Electronics to Lithuania",
    "task_address": "Vilnius, Lithuania",
    "task_description": "Electronics transport to Lithuania",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 12:00:00",
    "updated_at": "2025-01-19 12:00:00",
    "sender": "DirectoAPI",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": "Border documents ready",
    "active": false,
    "group_id": 20,
    "is_not_own_vehicle": false,
    "amount": 150,
    "contact_name": "Maria Vasileva",
    "contact_country_code": "+370",
    "contact_phone_nr": "61234567",
    "product_name": "Electronic Components",
    "project_nr": "PROJ-2025-10",
    "weight": 12000,
    "carrier": "Baltic Express",
    "receiver_email": "receiver@example.lt",
    "receiver_name": "Tech Solutions UAB",
    "directo_invoice": "987654",
    "driver_notes": "Contact receiver 1 hour before arrival",
    "own_transport": true,
    "products": [],
    "files": [],
    "signatures": []
}
 

Example response (201, Esvika Task):


{
    "id": 12349,
    "oid": "metrotec",
    "object_id": "ESV-TRUCK-08",
    "lat": 60.169,
    "lon": 24.938,
    "start_lat": 59.437,
    "start_lon": 24.754,
    "start_address": "Tallinn Distribution Center",
    "start_time": "2025-01-20 07:00:00",
    "stop_time": "2025-01-20 16:00:00",
    "order_ref": "ESV-2025-220",
    "order_details": "Container to Helsinki Port",
    "task_address": "Helsinki Port, Finland",
    "task_description": "Container transport to Helsinki",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 13:30:00",
    "updated_at": "2025-01-19 13:30:00",
    "sender": "EsvikaAPI",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": "Ferry booking confirmed",
    "active": false,
    "group_id": 25,
    "is_not_own_vehicle": false,
    "contact_name": "Pekka Virtanen",
    "contact_country_code": "+358",
    "contact_phone_nr": "401234567",
    "amount": 1,
    "weight": 22000,
    "vehicle_type": "Curtainsider",
    "carrier": "Nordic Transport Oy",
    "order_number": "ORD-FI-2025-100",
    "unloading_time": 45,
    "products": [],
    "files": [],
    "signatures": []
}
 

Example response (201, Olaret Task):


{
    "id": 12350,
    "oid": "metrotec",
    "object_id": "CONTAINER-TRUCK-03",
    "lat": 59.437,
    "lon": 24.754,
    "start_lat": null,
    "start_lon": null,
    "start_address": null,
    "start_time": "2025-01-20 09:00:00",
    "stop_time": "2025-01-20 15:00:00",
    "order_ref": "OLA-2025-456",
    "order_details": "Container pickup",
    "task_address": "Container Terminal, Port of Tallinn",
    "task_description": "Container pickup and delivery",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 17:00:00",
    "updated_at": "2025-01-19 17:00:00",
    "sender": "OlaretAPI",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": "Terminal gate code: 1234",
    "active": true,
    "group_id": null,
    "is_not_own_vehicle": false,
    "worder": "WO_2025_456",
    "containerno": "MSCU1234567",
    "do_send": true,
    "products": [],
    "files": [],
    "signatures": []
}
 

Example response (201, LotusTimber Task):


{
    "id": 12351,
    "oid": "metrotec",
    "object_id": "TIMBER-TRUCK-01",
    "lat": 58.378,
    "lon": 26.729,
    "start_lat": 59.437,
    "start_lon": 24.754,
    "start_address": "Timber Yard, Tallinn",
    "start_time": "2025-01-20 06:00:00",
    "stop_time": "2025-01-20 14:00:00",
    "order_ref": "LOTUS-2025-001",
    "order_details": "Timber delivery to sawmill",
    "customer_id": 1,
    "carrier_id": 2,
    "trailer_nr": "TRL-789",
    "task_address": "Sawmill, Tartu",
    "task_description": "Timber transport",
    "cancel_reason": null,
    "status": 1,
    "created_at": "2025-01-19 15:00:00",
    "updated_at": "2025-01-19 15:00:00",
    "sender": "LotusTimberAPI",
    "tracking_nr": "abc123xyz789def456",
    "task_notes": "Handle with care",
    "active": true,
    "group_id": null,
    "is_not_own_vehicle": false,
    "products": [
        {
            "id": 1,
            "name": "Pine Logs",
            "pivot": {
                "route_task_id": 12351,
                "product_id": 1,
                "quantity": "25.00",
                "weight": "1500.00",
                "created_at": "2025-01-19 15:00:00",
                "updated_at": "2025-01-19 15:00:00"
            }
        },
        {
            "id": 2,
            "name": "Spruce Logs",
            "pivot": {
                "route_task_id": 12351,
                "product_id": 2,
                "quantity": "15.00",
                "weight": "900.00",
                "created_at": "2025-01-19 15:00:00",
                "updated_at": "2025-01-19 15:00:00"
            }
        }
    ],
    "files": [],
    "signatures": []
}
 

Example response (400, Validation Error):


{
    "message": "Lat_Lon_Must_Be_Defined"
}
 

Example response (409, Duplicate Order Ref):


{
    "message": "Duplicate order reference"
}
 

Request      

POST api/tasks

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string  optional    

Vehicle object ID. Example: ABC123

lat   number     

Destination latitude. Example: 59.437

lon   number     

Destination longitude. Example: 24.754

start_time   string     

Task start time. Example: 2025-01-20 08:00:00

stop_time   string     

Task end time. Example: 2025-01-20 17:00:00

start_lat   number  optional    

Starting point latitude. Example: 59.395

start_lon   number  optional    

Starting point longitude. Example: 24.662

start_address   string  optional    

Starting address. Example: Tallinn, Estonia

task_address   string  optional    

Destination address. Example: Tartu, Estonia

order_ref   string  optional    

Order reference (must be unique per owner). Example: ORD-2025-001

order_details   string  optional    

Order details. Example: Delivery of goods

task_description   string  optional    

Task description. Example: Deliver package

task_notes   string  optional    

Additional notes. Example: Call before arrival

cancel_reason   string  optional    

Example: architecto

status   integer  optional    

Task status (1=new, 2=ok, 3=completed, 4=rejected, 5=cancel, 6=auto_close, 7=signed, 8=arrived, 9=confirmed). Example: 1

planned_km   number  optional    

Planned kilometers. Example: 150.5

is_not_own_vehicle   boolean  optional    

Using external vehicle. Example: false

active   boolean  optional    

Whether task is active. Example: true

group_id   integer  optional    

Task group ID. Example: 1

products   object[]  optional    

Array of products to attach to the task. Syncs products: present items are added/updated, missing items are removed.

product_id   integer     

Product ID. Example: 1

quantity   number  optional    

Product quantity. Example: 10.5

weight   number  optional    

Product weight in kg. Example: 150

preparation_time   string  optional    

[Rudus] Concrete preparation time at factory. Example: 2025-01-20 07:30:00

volume   number  optional    

[Rudus] Concrete volume in m³. Example: 8.5

client_id   string  optional    

[Rudus] Client identifier. Example: CLIENT123

ordered_volume   number  optional    

[Rudus] Total ordered volume in m³. Example: 10

delivered_volume   number  optional    

[Rudus] Delivered volume in m³. Example: 8.2

pumped_volume   number  optional    

[Rudus] Pumped volume in m³. Example: 8

dn_trash   string  optional    

[Rudus] Delivery note - trash amount. Example: 0.5

dn_plastic   string  optional    

[Rudus] Delivery note - plastic fiber. Example: 1.2

dn_water   string  optional    

[Rudus] Delivery note - added water. Example: 10.5

categoryID   integer  optional    

[Rudus] Concrete category ID. Example: 15

client_emails   string[]  optional    

[Rudus] Client emails for notifications.

last_cargo   integer  optional    

[Rudus] Last cargo flag (0/1). Example: 0

geozone_entered_at   string  optional    

[Rudus] Geozone entry time. Example: 2025-01-20 11:20:00

arrived_at   string  optional    

[Rudus] Arrival time at site. Example: 2025-01-20 11:15:00

geozone_left_at   string  optional    

[Rudus] Geozone exit time. Example: 2025-01-20 11:50:00

work_finished_at   string  optional    

[Rudus] Work completion time. Example: 2025-01-20 11:45:00

concrete_type   string  optional    

[Rudus] Type of concrete. Example: C30/37

concrete_strength_class   string  optional    

[Rudus] Strength class. Example: C30

environmental_class   string  optional    

[Rudus] Environmental class. Example: XC3

dmax   string  optional    

[Rudus] Maximum aggregate size. Example: 16

consistency_class   string  optional    

[Rudus] Consistency class. Example: S3

cement_type   string  optional    

[Rudus] Cement type. Example: CEM II/A-LL 42,5N

additives   string  optional    

[Rudus] Concrete additives. Example: Superplasticizer

concrete_extra_info   string  optional    

[Rudus] Extra info. Example: High durability

concrete_extra_info2   string  optional    

[Rudus] Extra info 2. Example: Special finish

unload_method   string  optional    

[Rudus] Unloading method. Example: Pump

driving_instructions   string  optional    

[Rudus] Driver instructions. Example: Use back entrance

offer_number   string  optional    

[Rudus] Offer number. Example: OFF-2025-123

work_order_number   string  optional    

[Rudus] Work order number. Example: WO-2025-456

notes   string  optional    

[Rudus] Additional notes. Example: Handle with care

operator_name   string  optional    

[Rudus] Operator name. Example: John Smith

pumper_name   string  optional    

[Rudus] Pumper company. Example: ABC Pumping Ltd

pump_type   string  optional    

[Rudus] Pump type. Example: Stationary

factory_id   integer  optional    

[Rudus] Factory ID. Example: 5

client_address   string  optional    

[Rudus] Client address. Example: 123 Construction Ave

other_object_id   string  optional    

[Rudus] Secondary vehicle ID. Example: PUMP-01

contact_name   string  optional    

[Padapigi, Directo, Esvika] Contact person name. Example: John Doe

contact_email   string  optional    

[Padapigi] Contact email. Example: john@example.com

contact_sender   string  optional    

[Padapigi] Sender code/name. Example: SENDER123

contact_receiver   string  optional    

[Padapigi] Receiver code/name. Example: ABC Logistics Ltd

contact_trailer   string  optional    

[Padapigi] Trailer number. Example: TRL456

contact_order   string  optional    

[Padapigi] Customer order reference. Example: ORD-PAD-100

contact_delivery_term   string  optional    

[Padapigi] Delivery terms (Incoterms). Example: DAP

contact_language   string  optional    

[Padapigi] Language code (est/eng/rus). Example: en

delivery_name   string  optional    

[Padapigi] Delivery recipient name. Example: ABC Logistics Ltd

delivery_address1   string  optional    

[Padapigi] Delivery address line 1. Example: Industrial Street 15

delivery_address2   string  optional    

[Padapigi] Delivery address line 2. Example: Riga, LV-1234

delivery_address3   string  optional    

[Padapigi] Delivery address line 3. Example: Latvia

start_address1   string  optional    

[Padapigi] Pickup address line 1. Example: Warehouse A

start_address2   string  optional    

[Padapigi] Pickup address line 2. Example: Tallinn Port

start_address3   string  optional    

[Padapigi] Pickup address line 3. Example: Estonia

hash   string  optional    

[Padapigi] Document hash. Example: abc123def456

contact_country_code   string  optional    

[Directo, Esvika] Phone country code. Example: +372

contact_phone_nr   string  optional    

[Directo, Esvika] Phone number. Example: 5551234

product_name   string  optional    

[Directo] Product name. Example: Electronic Components

project_nr   string  optional    

[Directo] Project number. Example: PROJ-2025-10

receiver_email   string  optional    

[Directo] Receiver email. Example: receiver@example.lt

receiver_name   string  optional    

[Directo] Receiver company name. Example: Tech Solutions UAB

directo_invoice   string  optional    

[Directo] Invoice number. Example: 987654

driver_notes   string  optional    

[Directo] Driver instructions. Example: Call 1h before

own_transport   boolean  optional    

[Directo] Using own transport. Example: true

weight   integer  optional    

[Padapigi, Directo, Esvika] Weight in kg. Example: 15000

amount   number  optional    

[Padapigi, Directo, Esvika] Amount/quantity. Example: 24

carrier   string  optional    

[Directo, Esvika] Carrier company. Example: Baltic Express

vehicle_type   string  optional    

[Esvika] Required vehicle type. Example: Curtainsider

order_number   string  optional    

[Esvika] Internal order number. Example: ORD-FI-2025-100

unloading_time   integer  optional    

[Esvika] Unloading time in minutes. Example: 45

worder   string  optional    

[Olaret] Work order reference. Example: WO_2025_456

containerno   string  optional    

[Olaret] Container number. Example: MSCU1234567

do_send   boolean  optional    

[Olaret] Send notification on completion. Example: true

customer_id   integer  optional    

[LotusTimber] Party ID (role=CUSTOMER). Example: 1

carrier_id   integer  optional    

[LotusTimber] Party ID (role=CARRIER). Example: 2

trailer_nr   string  optional    

[LotusTimber] Trailer number. Example: TRL-789

Get a specific task

Returns a single route task with files, signatures and products.

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/tasks/0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/tasks/0"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/tasks/0';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/tasks/0'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Example response (404, Task not found):


{
    "message": "Not Found"
}
 

Request      

GET api/tasks/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the task. Example: 0

task   integer     

Task ID. Example: 1

Update a task

Updates an existing route task. All fields are optional on update. Additional fields depend on the user's profile type.

Status Changes:

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/tasks/0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"ABC123\",
    \"lat\": 59.437,
    \"lon\": 24.754,
    \"start_time\": \"2025-01-20 08:00:00\",
    \"stop_time\": \"2025-01-20 17:00:00\",
    \"start_lat\": 4326.41688,
    \"start_lon\": 4326.41688,
    \"start_address\": \"m\",
    \"task_address\": \"i\",
    \"order_ref\": \"y\",
    \"order_details\": \"architecto\",
    \"task_description\": \"architecto\",
    \"task_notes\": \"architecto\",
    \"cancel_reason\": \"Customer not available\",
    \"status\": 2,
    \"is_not_own_vehicle\": true,
    \"active\": true,
    \"group_id\": 16,
    \"products\": [
        {
            \"product_id\": 1,
            \"quantity\": 10.5,
            \"weight\": 150
        }
    ]
}"
const url = new URL(
    "https://api2.metrotec.ee/api/tasks/0"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "ABC123",
    "lat": 59.437,
    "lon": 24.754,
    "start_time": "2025-01-20 08:00:00",
    "stop_time": "2025-01-20 17:00:00",
    "start_lat": 4326.41688,
    "start_lon": 4326.41688,
    "start_address": "m",
    "task_address": "i",
    "order_ref": "y",
    "order_details": "architecto",
    "task_description": "architecto",
    "task_notes": "architecto",
    "cancel_reason": "Customer not available",
    "status": 2,
    "is_not_own_vehicle": true,
    "active": true,
    "group_id": 16,
    "products": [
        {
            "product_id": 1,
            "quantity": 10.5,
            "weight": 150
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/tasks/0';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'ABC123',
            'lat' => 59.437,
            'lon' => 24.754,
            'start_time' => '2025-01-20 08:00:00',
            'stop_time' => '2025-01-20 17:00:00',
            'start_lat' => 4326.41688,
            'start_lon' => 4326.41688,
            'start_address' => 'm',
            'task_address' => 'i',
            'order_ref' => 'y',
            'order_details' => 'architecto',
            'task_description' => 'architecto',
            'task_notes' => 'architecto',
            'cancel_reason' => 'Customer not available',
            'status' => 2,
            'is_not_own_vehicle' => true,
            'active' => true,
            'group_id' => 16,
            'products' => [
                [
                    'product_id' => 1,
                    'quantity' => 10.5,
                    'weight' => 150.0,
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/tasks/0'
payload = {
    "object_id": "ABC123",
    "lat": 59.437,
    "lon": 24.754,
    "start_time": "2025-01-20 08:00:00",
    "stop_time": "2025-01-20 17:00:00",
    "start_lat": 4326.41688,
    "start_lon": 4326.41688,
    "start_address": "m",
    "task_address": "i",
    "order_ref": "y",
    "order_details": "architecto",
    "task_description": "architecto",
    "task_notes": "architecto",
    "cancel_reason": "Customer not available",
    "status": 2,
    "is_not_own_vehicle": true,
    "active": true,
    "group_id": 16,
    "products": [
        {
            "product_id": 1,
            "quantity": 10.5,
            "weight": 150
        }
    ]
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (403, Forbidden):


{
    "message": "Forbidden"
}
 

Example response (403, Invalid Period):


{
    "message": "Invalid period"
}
 

Example response (409, Duplicate Order Ref):


{
    "message": "Duplicate order reference"
}
 

Request      

PUT api/tasks/{id}

PATCH api/tasks/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the task. Example: 0

task   integer     

Task ID. Example: 1

Body Parameters

object_id   string  optional    

Vehicle object ID. Example: ABC123

lat   number  optional    

Destination latitude. Example: 59.437

lon   number  optional    

Destination longitude. Example: 24.754

start_time   string  optional    

Task start time. Example: 2025-01-20 08:00:00

stop_time   string  optional    

Task end time. Example: 2025-01-20 17:00:00

start_lat   number  optional    

Example: 4326.41688

start_lon   number  optional    

Example: 4326.41688

start_address   string  optional    

Väli value ei tohi olla pikem kui 255 tähemärki. Example: m

task_address   string  optional    

Väli value ei tohi olla pikem kui 255 tähemärki. Example: i

order_ref   string  optional    

Väli value ei tohi olla pikem kui 255 tähemärki. Example: y

order_details   string  optional    

Example: architecto

task_description   string  optional    

Example: architecto

task_notes   string  optional    

Example: architecto

cancel_reason   string  optional    

Reason for cancellation (when status=5). Example: Customer not available

status   integer  optional    

Task status. Example: 2

planned_km   string  optional    
is_not_own_vehicle   boolean  optional    

Example: true

active   boolean  optional    

Activate/deactivate task. Example: true

group_id   integer  optional    

Example: 16

products   object[]  optional    

Array of products to sync with the task. Present items are added/updated, missing items are removed.

product_id   integer     

Product ID. Example: 1

quantity   number  optional    

Product quantity. Example: 10.5

weight   number  optional    

Product weight in kg. Example: 150

Delete a task

Deletes a route task and its associated extra data from the task-type-specific table.

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/tasks/0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/tasks/0"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/tasks/0';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/tasks/0'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, Success):

Empty response
 

Example response (403, Forbidden):


{
    "message": "Forbidden"
}
 

Request      

DELETE api/tasks/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the task. Example: 0

task   integer     

Task ID. Example: 1

Ships

APIs for managing ships

Get all ships

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/ships?filter%5Barchived%5D=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/ships"
);

const params = {
    "filter[archived]": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/ships';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'filter[archived]' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/ships'
params = {
  'filter[archived]': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


[
    {
        "id": 1,
        "ship_name": "Aurora",
        "owner_name": "John Smith",
        "board_number": "EST-1234",
        "captain_name": "Captain Jack",
        "license_number": "LIC-2025-001",
        "receiver": "Fish Processing Ltd",
        "receiver_address": "Harbor Street 1, Tallinn",
        "fish_destination": "Processing Plant A",
        "active": true,
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-11-28T10:00:00.000000Z"
    }
]
 

Request      

GET api/ships

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

filter[archived]   boolean  optional    

Show all ships including inactive Example: true

Create a new ship

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/ships" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ship_name\": \"Aurora\",
    \"owner_name\": \"John Smith\",
    \"board_number\": \"EST-1234\",
    \"captain_name\": \"Captain Jack\",
    \"email\": \"captain@ship.com, owner@ship.com\",
    \"license_number\": \"LIC-2025-001\",
    \"receiver_id\": 1,
    \"fish_destination\": {
        \"address\": \"Processing Plant A, Harbor 5\",
        \"lat\": 59.437,
        \"lon\": 24.753
    },
    \"active\": false
}"
const url = new URL(
    "https://api2.metrotec.ee/api/ships"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "email": "captain@ship.com, owner@ship.com",
    "license_number": "LIC-2025-001",
    "receiver_id": 1,
    "fish_destination": {
        "address": "Processing Plant A, Harbor 5",
        "lat": 59.437,
        "lon": 24.753
    },
    "active": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/ships';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ship_name' => 'Aurora',
            'owner_name' => 'John Smith',
            'board_number' => 'EST-1234',
            'captain_name' => 'Captain Jack',
            'email' => 'captain@ship.com, owner@ship.com',
            'license_number' => 'LIC-2025-001',
            'receiver_id' => 1,
            'fish_destination' => [
                'address' => 'Processing Plant A, Harbor 5',
                'lat' => 59.437,
                'lon' => 24.753,
            ],
            'active' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/ships'
payload = {
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "email": "captain@ship.com, owner@ship.com",
    "license_number": "LIC-2025-001",
    "receiver_id": 1,
    "fish_destination": {
        "address": "Processing Plant A, Harbor 5",
        "lat": 59.437,
        "lon": 24.753
    },
    "active": false
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "license_number": "LIC-2025-001",
    "receiver": "Fish Processing Ltd",
    "receiver_address": "Harbor Street 1, Tallinn",
    "fish_destination": "Processing Plant A",
    "active": true,
    "created_at": "2025-11-28T10:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

POST api/ships

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

ship_name   string     

Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Aurora

owner_name   string  optional    

Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Smith

board_number   string  optional    

Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: EST-1234

captain_name   string  optional    

Name of the ship captain. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Captain Jack

email   string  optional    

Email address(es) for the ship, comma-separated for multiple. Väli value ei tohi olla pikem kui 255 tähemärki. Example: captain@ship.com, owner@ship.com

license_number   string  optional    

Ship license number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: LIC-2025-001

receiver_id   integer  optional    

ID of the receiver party. The id of an existing record in the parties table. Example: 1

fish_destination   object  optional    

Fish destination with coordinates.

address   string  optional    

Väli value ei tohi olla pikem kui 500 tähemärki. Example: Processing Plant A, Harbor 5

lat   number  optional    

Example: 59.437

lon   number  optional    

Example: 24.753

active   boolean  optional    

Whether the ship is active. Example: false

Get a specific ship

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/ships/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/ships/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/ships/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/ships/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "license_number": "LIC-2025-001",
    "receiver": "Fish Processing Ltd",
    "receiver_address": "Harbor Street 1, Tallinn",
    "fish_destination": "Processing Plant A",
    "active": true,
    "created_at": "2025-01-01T00:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

GET api/ships/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the ship. Example: 1

ship   integer     

Ship ID Example: 1

Update a ship

requires authentication

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/ships/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ship_name\": \"Aurora\",
    \"owner_name\": \"John Smith\",
    \"board_number\": \"EST-1234\",
    \"captain_name\": \"Captain Jack\",
    \"email\": \"captain@ship.com, owner@ship.com\",
    \"license_number\": \"LIC-2025-001\",
    \"receiver_id\": 1,
    \"fish_destination\": {
        \"address\": \"Processing Plant A, Harbor 5\",
        \"lat\": 59.437,
        \"lon\": 24.753
    },
    \"active\": false
}"
const url = new URL(
    "https://api2.metrotec.ee/api/ships/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "email": "captain@ship.com, owner@ship.com",
    "license_number": "LIC-2025-001",
    "receiver_id": 1,
    "fish_destination": {
        "address": "Processing Plant A, Harbor 5",
        "lat": 59.437,
        "lon": 24.753
    },
    "active": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/ships/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ship_name' => 'Aurora',
            'owner_name' => 'John Smith',
            'board_number' => 'EST-1234',
            'captain_name' => 'Captain Jack',
            'email' => 'captain@ship.com, owner@ship.com',
            'license_number' => 'LIC-2025-001',
            'receiver_id' => 1,
            'fish_destination' => [
                'address' => 'Processing Plant A, Harbor 5',
                'lat' => 59.437,
                'lon' => 24.753,
            ],
            'active' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/ships/1'
payload = {
    "ship_name": "Aurora",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "email": "captain@ship.com, owner@ship.com",
    "license_number": "LIC-2025-001",
    "receiver_id": 1,
    "fish_destination": {
        "address": "Processing Plant A, Harbor 5",
        "lat": 59.437,
        "lon": 24.753
    },
    "active": false
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "ship_name": "Aurora Updated",
    "owner_name": "John Smith",
    "board_number": "EST-1234",
    "captain_name": "Captain Jack",
    "license_number": "LIC-2025-001",
    "receiver": "Fish Processing Ltd",
    "receiver_address": "Harbor Street 1, Tallinn",
    "fish_destination": "Processing Plant A",
    "active": true,
    "created_at": "2025-01-01T00:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z"
}
 

Request      

PUT api/ships/{id}

PATCH api/ships/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the ship. Example: 1

ship   integer     

Ship ID Example: 1

Body Parameters

ship_name   string     

Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Aurora

owner_name   string  optional    

Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Smith

board_number   string  optional    

Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: EST-1234

captain_name   string  optional    

Name of the ship captain. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Captain Jack

email   string  optional    

Email address(es) for the ship, comma-separated for multiple. Väli value ei tohi olla pikem kui 255 tähemärki. Example: captain@ship.com, owner@ship.com

license_number   string  optional    

Ship license number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: LIC-2025-001

receiver_id   integer  optional    

ID of the receiver party. The id of an existing record in the parties table. Example: 1

fish_destination   object  optional    

Fish destination with coordinates.

address   string  optional    

Väli value ei tohi olla pikem kui 500 tähemärki. Example: Processing Plant A, Harbor 5

lat   number  optional    

Example: 59.437

lon   number  optional    

Example: 24.753

active   boolean  optional    

Whether the ship is active. Example: false

Delete a ship

requires authentication

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/ships/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/ships/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/ships/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/ships/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

Empty response
 

Request      

DELETE api/ships/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the ship. Example: 1

ship   integer     

Ship ID Example: 1

Task Groups

APIs for managing route task groups. Task groups organize multiple route tasks into a single delivery run or work session.

Get all task groups

requires authentication

Returns a list of active task groups for the authenticated user. Groups are filtered based on:

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/routetasksgroups" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/routetasksgroups"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/routetasksgroups';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/routetasksgroups'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 1,
        "oid": "metrotec",
        "name": "Morning Route",
        "group_date": "2025-01-20T08:00:00.000000Z",
        "object_id": "ABC123",
        "other_object_id": null,
        "work_started_at": null,
        "should_return": true,
        "active": true,
        "driver_name": "John Doe",
        "languages": "Estonian, English",
        "driver_phone": "+372 5555 5555",
        "trailer_number": "TRL-123",
        "carrier_id": 1,
        "status": null,
        "created_at": "2025-01-19T10:00:00.000000Z",
        "updated_at": "2025-01-19T10:00:00.000000Z",
        "carrier": {
            "id": 1,
            "company_name": "ABC Logistics",
            "company_no": "12345678",
            "company_vat_no": "EE123456789",
            "company_phone_nr": "+372 5555 5555",
            "company_country_code": "+372",
            "company_email": "info@abc.com",
            "company_address": "Warehouse St 1"
        }
    }
]
 

Request      

GET api/routetasksgroups

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Create a new task group

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/routetasksgroups" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Morning Delivery Route\",
    \"group_date\": \"2025-01-20 08:00:00\",
    \"object_id\": \"ABC123\",
    \"other_object_id\": \"XYZ789\",
    \"work_started_at\": \"2025-01-20 08:15:00\",
    \"should_return\": false,
    \"active\": false,
    \"driver_name\": \"John Doe\",
    \"languages\": \"Estonian, English, Russian\",
    \"driver_phone\": \"+372 5555 5555\",
    \"trailer_number\": \"TRL-123\",
    \"carrier_id\": 1
}"
const url = new URL(
    "https://api2.metrotec.ee/api/routetasksgroups"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Morning Delivery Route",
    "group_date": "2025-01-20 08:00:00",
    "object_id": "ABC123",
    "other_object_id": "XYZ789",
    "work_started_at": "2025-01-20 08:15:00",
    "should_return": false,
    "active": false,
    "driver_name": "John Doe",
    "languages": "Estonian, English, Russian",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/routetasksgroups';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Morning Delivery Route',
            'group_date' => '2025-01-20 08:00:00',
            'object_id' => 'ABC123',
            'other_object_id' => 'XYZ789',
            'work_started_at' => '2025-01-20 08:15:00',
            'should_return' => false,
            'active' => false,
            'driver_name' => 'John Doe',
            'languages' => 'Estonian, English, Russian',
            'driver_phone' => '+372 5555 5555',
            'trailer_number' => 'TRL-123',
            'carrier_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/routetasksgroups'
payload = {
    "name": "Morning Delivery Route",
    "group_date": "2025-01-20 08:00:00",
    "object_id": "ABC123",
    "other_object_id": "XYZ789",
    "work_started_at": "2025-01-20 08:15:00",
    "should_return": false,
    "active": false,
    "driver_name": "John Doe",
    "languages": "Estonian, English, Russian",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "id": 1,
    "oid": "metrotec",
    "name": "Morning Route",
    "group_date": "2025-01-20T08:00:00.000000Z",
    "object_id": "ABC123",
    "other_object_id": null,
    "work_started_at": null,
    "should_return": true,
    "active": true,
    "driver_name": "John Doe",
    "languages": "Estonian, English",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1,
    "status": null,
    "created_at": "2025-01-19T10:00:00.000000Z",
    "updated_at": "2025-01-19T10:00:00.000000Z"
}
 

Request      

POST api/routetasksgroups

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Group name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Morning Delivery Route

group_date   string     

Date and time of the group. Väli value peab olema kehtiv kuupäev. Example: 2025-01-20 08:00:00

object_id   string  optional    

Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki. Example: ABC123

other_object_id   string  optional    

Secondary vehicle object ID (e.g., for Padapigi when no primary vehicle). Väli value ei tohi olla pikem kui 10 tähemärki. Example: XYZ789

work_started_at   string  optional    

Timestamp when work started. Väli value peab olema kehtiv kuupäev. Example: 2025-01-20 08:15:00

should_return   boolean  optional    

Whether vehicle should return to origin. Example: false

active   boolean  optional    

Whether the group is active. Example: false

driver_name   string  optional    

Driver name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Doe

languages   string  optional    

Languages spoken by driver. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Estonian, English, Russian

driver_phone   string  optional    

Driver phone number. Väli value ei tohi olla pikem kui 50 tähemärki. Example: +372 5555 5555

trailer_number   string  optional    

Trailer registration number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: TRL-123

carrier_id   integer  optional    

Party ID of the carrier. The id of an existing record in the parties table. Example: 1

Get a specific task group

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/routetasksgroups/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/routetasksgroups/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/routetasksgroups/16';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/routetasksgroups/16'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "id": 1,
    "oid": "metrotec",
    "name": "Morning Route",
    "group_date": "2025-01-20T08:00:00.000000Z",
    "object_id": "ABC123",
    "other_object_id": null,
    "work_started_at": null,
    "should_return": true,
    "active": true,
    "driver_name": "John Doe",
    "languages": "Estonian, English",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1,
    "status": null,
    "created_at": "2025-01-19T10:00:00.000000Z",
    "updated_at": "2025-01-19T10:00:00.000000Z",
    "carrier": {
        "id": 1,
        "company_name": "ABC Logistics",
        "company_no": "12345678",
        "company_vat_no": "EE123456789",
        "company_phone_nr": "+372 5555 5555",
        "company_country_code": "+372",
        "company_email": "info@abc.com",
        "company_address": "Warehouse St 1"
    }
}
 

Example response (404, Not Found):


{
    "message": "Not Found"
}
 

Request      

GET api/routetasksgroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the routetasksgroup. Example: 16

taskGroup   integer     

Task Group ID Example: 1

Update a task group

requires authentication

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/routetasksgroups/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Morning Delivery Route\",
    \"group_date\": \"2025-01-20 08:00:00\",
    \"object_id\": \"ABC123\",
    \"other_object_id\": \"XYZ789\",
    \"work_started_at\": \"2025-01-20 08:15:00\",
    \"should_return\": false,
    \"active\": false,
    \"driver_name\": \"John Doe\",
    \"languages\": \"Estonian, English, Russian\",
    \"driver_phone\": \"+372 5555 5555\",
    \"trailer_number\": \"TRL-123\",
    \"carrier_id\": 1
}"
const url = new URL(
    "https://api2.metrotec.ee/api/routetasksgroups/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Morning Delivery Route",
    "group_date": "2025-01-20 08:00:00",
    "object_id": "ABC123",
    "other_object_id": "XYZ789",
    "work_started_at": "2025-01-20 08:15:00",
    "should_return": false,
    "active": false,
    "driver_name": "John Doe",
    "languages": "Estonian, English, Russian",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/routetasksgroups/16';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Morning Delivery Route',
            'group_date' => '2025-01-20 08:00:00',
            'object_id' => 'ABC123',
            'other_object_id' => 'XYZ789',
            'work_started_at' => '2025-01-20 08:15:00',
            'should_return' => false,
            'active' => false,
            'driver_name' => 'John Doe',
            'languages' => 'Estonian, English, Russian',
            'driver_phone' => '+372 5555 5555',
            'trailer_number' => 'TRL-123',
            'carrier_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/routetasksgroups/16'
payload = {
    "name": "Morning Delivery Route",
    "group_date": "2025-01-20 08:00:00",
    "object_id": "ABC123",
    "other_object_id": "XYZ789",
    "work_started_at": "2025-01-20 08:15:00",
    "should_return": false,
    "active": false,
    "driver_name": "John Doe",
    "languages": "Estonian, English, Russian",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "id": 1,
    "oid": "metrotec",
    "name": "Updated Morning Route",
    "group_date": "2025-01-20T08:00:00.000000Z",
    "object_id": "ABC123",
    "other_object_id": null,
    "work_started_at": "2025-01-20T08:15:00.000000Z",
    "should_return": true,
    "active": true,
    "driver_name": "John Doe",
    "languages": "Estonian, English",
    "driver_phone": "+372 5555 5555",
    "trailer_number": "TRL-123",
    "carrier_id": 1,
    "status": null,
    "created_at": "2025-01-19T10:00:00.000000Z",
    "updated_at": "2025-01-20T08:15:00.000000Z"
}
 

Example response (403, Forbidden):


{
    "message": "Forbidden"
}
 

Request      

PUT api/routetasksgroups/{id}

PATCH api/routetasksgroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the routetasksgroup. Example: 16

taskGroup   integer     

Task Group ID Example: 1

Body Parameters

name   string  optional    

Group name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Morning Delivery Route

group_date   string  optional    

Date and time of the group. Väli value peab olema kehtiv kuupäev. Example: 2025-01-20 08:00:00

object_id   string  optional    

Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki. Example: ABC123

other_object_id   string  optional    

Secondary vehicle object ID (e.g., for Padapigi when no primary vehicle). Väli value ei tohi olla pikem kui 10 tähemärki. Example: XYZ789

work_started_at   string  optional    

Timestamp when work started. Väli value peab olema kehtiv kuupäev. Example: 2025-01-20 08:15:00

should_return   boolean  optional    

Whether vehicle should return to origin. Example: false

active   boolean  optional    

Whether the group is active. Example: false

driver_name   string  optional    

Driver name. Väli value ei tohi olla pikem kui 255 tähemärki. Example: John Doe

languages   string  optional    

Languages spoken by driver. Väli value ei tohi olla pikem kui 500 tähemärki. Example: Estonian, English, Russian

driver_phone   string  optional    

Driver phone number. Väli value ei tohi olla pikem kui 50 tähemärki. Example: +372 5555 5555

trailer_number   string  optional    

Trailer registration number. Väli value ei tohi olla pikem kui 255 tähemärki. Example: TRL-123

carrier_id   integer  optional    

Party ID of the carrier. The id of an existing record in the parties table. Example: 1

Delete a task group

requires authentication

Soft deletes a task group. The group will be marked as deleted but not permanently removed from the database.

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/routetasksgroups/16" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/routetasksgroups/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/routetasksgroups/16';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/routetasksgroups/16'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, Success):

Empty response
 

Example response (403, Forbidden):


{
    "message": "Forbidden"
}
 

Request      

DELETE api/routetasksgroups/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the routetasksgroup. Example: 16

taskGroup   integer     

Task Group ID Example: 1

Users

*

Get an authenticated user

Returns the authenticated user's identifier and access level.

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/username" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/username"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/username';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/username'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "oid": "john_doe",
    "access": 2
}
 

Request      

GET api/username

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Auth logs

User authentication logs

Get authentication logs report

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/auth-logs?datetime[]=2025-01-01&datetime[]=2025-12-31&filter[oid]=metrotec&filter[user_agent]=Mozilla%2F5.0&filter[ip_address]=192.168.1.1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/auth-logs"
);

const params = {
    "datetime[0]": "2025-01-01",
    "datetime[1]": "2025-12-31",
    "filter[oid]": "metrotec",
    "filter[user_agent]": "Mozilla/5.0",
    "filter[ip_address]": "192.168.1.1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/auth-logs';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'datetime[0]' => '2025-01-01',
            'datetime[1]' => '2025-12-31',
            'filter[oid]' => 'metrotec',
            'filter[user_agent]' => 'Mozilla/5.0',
            'filter[ip_address]' => '192.168.1.1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/auth-logs'
params = {
  'datetime[0]': '2025-01-01',
  'datetime[1]': '2025-12-31',
  'filter[oid]': 'metrotec',
  'filter[user_agent]': 'Mozilla/5.0',
  'filter[ip_address]': '192.168.1.1',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "id": 1,
            "authenticatable_type": "App\\Models\\User",
            "authenticatable_id": 123,
            "ip_address": "192.168.1.1",
            "user_agent": "Mozilla/5.0",
            "login_at": "2025-11-28T10:00:00.000000Z",
            "login_successful": true,
            "logout_at": null,
            "cleared_by_user": false,
            "location": {
                "city": "Tallinn",
                "country": "Estonia"
            }
        }
    ],
    "per_page": 15,
    "current_page": 1,
    "next_page_url": null,
    "prev_page_url": null
}
 

Request      

GET api/auth-logs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   object  optional    
datetime.0   string     

Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1. Example: 2025-01-01

datetime.1   string     

End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0. Example: 2025-12-31

filter   object  optional    
filter.oid   string  optional    

Filter by username. Väli value ei tohi olla pikem kui 255 tähemärki. Example: metrotec

filter.user_agent   string  optional    

Filter by user agent. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Mozilla/5.0

filter.ip_address   string  optional    

Filter by IP address. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 192.168.1.1

Get User authentication logs

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/metrotec/auth-logs" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/metrotec/auth-logs"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/metrotec/auth-logs';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/metrotec/auth-logs'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": [
        {
            "id": 1,
            "authenticatable_type": "App\\Models\\User",
            "authenticatable_id": 123,
            "ip_address": "192.168.1.1",
            "user_agent": "Mozilla/5.0",
            "login_at": "2025-11-28T10:00:00.000000Z",
            "login_successful": true,
            "logout_at": null,
            "cleared_by_user": false,
            "location": {
                "city": "Tallinn",
                "country": "Estonia"
            }
        }
    ],
    "per_page": 30,
    "current_page": 1,
    "next_page_url": null,
    "prev_page_url": null
}
 

Request      

GET api/{user_oid}/auth-logs

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Username Example: metrotec

GET xls/auth-logs

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/xls/auth-logs?datetime[]=2025-01-01&datetime[]=2025-12-31&filter[oid]=metrotec&filter[user_agent]=Mozilla%2F5.0&filter[ip_address]=192.168.1.1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/xls/auth-logs"
);

const params = {
    "datetime[0]": "2025-01-01",
    "datetime[1]": "2025-12-31",
    "filter[oid]": "metrotec",
    "filter[user_agent]": "Mozilla/5.0",
    "filter[ip_address]": "192.168.1.1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/xls/auth-logs';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'datetime[0]' => '2025-01-01',
            'datetime[1]' => '2025-12-31',
            'filter[oid]' => 'metrotec',
            'filter[user_agent]' => 'Mozilla/5.0',
            'filter[ip_address]' => '192.168.1.1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/xls/auth-logs'
params = {
  'datetime[0]': '2025-01-01',
  'datetime[1]': '2025-12-31',
  'filter[oid]': 'metrotec',
  'filter[user_agent]': 'Mozilla/5.0',
  'filter[ip_address]': '192.168.1.1',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
set-cookie: XSRF-TOKEN=eyJpdiI6IklBNStXT2Z5N0ZtWE9zR08yWnpiN0E9PSIsInZhbHVlIjoiOXNJUm1PRWl3WnRibnRHUzBDM1VJSVQwMGEwMS9lRkp6c25LSmZiQkVZb1pxZFZwb2Vxb2Qzdk52T3BEd24vaGFtZGtKa1lGQk00L3ExRk1sY0lFZ1N3MW83TVJOMDI4WFZpZkFydDlyUENnY0dMa0ZWcUI1OGNmZlJ1L0RlMmgiLCJtYWMiOiJlMGQ2NjEyMWU4NDU3N2NiYTFlMTA0NDgyMTBkYjlhYjI4NDU2MTlmZDg1MzAxOGNjMzIwMmNkNWIwNzBlNzVjIiwidGFnIjoiIn0%3D; expires=Mon, 13 Apr 2026 09:54:27 GMT; Max-Age=7200; path=/; secure; samesite=lax; metrotec_session=eyJpdiI6Im5Pd1lMbmMwQ21RRVpzTUUrdFpXMmc9PSIsInZhbHVlIjoiNm9oWEF2S0Ntc0t5aVhUTjdJRGtJTlVMRVpmQ1piZ0kxUnFRQ1JCWUhCUitVK20zanY3S3h6dElFWThLUVZRRFhFVkhCYjVlcXVXa2ZxN2RVbkJPMVJ5UXhOUjg3Uzg4MUozbEx6VUIxSHBJTlQzSUx1TldJa3R1bzhpaGJKRnoiLCJtYWMiOiJjOGYyY2YzZmNiMTc4NDZkZWUwNTZjNGZlMmE2MmQ2MTE5Zjg5MzBlYjA2YzBjNzcyOTA4ZmZkZWVjZTdkMmQ1IiwidGFnIjoiIn0%3D; expires=Mon, 13 Apr 2026 09:54:27 GMT; Max-Age=7200; path=/; secure; httponly; samesite=lax
 

{
    "message": "Unauthenticated."
}
 

Request      

GET xls/auth-logs

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

datetime   object  optional    
datetime.0   string     

Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1. Example: 2025-01-01

datetime.1   string     

End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0. Example: 2025-12-31

filter   object  optional    
filter.oid   string  optional    

Filter by username. Väli value ei tohi olla pikem kui 255 tähemärki. Example: metrotec

filter.user_agent   string  optional    

Filter by user agent. Väli value ei tohi olla pikem kui 255 tähemärki. Example: Mozilla/5.0

filter.ip_address   string  optional    

Filter by IP address. Väli value ei tohi olla pikem kui 255 tähemärki. Example: 192.168.1.1

User sessions

User session management

Get User's current active sessions

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/tokens';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/tokens'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 1,
        "oid": "metrotec",
        "name": "web",
        "platform": "iOS",
        "ip": "192.168.1.1",
        "location": {
            "country": "EE",
            "city": "Tallinn"
        },
        "last_used_at": "2025-11-28T10:00:00.000000Z",
        "created_at": "2025-11-28T08:00:00.000000Z",
        "expires_at": "2025-12-28T10:00:00.000000Z",
        "updated_at": "2025-11-28T10:00:00.000000Z"
    }
]
 

Request      

GET api/tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Username Example: metrotec

Get sessions for all users owned by current user

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/architecto/tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/architecto/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/architecto/tokens';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/architecto/tokens'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 1,
        "oid": "metrotec",
        "name": "API token",
        "created_at": "2025-01-01T00:00:00.000000Z",
        "expires_at": null,
        "updated_at": "2025-11-28T10:00:00.000000Z"
    }
]
 

Request      

GET api/{user_oid}/tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Example: architecto

Delete the specific token

requires authentication

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/metrotec/tokens/88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/metrotec/tokens/88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/metrotec/tokens/88';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/metrotec/tokens/88'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

Empty response
 

Request      

DELETE api/{user_oid}/tokens/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user_oid   string     

Username Example: metrotec

id   integer     

The ID of the token. Example: 88

token_id   string     

Token ID Example: 90

API tokens

API tokens management

Get API tokens for all users owned by current user

requires authentication

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/api-tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/api-tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/api-tokens';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/api-tokens'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


[
    {
        "id": 1,
        "oid": "metrotec",
        "name": "API token",
        "created_at": "2025-01-01T00:00:00.000000Z",
        "expires_at": null,
        "updated_at": "2025-11-28T10:00:00.000000Z"
    }
]
 

Request      

GET api/api-tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Create an API token for given user

requires authentication

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/api-tokens" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"oid\": \"metrotec\",
    \"token_name\": \"API token\",
    \"expires_at\": \"2026-12-31\"
}"
const url = new URL(
    "https://api2.metrotec.ee/api/api-tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "oid": "metrotec",
    "token_name": "API token",
    "expires_at": "2026-12-31"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/api-tokens';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'oid' => 'metrotec',
            'token_name' => 'API token',
            'expires_at' => '2026-12-31',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/api-tokens'
payload = {
    "oid": "metrotec",
    "token_name": "API token",
    "expires_at": "2026-12-31"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "id": 1,
    "tokenable_type": "App\\Models\\User",
    "tokenable_id": 123,
    "name": "API token",
    "abilities": [
        "api"
    ],
    "last_used_at": null,
    "expires_at": "2026-12-31T00:00:00.000000Z",
    "created_at": "2025-11-28T10:00:00.000000Z",
    "updated_at": "2025-11-28T10:00:00.000000Z",
    "plainTextToken": "1|abc123def456..."
}
 

Request      

POST api/api-tokens

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

oid   string     

The username for token Example: metrotec

token_name   string     

The name or purpose of the token Example: API token

expires_at   date  optional    

Optional expiration date Example: 2026-12-31

Delete the specific API token

requires authentication

Example request:
curl --request DELETE \
    "https://api2.metrotec.ee/api/api-tokens/88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/api-tokens/88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/api-tokens/88';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/api-tokens/88'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (204, success):

Empty response
 

Request      

DELETE api/api-tokens/{id}

Headers

Authorization        

Example: Bearer {YOUR_AUTH_KEY}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the api token. Example: 88

token_id   string     

Token ID Example: 1234

Vehicles

*

Objects

Object management

GET api/objects-query

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/objects-query" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"b\"
}"
const url = new URL(
    "https://api2.metrotec.ee/api/objects-query"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "b"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/objects-query';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'q' => 'b',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/objects-query'
payload = {
    "q": "b"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/objects-query

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string     

Must match the regex /^[a-zA-Z0-9_]+$/. Väli value peab olema vähemalt 2 tähemärki. Väli value ei tohi olla pikem kui 50 tähemärki. Example: b

POST api/objects

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/objects" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"bngzmi\",
    \"oid\": \"y\",
    \"Serial_Nr\": \"vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip\",
    \"GSM_NR\": \"ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz\",
    \"Manufacture\": 16,
    \"odometer\": 16,
    \"T1max\": 16,
    \"T2max\": 16,
    \"odometer_day\": \"2026-04-13 07:54:27\",
    \"description\": \"Eius et animi quos velit et.\",
    \"tank_vol\": 4326.41688,
    \"x_coord\": 4326.41688,
    \"y_coord\": 4326.41688,
    \"is_fixed_gps\": false
}"
const url = new URL(
    "https://api2.metrotec.ee/api/objects"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "bngzmi",
    "oid": "y",
    "Serial_Nr": "vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip",
    "GSM_NR": "ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz",
    "Manufacture": 16,
    "odometer": 16,
    "T1max": 16,
    "T2max": 16,
    "odometer_day": "2026-04-13 07:54:27",
    "description": "Eius et animi quos velit et.",
    "tank_vol": 4326.41688,
    "x_coord": 4326.41688,
    "y_coord": 4326.41688,
    "is_fixed_gps": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/objects';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'bngzmi',
            'oid' => 'y',
            'Serial_Nr' => 'vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip',
            'GSM_NR' => 'ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz',
            'Manufacture' => 16,
            'odometer' => 16,
            'T1max' => 16,
            'T2max' => 16,
            'odometer_day' => '2026-04-13 07:54:27',
            'description' => 'Eius et animi quos velit et.',
            'tank_vol' => 4326.41688,
            'x_coord' => 4326.41688,
            'y_coord' => 4326.41688,
            'is_fixed_gps' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/objects'
payload = {
    "object_id": "bngzmi",
    "oid": "y",
    "Serial_Nr": "vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip",
    "GSM_NR": "ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz",
    "Manufacture": 16,
    "odometer": 16,
    "T1max": 16,
    "T2max": 16,
    "odometer_day": "2026-04-13 07:54:27",
    "description": "Eius et animi quos velit et.",
    "tank_vol": 4326.41688,
    "x_coord": 4326.41688,
    "y_coord": 4326.41688,
    "is_fixed_gps": false
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/objects

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki. Example: bngzmi

oid   string     

Must contain only letters and numbers. Väli value ei tohi olla pikem kui 30 tähemärki. Example: y

Serial_Nr   string     

Must match the regex /^[0-9_]+$/. Väli value peab olema vähemalt 3 tähemärki. Example: vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip

GSM_NR   string     

Must match the regex /^[0-9+]+$/. Väli value peab olema vähemalt 3 tähemärki. Example: ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz

Manufacture   integer     

Example: 16

odometer   integer     

Example: 16

T1max   integer     

Example: 16

T2max   integer     

Example: 16

odometer_day   string     

Must be a valid date in the format Y-m-d H:i:s. Example: 2026-04-13 07:54:27

description   string  optional    

Example: Eius et animi quos velit et.

tank_vol   number  optional    

Example: 4326.41688

x_coord   number  optional    

Example: 4326.41688

y_coord   number  optional    

Example: 4326.41688

is_fixed_gps   boolean  optional    

Example: false

PUT api/objects/{id}

Example request:
curl --request PUT \
    "https://api2.metrotec.ee/api/objects/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"bngzmi\",
    \"oid\": \"y\",
    \"Serial_Nr\": \"vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip\",
    \"GSM_NR\": \"ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz\",
    \"Manufacture\": 16,
    \"odometer\": 16,
    \"T1max\": 16,
    \"T2max\": 16,
    \"odometer_day\": \"2026-04-13 07:54:27\",
    \"description\": \"Eius et animi quos velit et.\",
    \"tank_vol\": 4326.41688,
    \"x_coord\": 4326.41688,
    \"y_coord\": 4326.41688,
    \"is_fixed_gps\": true
}"
const url = new URL(
    "https://api2.metrotec.ee/api/objects/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "bngzmi",
    "oid": "y",
    "Serial_Nr": "vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip",
    "GSM_NR": "ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz",
    "Manufacture": 16,
    "odometer": 16,
    "T1max": 16,
    "T2max": 16,
    "odometer_day": "2026-04-13 07:54:27",
    "description": "Eius et animi quos velit et.",
    "tank_vol": 4326.41688,
    "x_coord": 4326.41688,
    "y_coord": 4326.41688,
    "is_fixed_gps": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/objects/architecto';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'bngzmi',
            'oid' => 'y',
            'Serial_Nr' => 'vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip',
            'GSM_NR' => 'ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz',
            'Manufacture' => 16,
            'odometer' => 16,
            'T1max' => 16,
            'T2max' => 16,
            'odometer_day' => '2026-04-13 07:54:27',
            'description' => 'Eius et animi quos velit et.',
            'tank_vol' => 4326.41688,
            'x_coord' => 4326.41688,
            'y_coord' => 4326.41688,
            'is_fixed_gps' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/objects/architecto'
payload = {
    "object_id": "bngzmi",
    "oid": "y",
    "Serial_Nr": "vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip",
    "GSM_NR": "ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz",
    "Manufacture": 16,
    "odometer": 16,
    "T1max": 16,
    "T2max": 16,
    "odometer_day": "2026-04-13 07:54:27",
    "description": "Eius et animi quos velit et.",
    "tank_vol": 4326.41688,
    "x_coord": 4326.41688,
    "y_coord": 4326.41688,
    "is_fixed_gps": true
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Request      

PUT api/objects/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the object. Example: architecto

Body Parameters

object_id   string  optional    

Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki. Example: bngzmi

oid   string  optional    

Must contain only letters and numbers. Väli value ei tohi olla pikem kui 30 tähemärki. Example: y

Serial_Nr   string  optional    

Must match the regex /^[0-9_]+$/. Väli value peab olema vähemalt 3 tähemärki. Example: vdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewtnnoqitpxntltcvip

GSM_NR   string  optional    

Must match the regex /^[0-9+]+$/. Väli value peab olema vähemalt 3 tähemärki. Example: ojsausgioglrbchgsrzyhcttwbkmkftmgosgtvnbobmzezcrcvalexqztppihrtgkkrerexhqz

Manufacture   integer  optional    

Example: 16

odometer   integer  optional    

Example: 16

T1max   integer  optional    

Example: 16

T2max   integer  optional    

Example: 16

odometer_day   string  optional    

Must be a valid date in the format Y-m-d H:i:s. Example: 2026-04-13 07:54:27

description   string  optional    

Example: Eius et animi quos velit et.

tank_vol   number  optional    

Example: 4326.41688

x_coord   number  optional    

Example: 4326.41688

y_coord   number  optional    

Example: 4326.41688

is_fixed_gps   boolean  optional    

Example: true

GET api/lastdata

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/lastdata" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/lastdata"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/lastdata';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/lastdata'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/lastdata

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/lastdata/{id}

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/lastdata/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/lastdata/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/lastdata/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/lastdata/architecto'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/lastdata/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the lastdatum. Example: architecto

GET api/rfid/{id}

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/rfid/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/rfid/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/rfid/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/rfid/architecto'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/rfid/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the rfid. Example: architecto

Devices

Device management

GET api/navilist/{id}

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/navilist/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/navilist/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/navilist/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/navilist/architecto'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/navilist/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the navilist. Example: architecto

POST api/navireq

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/navireq" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"bngzmi\",
    \"content\": \"architecto\"
}"
const url = new URL(
    "https://api2.metrotec.ee/api/navireq"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "bngzmi",
    "content": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/navireq';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'bngzmi',
            'content' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/navireq'
payload = {
    "object_id": "bngzmi",
    "content": "architecto"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/navireq

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Väli value ei tohi olla pikem kui 10 tähemärki. Example: bngzmi

content   string     

Example: architecto

GET api/smslist/{id}

Example request:
curl --request GET \
    --get "https://api2.metrotec.ee/api/smslist/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api2.metrotec.ee/api/smslist/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/smslist/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/smslist/architecto'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/smslist/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the smslist. Example: architecto

POST api/smsreq

Example request:
curl --request POST \
    "https://api2.metrotec.ee/api/smsreq" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": \"bngzmi\",
    \"content\": \"architecto\"
}"
const url = new URL(
    "https://api2.metrotec.ee/api/smsreq"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "object_id": "bngzmi",
    "content": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://api2.metrotec.ee/api/smsreq';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 'bngzmi',
            'content' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api2.metrotec.ee/api/smsreq'
payload = {
    "object_id": "bngzmi",
    "content": "architecto"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/smsreq

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

object_id   string     

Väli value ei tohi olla pikem kui 10 tähemärki. Example: bngzmi

content   string     

Example: architecto