# Facility Network Map

<figure><img src="https://2315646207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTWLd9L6wPqgOLglGkVHP%2Fuploads%2F2nAA9mVJMWy5VE4wZAkQ%2FScreenshot%202025-11-12%20at%2010.19.46%E2%80%AFAM.png?alt=media&#x26;token=1af70f24-ecd5-41ee-93fc-89d208e392a4" alt=""><figcaption></figcaption></figure>

### **Authentication**

Include the following headers in your requests:

* **Access-Token**: The access token obtained from the "Create Access Token" endpoint.
* **x-api-key:** The API key provided by GenLogs. This header must be included in the request.

### Permissions

Make sure that your api user is created with a role that has `external-api-shipper-network-map` permission

### **Endpoint**

* **URL**: `https://api.genlogs.io/facility/<facility_id>/network-map`
* **Method**: `GET`

### **Response**

* **200 OK**: Returns the facility network map in GeoJSON format. The payload is normalized as a FeatureCollection.
* **400 Bad Request**: If required parameters are missing or invalid.
* **401 Unauthorized**: If the `Access-Token` or `x-api-key` is missing or invalid.
* **403 Forbidden**: If the user is not allowed to access this endpoint.
* **500 Internal Server Error**: If an error occurs on the server while processing the request.

### **Response Body**

When the request succeeds, the endpoint returns a GeoJSON `FeatureCollection` whose structure follows `FacilityNetworkMapSchema`:

* `type`: Always `FeatureCollection`.
* `features`: Array of GeoJSON `Feature` objects.
* Each feature has:
  * `geometry`: standard GeoJSON geometry (point, line, polygon) with coordinates relative to the facility.
  * `properties`: metadata about the lane (analysis window, history window, etc.).

### **Request example**

```
curl --location 'https://api.genlogs.io/facility/0x4Y4CTmYr6kauPugLT9k4zg/network-map' \
--header 'Content-Type: application/json' \
--header 'access-token: <access-token>' \
--header 'x-api-key: <x-api-key>'
```

## Retrieve the GeoJSON network map for a facility

> Returns the GeoJSON network map associated with the specified facility.

```json
{"openapi":"3.0.2","info":{"title":"Shipper API - Facility Network Map","version":"1.0.0"},"tags":[{"name":"Facilities","description":"Returns the facility network map in GeoJSON format"}],"servers":[{"url":"https://api.genlogs.io"}],"paths":{"/facility/{facility_id}/network-map":{"get":{"summary":"Retrieve the GeoJSON network map for a facility","description":"Returns the GeoJSON network map associated with the specified facility.","operationId":"getFacilityNetworkMap","tags":["Facilities"],"parameters":[{"name":"facility_id","in":"path","required":true,"schema":{"type":"string"},"description":"Trimble identifier for the facility."}],"responses":{"200":{"description":"Facility GeoJSON network map (FeatureCollection)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacilityNetworkMap"}}}},"401":{"description":"Missing or invalid token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthError"}}}},"403":{"description":"Token expired or user lacks the required role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthError"}}}},"500":{"description":"Unexpected error while fetching or parsing GeoJSON.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}},"components":{"schemas":{"FacilityNetworkMap":{"type":"object","required":["type","features"],"properties":{"type":{"type":"string"},"features":{"type":"array","items":{"$ref":"#/components/schemas/FacilityNetworkFeature"}}}},"FacilityNetworkFeature":{"type":"object","required":["type","geometry","properties"],"properties":{"type":{"type":"string"},"geometry":{"$ref":"#/components/schemas/GeoJSONGeometry"},"properties":{"type":"object","additionalProperties":true,"description":"Arbitrary metadata associated with the feature."}}},"GeoJSONGeometry":{"type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"]},"coordinates":{"type":"array","items":{},"description":"GeoJSON coordinate array whose structure depends on geometry type."}}},"AuthError":{"type":"object","properties":{"message":{"type":"string"},"subcode":{"type":"integer","description":"Optional subcode with additional error context."}}}}}}
```
