# Smartlane API Documentation > Mit der Smartlane-API können Lieferungen und optimierte Touren per Code geplant und nahtlos in bestehende Prozesse und Systeme integriert werden. Append .md to any documentation page URL to get its markdown version. ## Guides - [-> Overview](https://docs.smartlane.ai/docs/overview.md) - [-> Sign Up - Getting Started](https://docs.smartlane.ai/docs/sign-up-getting-started.md) - [-> Depot](https://docs.smartlane.ai/docs/depot-1.md) - [-> Defining shipments](https://docs.smartlane.ai/docs/2-defining-deliveries.md) - [-> Defining vehicles](https://docs.smartlane.ai/docs/3-defining-vehicles.md): Manage the fleet - [-> Optimizing Routes](https://docs.smartlane.ai/docs/optimizing-routes.md) - [-> Getting results](https://docs.smartlane.ai/docs/5-planning-results-1.md) - [-> Features](https://docs.smartlane.ai/docs/-features.md) - [-> How to assign primary and secondary territories to vehicles](https://docs.smartlane.ai/docs/-how-to-assign-primary-and-secondary-territories-to-vehicles.md) - [-> Access](https://docs.smartlane.ai/docs/access.md) - [-> Planning Data](https://docs.smartlane.ai/docs/master-data.md) - [-> Planning Process](https://docs.smartlane.ai/docs/optimization.md) ## API Reference - [Calc route optimized timewindow](https://docs.smartlane.ai/reference/postcalcrouteoptimizedtimewindow.md): Calculates optimal routes for vehicles serving the given shipments. This an asynchroneous process which returns a Process ID. Results can then be polled (e.g. every second) via "GET /api/process/status//current". - [Process status (id)](https://docs.smartlane.ai/reference/getprocessstatusbyid-1.md): Returns the current status of an asynchroneous routing process. It can be used for polling the progress of a routes calculation. An initial process needs to be started beforehand via POST calcroute/optimized/timewindow or (for Excel uploads) POST /upload/{routingtype}. The returned process ID is used for identifying this process. The attribute {state} indicates if an optimization is still running ('PENDING'), successfully finished ('SUCCESS') or failed ('FAILURE'). - [Route](https://docs.smartlane.ai/reference/getroute-1.md): Returns all data for all planned routes from the system. - [Route (id)](https://docs.smartlane.ai/reference/getroutebyid-1.md): Returns a planned route. - [Route (id)](https://docs.smartlane.ai/reference/patchroutebyid-1.md): Edits the route information. Currently used for updating the `status`. Soon to be replaced by dedicated endpoints. - [Process history](https://docs.smartlane.ai/reference/getprocesshistory-1.md): Returns all processes (successful, pending, failed) and their process_id, start_time, progress and state. - [Cancel route](https://docs.smartlane.ai/reference/postcancelroute-1.md): Cancel unfinished route(s) because of an unplanned event (e.g. driver is no more available). The route will be moved to the route archive and all unfinished (not yet delivered an not yet canceled) deliveries will be returned to the active deliveries list (delivery status is set to 'none'). These deliveries are then available for re-routing in a new tour. The 'route_parameter' is either the ID of the route or 'bydate'. In case of 'bydate' the query parameters 'from' and 'to' are relevant and must be ISO time strings - [Set status (id)](https://docs.smartlane.ai/reference/postroutestatusbyid-1.md): Sets the status of the route with ID route_id and is a simpler alternative to PATCHing the status of the route. - [Route metadata](https://docs.smartlane.ai/reference/getroutemetadata-1.md): "Returns a reduced set of data (without route geometry) for planned routes from the system. Retrieves route objects with all fields except the following: routebase (only routebase address id), delivery details (only delivery ids), routestring." - [Route metadata (id)](https://docs.smartlane.ai/reference/getroutemetadatabyid-1.md): Returns a reduced set of data (without route geometry) for one planned route. This call retrieves route objects with all fields except the following: routebase (only routebase address id), delivery details (only delivery ids), routestring. - [Routing variants](https://docs.smartlane.ai/reference/postroutingvariants-1.md): Get all possible routing variants for a list of deliveries. - [Updateable routes](https://docs.smartlane.ai/reference/getupdateableroutes-1.md): Get updateable routes. - [Update etas timewindow (id)](https://docs.smartlane.ai/reference/getupdateetastimewindowbyid-1.md): "Calculates the estimated time of arrival for all active deliveries on one route with a given ID. Updates all estimated arrival times for all deliveries on a given route (which must be in the status 'ontheway'). The values are stored as 'eta_from' and 'eta_to' in the delivery tables of the database an can be retrieved via GET /delivery for each delivery. Calculation is done between the current position of a driver on the delivery's route and all deliveries each which must not be unassigned, (already) delivered or canceled. The current and predicted traffic situation are considered in this call. The relevant route and the referring driver are automatically derived from the given route. All already delivered or canceled deliveries must have set a correct status. Otherwise they will be falsely considered in this calculation." - [Update etas timewindow](https://docs.smartlane.ai/reference/getupdateetastimewindow-1.md): "Calculates the estimated time of arrival for all active deliveries on all active routes. Updates all estimated arrival times for all deliveries on all routes which are in the status 'ontheway'. The values are stored as 'eta_from' and 'eta_to' in the delivery tables of the database an can be retrieved via GET /delivery for each delivery. Calculation is done between the current position of a driver on each delivery's route and all deliveries each which must not be unassigned, (already) delivered or canceled. The current and predicted traffic situation are considered in this call. The relevant route and the referring driver are automatically derived from the given route. All already delivered or canceled assignments must have set a correct status. Otherwise they will be falsely considered in this calculation." - [Route status](https://docs.smartlane.ai/reference/getroutestatus-1.md): Get all possible status entries for routes. - [Vehicle type](https://docs.smartlane.ai/reference/getvehicletype-1.md): Get all possible vehicle type entries. - [Vehicles](https://docs.smartlane.ai/reference/getvehicle-1.md): Get all vehicles. - [Vehicle](https://docs.smartlane.ai/reference/postvehicle-1.md) - [Vehicle](https://docs.smartlane.ai/reference/patchvehicle-1.md) - [Vehicle (id)](https://docs.smartlane.ai/reference/getvehiclebyid-1.md): "" - [Delivery](https://docs.smartlane.ai/reference/getdelivery-1.md): Get data for all deliveries with all data available in the database. - [Delivery](https://docs.smartlane.ai/reference/deletedelivery-1.md): Delete all queried delivery objects. - [Delivery](https://docs.smartlane.ai/reference/patchdelivery-1.md): Edit any field of the delivery information. - [Delivery (id)](https://docs.smartlane.ai/reference/getdeliverybyid-1.md): Get data for one delivery object in the database via it's id. - [Delivery metadata](https://docs.smartlane.ai/reference/getdeliverymetadata-1.md): Get metadata for all deliveries. Similar to [get delivery](reference#getdelivery), reduced to the most relevant data. - [Delivery Number](https://docs.smartlane.ai/reference/getnrofdeliveries-1.md): Gets the number of deliveries according to filters. (Compare filter parameters to [get delivery](reference#getDeliverymetadata)). - [Multidelivery (id)](https://docs.smartlane.ai/reference/getmultideliverybyid-1.md): Get data for one multi_delivery_id from the database. - [Delivery type](https://docs.smartlane.ai/reference/getdeliverytype-1.md): Get all entries of delivery types from the database. - [Delivery type](https://docs.smartlane.ai/reference/postdeliverytype-1.md): Add a new delivery type. Delivery types allow users to classify deliveries, e.g. a "pickup" or "construction job". An important property of the delivery type is the estimated length of stay. - [Delivery type](https://docs.smartlane.ai/reference/patchdeliverytype-1.md): Edit any field of the delivery type information. - [Delivery status](https://docs.smartlane.ai/reference/getdeliverystatus-1.md): Get all possible status entries for deliveries. - [Delivery code](https://docs.smartlane.ai/reference/getdeliverycode-1.md): Get all possible status detail codes for deliveries. They offer a more detailed explanation (e.g. delivered to neighbor) to the status of a finished delivery (delivered or undelivered). - [Order up (id)](https://docs.smartlane.ai/reference/getorderupbyid-1.md): Allows manual re-ordering of deliveries via id by increasing the order index of this delivery by one. The delivery which had the order index plus one before will switch the order index with this one. - [Order down (id)](https://docs.smartlane.ai/reference/getorderdownbyid-1.md): Allows manual re-ordering of deliveries via id by decreasing the order index of this delivery by one. The delivery which had the order index minus one before will switch the order index with this one - [Delivery done (id)](https://docs.smartlane.ai/reference/postdeliverydonebyid-1.md): Automatically sets values of this finished delivery for status ('delivered' or 'undelivered'), actual delivery time and driver notes. - [Finished deliveries](https://docs.smartlane.ai/reference/getfinisheddeliveries-1.md): Returns a list of all finished ('delivered' or 'undelivered') deliveries filtered by time and status. - [Delivery beeline (id)](https://docs.smartlane.ai/reference/getdeliverybeelinebyid-1.md): Calculates the direct / beeline distance between a delivery location and its starting point (e.g. depot). - [Cancel delivery (id)](https://docs.smartlane.ai/reference/postcanceldeliverybyid-1.md): Cancels an unfinished (not yet delivered) delivery because of an unplanned event (e.g. customer cancels order). The delivery will be moved to the delivery archive and is not available anymore for routing - [Pickup and Delivery from two deliveries](https://docs.smartlane.ai/reference/postdeliverypickup-1.md): Connects two single deliveries so that one will be the pickup for the other (the actual delivery). A pickup will always be planned before a delivery in a tour planning process. Furthermore, a pickup decreases the vehicles capacity by the given load of this entry. - [/territories](https://docs.smartlane.ai/reference/get_territories_resource-1.md) - [/territories](https://docs.smartlane.ai/reference/post_territories_resource-1.md) - [/territories/{territory_id}](https://docs.smartlane.ai/reference/get_territories_id_resource-1.md) - [/territories/{territory_id}](https://docs.smartlane.ai/reference/delete_territories_id_resource-1.md) - [/territories/{territory_id}](https://docs.smartlane.ai/reference/patch_territories_id_resource-1.md) - [/territories/{territory_id}/postalcodes](https://docs.smartlane.ai/reference/post_territory_postal_codes_resource-1.md) - [/territories/{territory_id}/postalcodes](https://docs.smartlane.ai/reference/delete_territory_postal_codes_resource-1.md) - [/territories/{territory_id}/vehicles](https://docs.smartlane.ai/reference/post_territory_vehicles_resource-1.md) - [/territories/{territory_id}/secondary_vehicles](https://docs.smartlane.ai/reference/post_territory_vsecondary_ehicles_resource.md) - [/territories/{territory_id}/secondary_vehicles](https://docs.smartlane.ai/reference/delete_territory_vehicles_resource-1.md) - [/postalcodes](https://docs.smartlane.ai/reference/get_postal_code_resource-1.md) - [/postalcodes](https://docs.smartlane.ai/reference/post_postal_code_resource-1.md) - [/postalcodes/{postal_code_id}](https://docs.smartlane.ai/reference/delete_postal_code_id_resource-1.md) - [Company](https://docs.smartlane.ai/reference/getcompany-1.md): Returns the object data of the dispatcher's company. At the moment, there can be only one company in the database. However, for potential future extensions, the result of this call is a list containing one element: this one company. - [Company address](https://docs.smartlane.ai/reference/getcompanyaddress-1.md): Returns the address/locations of the company central. - [Dispatchers](https://docs.smartlane.ai/reference/getdispatcher-1.md): Gets data of all dispatcher users in the database. - [Dispatcher (id)](https://docs.smartlane.ai/reference/getdispatcherbyid-1.md): Gets data of a single dispatcher user with a given id of the database. Returns the address(es)/locations of the company centrals and depots. - [Adds an additional watcher user to the system](https://docs.smartlane.ai/reference/postaddwatcher-1.md): Adds an additional watcher user to the system. Watchers can view all parts of the interface but are unable to make changes. - [Adds an additional dispatcher to the system](https://docs.smartlane.ai/reference/postadddispatcher-1.md): Adds an additional dispatcher to the system after an initial one already exists. - [Address](https://docs.smartlane.ai/reference/getaddress-1.md): Get all addresses. - [Address](https://docs.smartlane.ai/reference/postaddress-1.md): Adds a new customer address to the address database. The new address can then be searched via /searchaddres. If no location (latitude/longitude) is given in the request, the address will automatically be geocoded and located on the map. - [Address](https://docs.smartlane.ai/reference/patchaddress-1.md): Edits an existing address. - [Address for location](https://docs.smartlane.ai/reference/getaddressforlocation-1.md): Retrieves an address for a given geo location via reverse geocoding. - [Search address](https://docs.smartlane.ai/reference/getsearchaddress-1.md): Address objects in the database can be searched by a full text search on the fields company, contactlastname and contactfirstname for a given query string. - [Dispatch logs](https://docs.smartlane.ai/reference/getdispatchlogs-1.md): Retrieve current dispatcher alerts and log messages, i.e. warnings and information about current deliveries, routes and drivers (e.g. successfully or failed deliveries, delayed drivers, traffic incidents on a route etc.) - [Dispatchlogs action](https://docs.smartlane.ai/reference/getdisptachlogsaction-1.md): Get dispatchlogs action summary. - [Dispatch logs action (id)](https://docs.smartlane.ai/reference/patchdisptachlogsactionbyid-1.md): Checks dispatch log API. - [Analyze](https://docs.smartlane.ai/reference/getanalyze-1.md): Delivery statistics. - [Analyze](https://docs.smartlane.ai/reference/getexcelreport-1.md): Returns an excel file containing details on each delivery which was planned and/or delivered on this day. - [Accounting](https://docs.smartlane.ai/reference/getaccounting-1.md): Retrieve information about current costs, current accounting period etc. - [User login](https://docs.smartlane.ai/reference/login.md): Logs user into the application. - [Current user](https://docs.smartlane.ai/reference/getcurrentuser-1.md): Gets information about the current logged in user. - [Reset pwd](https://docs.smartlane.ai/reference/postresetpwd-1.md): Sends an email with a link to reset the user password. - [Reset pwd (code)](https://docs.smartlane.ai/reference/postresetpwdcode-1.md): Resets the users password to a new one, using a verification code which was generated while sending an email to the user in the /resetpwd call. - [Signup dispatcher](https://docs.smartlane.ai/reference/postsignupdispatcher-1.md): Creates / updates a new dispatcher user in the system. There must already be a user predefined with this email address in the system. The first user initialization is done on request by Smartlane, e.g. via https://www.smartlane.de/registrieren - [Token expiry](https://docs.smartlane.ai/reference/posttokenexpiry-1.md): Gets the expiry time of the current user's token. It is automatically read out of the Authorization header. - [Refresh token](https://docs.smartlane.ai/reference/getrefreshtoken-1.md): Refreshes the user's current token by generating a new one which is valid from now. - [Connection check](https://docs.smartlane.ai/reference/getconnectioncheck-1.md): Checks if the server has internet connection. - [Analysis](https://docs.smartlane.ai/reference/getanalysisbyid-1.md): Returns data accumulated by the Smartlane BigData backend. - [Load Classes](https://docs.smartlane.ai/reference/getloadclass-1.md): Get all load classes - [Load Class](https://docs.smartlane.ai/reference/postloadclass-1.md) - [Load Class](https://docs.smartlane.ai/reference/patchloadclass-1.md) - [Load Class](https://docs.smartlane.ai/reference/deleteloadclass-1.md) ## Pages - [API Handling Extras](https://docs.smartlane.ai/page/api-handling-extras.md)