Metrotec API 2.0 (1.1.0)

Download OpenAPI specification:

Introduction

Metrotec API is a RESTful web service that allows developers to programmatically interact with Metrotec data over HTTPS using JSON. The base URL for the Metrotec API is https://api.metrotec.ee/api/ If you have questions about using the API or need to report a bug, please email us at info@metrotec.ee.

User-Agent

Set a clearly identifiable User-Agent HTTP header that uniquely identifies your company and integration software. Please use only printable ASCII characters. Examples of good practice (substitute your own names):

User-Agent: MyDomain.com
User-Agent: MyApplication
User-Agent: MyApplication/1.0.0
User-Agent: MyApplication/1.0.0 (api-requests/1.0.0)

Versioning

All API requests must specify the version of the API that your integration was built with. Add this version number to the Accept HTTP header as an additional argument. Replace X.Y.Z in the following example with the most recent version number shown at the top of the documentation page:

GET /routelog/ HTTP/1.1
Host: api.metrotec.ee
Accept: application/json; version=X.Y.Z
User-Agent: MyApplication/1.0.0

You can use the browsable API without specifying a version for development purposes, but all production system requests must include the version in the Accept header.

Language

The API responds with names and labels in English by default. To receive localized responses, indicate your preferred language using the appropriate HTTP header.

Time Zones

Timestamps in the API are in UTC by default. Timestamps displayed in the web and mobile apps use the account timezone, which typically differs from UTC.

Errors

Metrotec uses conventional HTTP response codes to indicate the success or failure of API requests: - 2xx range: Success - 4xx range: Error based on provided information - 5xx range: Error with Metrotec's servers

Status code Status text Description
200 OK Request succeeded
400 Bad Request Often missing a required parameter
401 Unauthorized No valid auth token provided
404 Resource not found Parameters were valid but request not found
50* Server Errors Something went wrong on our end

Authentication

Use your Metrotec username and password for API authentication. See the "Authorization" section for information on generating an API token. To authenticate, include the token in the Authorization HTTP header: Authorization: Bearer [token]

Changelog

Version 1.0.0:

  • Initial public release

Version 1.1.0:

  • Added vehicles and POI report endpoints

Authentication

User authentication endpoints

Authenticate and get JWT token

Request Body schema: application/json
required
username
required
string

User account username

password
required
string

User account password

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "jwt": "string",
  • "expires": 0
}

Tasks

Task management endpoints

List all tasks

query Parameters
limit
integer
Examples: limit=-1 limit=100

Number or results to return. -1 means return all.

offset
integer
Examples: offset=0 offset=100

From which records to return. 0 means from the start

all
integer
Examples: all=1 all=0

If set to 1, then return all results. 0 or empty returns only active (not finished) records.

Responses

Response samples

Content type
application/json
Example

Example response for basic standard task with core fields only

[
  • {
    }
]

Create a new task

Request Body schema: application/json
required
object_id
required
string

Vehicle registration number

start_lat
number <float>

Starting point latitude

start_lon
number <float>

Starting point longitude

start_address
string

Starting point address

lat
required
number <float>

Destination latitude

lon
required
number <float>

Destination longitude

start_time
required
string <date-time>

Task start time (UTC, YYYY-MM-DD HH:MM:SS)

stop_time
required
string <date-time>

Task expected stop time (UTC, YYYY-MM-DD HH:MM:SS)

order_ref
required
string

Reference number from your system (must be unique)

order_details
string

Order details, client name, etc.

task_address
string

Task location address

task_description
string

Task description

planned_km
number

Planned distance between start and stop points in kilometers

task_notes
string

Additional notes for the task

status
integer
Enum: 1 2 3 4 5

Task status on creation (1=Created, 2=In progress, 3=Completed, 4=Rejected, 5=Cancelled)

is_not_own_vehicle
boolean

Whether the task uses own vehicle or not

active
boolean

Whether the task is active

group_id
integer

Task group identifier

Responses

Request samples

Content type
application/json
Example

Basic task with core fields only

{
  • "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",
  • "order_ref": "ORDER-2025-001",
  • "task_address": "Tallinn, Estonia",
  • "task_description": "Standard delivery task",
  • "active": true
}

Get task by ID

path Parameters
id
required
integer

Task ID

Responses

Response samples

Content type
application/json
Example

Complete standard task object with core fields only

{
  • "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",
  • "invoice_nr": null,
  • "user_km": null,
  • "distance": null,
  • "geozone_entered_at": null,
  • "geozone_left_at": null,
  • "closeType": null,
  • "planned_km": null,
  • "ut": 1705747200,
  • "alias": "Delivery Van 3",
  • "task_notes": null,
  • "active": true,
  • "group_id": null,
  • "is_not_own_vehicle": false
}

Update task

path Parameters
id
required
integer

Task ID

Request Body schema: application/json
required
object_id
string

Vehicle registration number

start_lat
number <float>

Starting point latitude

start_lon
number <float>

Starting point longitude

start_address
string

Starting point address

lat
number <float>

Destination latitude

lon
number <float>

Destination longitude

start_time
string <date-time>

Task start time (UTC, YYYY-MM-DD HH:MM:SS)

stop_time
string <date-time>

Task expected stop time (UTC, YYYY-MM-DD HH:MM:SS)

order_ref
string

Reference number from your system

order_details
string

Order details, client name, etc.

task_address
string

Task location address

task_description
string

Task description

status
integer
Enum: 1 2 3 4 5

Task status (1=Created, 2=In progress, 3=Completed, 4=Rejected, 5=Cancelled)

planned_km
number

Planned distance between start and stop points in kilometers

task_notes
string

Additional notes for the task

active
boolean

Whether the task is active

group_id
integer

Task group identifier

edit
boolean

Flag indicating if this is an edit operation (triggers audit logging)

sender
string

Updated sender information

Responses

Request samples

Content type
application/json
Example

Update a basic task with core fields

{
  • "task_address": "Updated Address, Tallinn",
  • "task_description": "Updated delivery task description",
  • "status": 2,
  • "task_notes": "Delivery route changed",
  • "stop_time": "2025-01-20 18:00:00",
  • "edit": true
}

Delete task

path Parameters
id
required
integer

Task ID

Responses

Vehicles

Vehicle tracking and telematics data

Get last data for all vehicles

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get last data for specific vehicle

path Parameters
id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
{
  • "ID": 0,
  • "objectID": "string",
  • "Xpos": 0.1,
  • "Ypos": 0.1,
  • "Counter1": 0,
  • "Counter2": 0,
  • "GMTime": "2019-08-24T14:15:22Z",
  • "Speed": 0,
  • "Heading": "string",
  • "Input": 0,
  • "LastCommunicationLocalTime": "2019-08-24T14:15:22Z",
  • "Content": "string",
  • "Power": 0.1,
  • "BatLevel": 0,
  • "NoGPSFix": "string",
  • "t1": 0,
  • "t2": 0,
  • "t3": 0,
  • "t4": 0
}

Get vehicles inside a geographic polygon

Returns a list of vehicles located within a specified geographic polygon

query Parameters
coordinates
required
string
Examples: coordinates=[[24.868293,59.318745], [24.871149,59.318745], [24.871149,59.320103], [24.868293,59.320103], [24.868293,59.318745]]

Array of points [longitude, latitude] that form a polygon. Must be a correct polygon with at least 4 points where the first point equals the last point.

Responses

Response samples

Content type
application/json
[
  • "000AAA"
]

Get all vehicles

Returns a list of all vehicles with their configuration and status information

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get vehicle settings

Returns vehicle settings including features, events, and configuration

path Parameters
object_id
required
string
Examples: STEND

Vehicle ID

Responses

Response samples

Content type
application/json
{
  • "hasTow": false,
  • "hasGeo": true,
  • "hasRepInt": true,
  • "hasTamperLight": true,
  • "hasLightSensor": true,
  • "outputs": null,
  • "repInts": [
    ],
  • "events": [
    ],
  • "alarm": null,
  • "zones": [ ]
}

Create geoalarm for vehicle

Associates a vehicle with a geozone for alarm notifications

Request Body schema: application/json
required
object_id
required
string

Vehicle object ID

zoneId
required
integer

Geozone ID

events
required
Array of integers
Items Enum: 1 2

Events to monitor (1 = enter, 2 = exit)

Responses

Request samples

Content type
application/json
{
  • "object_id": "STEND",
  • "zoneId": 93,
  • "events": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 1367,
  • "geozoneID": 50231,
  • "object_id": "STEND",
  • "geo_id": 1
}

Delete a geoalarm

Removes a geoalarm association between a vehicle and geozone

path Parameters
id
required
integer
Examples: 1368

Geoalarm ID

Responses

Create vehicle event

Creates a new vehicle event for tracking and control purposes

Request Body schema: application/json
required
object_id
required
string

Vehicle object ID

eventType
required
integer

Type of event (3=Reporting interval, 4=Light control, 5=Other)

description
required
string

Event description (ON/OFF for lights, interval values for reporting)

Responses

Request samples

Content type
application/json
{
  • "object_id": "STEND",
  • "eventType": 5,
  • "description": "OFF"
}

Response samples

Content type
application/json
{
  • "id": 1499,
  • "handled": 0,
  • "description": "OFF",
  • "eventDate": "2025-09-19 15:30:20",
  • "date": "2025-09-19 15:30:20"
}

Reports

Various vehicle reports (drive, engine, fuel)

Get drive report for vehicle

path Parameters
period_start
required
string <date-time>
Examples: 2017-10-2400:00:00

Start date in format YYYY-MM-DDHH:MM:SS

period_stop
required
string <date-time>
Examples: 2017-10-3123:59:59

End date in format YYYY-MM-DDHH:MM:SS

vehicle_id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get engine report for vehicle

path Parameters
period_start
required
string <date-time>
Examples: 2017-10-2400:00:00

Start date in format YYYY-MM-DDHH:MM:SS

period_stop
required
string <date-time>
Examples: 2017-10-3123:59:59

End date in format YYYY-MM-DDHH:MM:SS

vehicle_id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get fuel report for vehicle

path Parameters
period_start
required
string <date-time>
Examples: 2017-10-2400:00:00

Start date in format YYYY-MM-DDHH:MM:SS

period_stop
required
string <date-time>
Examples: 2017-10-3123:59:59

End date in format YYYY-MM-DDHH:MM:SS

vehicle_id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get route log for vehicle

path Parameters
start_from
required
string <date-time>
Examples: 2017-10-3121:45:57

Start date in format YYYY-MM-DDHH:MM:SS

vehicle_id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get status report for all vehicles

Returns working and repair time for all vehicles in a specified period

query Parameters
datetime[]
required
Array of strings <date-time> [ items <date-time > ]
Examples: datetime[]=2021-11-30 22:00:00&datetime[]=2021-12-08 21:59:59

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get detailed status report for a specific vehicle

Returns detailed work and repair periods for a specific vehicle

path Parameters
id
required
string

Vehicle ID

query Parameters
datetime[]
required
Array of strings <date-time> [ items <date-time > ]
Examples: datetime[]=2021-11-30 22:00:00&datetime[]=2021-12-08 21:59:59

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get rides count grouped by vehicle

Returns the count of rides for each vehicle within the specified period

query Parameters
datetime[]
required
Array of strings <date-time> [ items <date-time > ]
Examples: datetime[]=2021-06-02 12:00:00&datetime[]=2021-06-02 12:59:59

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get POI report status

Returns the status of POI reports. Status codes - 0=Not processed, 1=Processing, 2=Done

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Generate POI report

Creates a POI (Point of Interest) report for the specified time period and criteria

Request Body schema: application/json
required
datetime
required
Array of strings <date-time> = 2 items [ items <date-time > ]

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

type
required
string
Enum: "poi" "geo" "country" "rtasks"

Report type

type_id
integer or null

Specific type ID filter (optional)

group
required
string
Enum: "vehicle" "category"

Group category for the report

group_id
string or null^[a-zA-Z0-9-_]{0,10}$

Specific group ID filter

Responses

Request samples

Content type
application/json
{
  • "datetime": [
    ],
  • "type": "poi",
  • "type_id": null,
  • "group": "vehicle",
  • "group_id": null
}

Response samples

Content type
application/json
{
  • "id": 11880,
  • "status": 0,
  • "type": "poi",
  • "group": "vehicle",
  • "type_id": null,
  • "group_id": null,
  • "group_name": null,
  • "type_name": null,
  • "start_time": "2025-09-01 21:00:00",
  • "stop_time": "2025-09-09 20:59:59",
  • "repStatus": "2025-09-09 12:28:38"
}

Get POI report data

Returns the actual POI report data with detailed visit information for each POI

path Parameters
id
required
integer

POI report ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Navigation

Navigation requests and responses

Get navigation requests for vehicle

path Parameters
period_start
required
string <date-time>
Examples: 2017-10-2400:00:00

Start date in format YYYY-MM-DDHH:MM:SS

period_stop
required
string <date-time>
Examples: 2017-10-3123:59:59

End date in format YYYY-MM-DDHH:MM:SS

vehicle_id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new navigation request

Request Body schema: application/json
required
object_id
required
string

Vehicle registration number

type
required
string
Enum: "MESSAGE" "GETDESTINATION" "SETLOCATION" "CONTROL"

Request type

lat
number <float>

Latitude (required for SETLOCATION type)

lon
number <float>

Longitude (required for SETLOCATION type)

functionId
string <= 140 characters

Function ID

msg
string <= 140 characters

Message text (for CONTROL type, valid values are OUT1ON, OUT1OFF, OUT2ON, OUT2OFF, OUT3ON, OUT3OFF, OUT4ON, OUT4OFF)

Responses

Request samples

Content type
application/json
{
  • "object_id": "string",
  • "type": "MESSAGE",
  • "lat": 0.1,
  • "lon": 0.1,
  • "functionId": "string",
  • "msg": "string"
}

Response samples

Content type
application/json
[
  • {
    }
]

Get navigation answers for vehicle

path Parameters
period_start
required
string <date-time>
Examples: 2017-10-2400:00:00

Start date in format YYYY-MM-DDHH:MM:SS

period_stop
required
string <date-time>
Examples: 2017-10-3123:59:59

End date in format YYYY-MM-DDHH:MM:SS

vehicle_id
required
string

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POI

Points of interest management

Get all points of interest

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new point of interest

Request Body schema: application/json
required
lat
required
number <float>

Latitude

lon
required
number <float>

Longitude

name
string <= 50 characters

POI name

purpose
required
integer

POI purpose - 0-POI, 1-Customer, 2-WIFI router, 3-Bluetooth beacon

comment
required
string <= 255 characters

POI comment. If Wifi Router or Bluetooth beacon, is required and should be valid MAC address.

type
integer [ 1 .. 9 ]
Default: 1

POI group

radius
integer
Default: 50

POI radius in meters

rgAddress
string

POI address

phone_nr
string

Phone number

country_code
string

Phone country number

contact_name
string

Contact name

Responses

Request samples

Content type
application/json
{
  • "lat": 24.868293,
  • "lon": 59.318745,
  • "name": "Home",
  • "purpose": 0,
  • "comment": "AD-6A-9F-DA-13-7D",
  • "type": 1,
  • "radius": 10,
  • "rgAddress": "Vehemaa tee 5, Viimsi",
  • "phone_nr": "55667788",
  • "country_code": "+1",
  • "contact_name": "King Arthur"
}

Get POI report status

Returns the status of POI reports. Status codes - 0=Not processed, 1=Processing, 2=Done

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Generate POI report

Creates a POI (Point of Interest) report for the specified time period and criteria

Request Body schema: application/json
required
datetime
required
Array of strings <date-time> = 2 items [ items <date-time > ]

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

type
required
string
Enum: "poi" "geo" "country" "rtasks"

Report type

type_id
integer or null

Specific type ID filter (optional)

group
required
string
Enum: "vehicle" "category"

Group category for the report

group_id
string or null^[a-zA-Z0-9-_]{0,10}$

Specific group ID filter

Responses

Request samples

Content type
application/json
{
  • "datetime": [
    ],
  • "type": "poi",
  • "type_id": null,
  • "group": "vehicle",
  • "group_id": null
}

Response samples

Content type
application/json
{
  • "id": 11880,
  • "status": 0,
  • "type": "poi",
  • "group": "vehicle",
  • "type_id": null,
  • "group_id": null,
  • "group_name": null,
  • "type_name": null,
  • "start_time": "2025-09-01 21:00:00",
  • "stop_time": "2025-09-09 20:59:59",
  • "repStatus": "2025-09-09 12:28:38"
}

Get POI report data

Returns the actual POI report data with detailed visit information for each POI

path Parameters
id
required
integer

POI report ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Drivers

Driver information endpoints

Get list of all vehicle drivers

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get list of drivers for specific vehicle

query Parameters
startUse
string <date-time>
Examples: startUse=2017-10-2400:00:00

Start date in format YYYY-MM-DDHH:MM:SS

stopUse
string <date-time>
Examples: stopUse=2017-10-3123:59:59

End date in format YYYY-MM-DDHH:MM:SS

object_id
required
string
Examples: object_id=000AAA

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Booking

Booking management endpoints

Get all bookings

query Parameters
datetime[]
Array of any <date-time> [ items <date-time > ]
Examples: datetime[]=2024-10-24 00:00:00&datetime[]=2024-10-31 23:59:59

Start and end date in format YYYY-MM-DD HH:MM:SS

object_id
string
Examples: object_id=000AAA

Vehicle ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Documents

Document generation endpoints (waybills, reports)

Receive one or more waybills in a single PDF file

Requests waybill(s) in PDF file format

query Parameters
nr[]
required
Array of integers
Examples: nr[]=1047039&nr[]=1047031&nr[]=1044619

Waybill number(s)

Responses

Get waybills by work order number as PDF

Packages waybills related to a work order number into a single PDF file

path Parameters
work_order_number
required
string

Work order number

Responses

Waybills

Waybill management endpoints

List opened waybills

Returns a list of all currently opened waybills (all datetime values are in UTC)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get rides count grouped by vehicle

Returns the count of rides for each vehicle within the specified period

query Parameters
datetime[]
required
Array of strings <date-time> [ items <date-time > ]
Examples: datetime[]=2021-06-02 12:00:00&datetime[]=2021-06-02 12:59:59

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Stock Data

Fuel tank and stock monitoring endpoints

Get all recent stock data

Requests recent information from all objects with fuel tank data

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get stock data with next refill time by tank

Requests recent information together with the next refill time from specified tank

path Parameters
object_id
required
string

Object ID/Tank identifier

Responses

Response samples

Content type
application/json
[
  • {
    }
]

DDD

Tacho data endpoints

Get vehicle or driver status summary

query Parameters
object_id
required
string
Examples: object_id=789SCA

Vehicle ID

driver_id
integer
Examples: driver_id=3753

Driver ID (either object_id or driver_id is required)

datetime[]
required
Array of strings <date-time> [ items <date-time > ]
Examples: datetime[]=2025-09-08 21:00:00&datetime[]=2025-09-09 20:59:59

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

Responses

Response samples

Content type
application/json
{
  • "0": 30044,
  • "1": 0,
  • "2": 660,
  • "3": 8847,
  • "6": 0,
  • "7": 0,
  • "route_length": 161.925
}

Get detailed driver or vehicle status records

query Parameters
object_id
string
Examples: object_id=789SCA

Vehicle ID (either object_id or driver_id is required)

driver_id
integer
Examples: driver_id=3753

Driver ID (either object_id or driver_id is required)

datetime[]
required
Array of strings <date-time> [ items <date-time > ]
Examples: datetime[]=2025-09-08 21:00:00&datetime[]=2025-09-09 20:59:59

Period start and end timestamps (UTC) in format YYYY-MM-DD HH:MM:SS

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get vehicle information with driver status

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get driver information with current status and vehicle assignment

query Parameters
offset
integer
Examples: offset=-1 offset=0 offset=10

Offset for pagination (-1 returns all drivers)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Geozones

Geofencing zones management

Get all geozones

Returns a list of all configured geofencing zones

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new geozone

Creates a new geofencing zone

Request Body schema: application/json
required
id
string

Identifier for the new item (typically "newItem" for new zones)

name
required
string

Geozone name or address

geometry
required
string

JSON string containing geometry definition

cAlarmState
boolean
Default: false

Alarm state configuration

countAlarm
integer
Default: 4

Alarm count configuration

zObjects
Array of strings
Default: []

List of objects/vehicles to associate with this geozone

Responses

Request samples

Content type
application/json
{
  • "id": "newItem",
  • "name": "Haljas tee 25, Pirita, Tallinn, 12012 Harju Maakond, Estonia",
  • "geometry": "{\"latlng\":{\"lat\":59.457170251972315,\"lng\":24.840130805969242},\"radius\":603.832476916605,\"type\":\"circle\"}",
  • "cAlarmState": false,
  • "countAlarm": 4,
  • "zObjects": [ ]
}

Response samples

Content type
application/json
{
  • "id": 50231,
  • "name": "Haljas tee 25, Pirita, Tallinn, 12012 Harju Maakond, Estonia",
  • "geometry": {
    },
  • "auto": "0",
  • "deleted_at": null,
  • "cAlarmState": false,
  • "countAlarm": 2,
  • "zObjects": [ ]
}

Delete a geozone

Removes a geozone from the system

path Parameters
id
required
integer
Examples: 50231

Geozone ID

Responses

Files

File upload and management endpoints

List all files

Returns a list of all files associated with the authenticated user's organization

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload a new file

Uploads a file and associates it with a specific entity (task, vehicle fault, feedback answer, etc.). Files are automatically categorized by type (image, CMR, delivery note, order, signature, etc.).

Request Body schema: multipart/form-data
required
file
required
string <binary>

The file to upload

pivot_type
required
string
Enum: "accounts" "logos" "route_tasks" "vehicle_faults" "feedback_answers" "tech_card_works" "signatures"

Type of entity to associate the file with:

  • accounts: Account/organization files
  • logos: Company logos
  • route_tasks: Task-related files
  • vehicle_faults: Vehicle fault documentation
  • feedback_answers: Feedback answer attachments
  • tech_card_works: Technical card work documents
  • signatures: Digital signatures
pivot_id
required
string

ID of the entity to associate the file with (e.g., task ID, vehicle fault ID)

max_files
integer >= 1

Maximum number of files allowed for this entity

hidden
integer
Default: 0
Enum: 0 1

Whether the file is hidden (0=visible, 1=hidden)

file_type
string
Enum: "image" "cmr" "delivery_note" "order" "other" "receiver_signature" "sender_signature" "carrier_signature"

Type of file content:

  • image: Generic image file
  • cmr: CMR (Convention relative au contrat de transport international de Marchandises par Route) document
  • delivery_note: Delivery note document
  • order: Order document
  • other: Other file types
  • receiver_signature: Receiver's signature
  • sender_signature: Sender's signature
  • carrier_signature: Carrier's signature
auto_crop
integer
Default: 0
Enum: 0 1

Automatically crop the image (0=no, 1=yes)

auto_type
string
Enum: "jpg" "gif" "png" "webp"

Automatically convert image to specified format

Responses

Request samples

Content type
multipart/form-data
Example
{
  "pivot_type": "route_tasks",
  "pivot_id": "12345",
  "file_type": "image",
  "hidden": 0
}

Response samples

Content type
application/json
{
  • "id": 12345,
  • "pivot_id": "67890",
  • "pivot_type": "route_tasks",
  • "defined_name": "Task Photo - Loading Area",
  • "file_name": "20250119_abc123def456.jpg",
  • "mime": "image/jpeg",
  • "file_type": "image",
  • "uploaded_at": "2025-01-19 10:30:45",
  • "oid": 100,
  • "sender": "john.doe",
  • "hidden": 0
}

Get file by ID

Returns file metadata by ID

path Parameters
id
required
integer

File ID

Responses

Response samples

Content type
application/json
{
  • "id": 12345,
  • "pivot_id": "67890",
  • "pivot_type": "route_tasks",
  • "defined_name": "Task Photo - Loading Area",
  • "file_name": "20250119_abc123def456.jpg",
  • "mime": "image/jpeg",
  • "file_type": "image",
  • "uploaded_at": "2025-01-19 10:30:45",
  • "oid": 100,
  • "sender": "john.doe",
  • "hidden": 0
}

Update file metadata

Updates the file type classification

path Parameters
id
required
integer

File ID

Request Body schema: application/json
required
file_type
required
string
Enum: "image" "cmr" "delivery_note" "order" "other" "receiver_signature" "sender_signature" "carrier_signature"

Updated file type classification

Responses

Request samples

Content type
application/json
{
  • "file_type": "image"
}

Delete file

Permanently deletes a file and removes it from storage

path Parameters
id
required
integer

File ID

Responses