# Content | Create and update routes

### A) Create route

**Prerequisite**:

Routes must be contained within either a library or a guidebook. This example creates a new route within a library that has the internal ID `"MY_ROUTES_LIB"`. To create the route in a guidebook instead, replace the `"library"` object with a `"guidebook"` object.

* Replace <mark style="color:orange;">CCCCCC</mark> with your Account-ID, you can find this under Account Settings > General Settings > Account ID
* Replace <mark style="color:$primary;">MY\_ROUTES\_LIB</mark> with the Custom ID you have set for the&#x20;
* Replace <mark style="color:orange;">xxxxxx-xxxxxx-xxxxxx-xxxxxx</mark> with the API key, you can find this under Account Settings > General Settings > API Key

```json
curl --location --request POST 'https://services.schneidergeo.com/content/geodata/route' 
--header 'Authorization: xxxxxx-xxxxxx-xxxxxx-xxxxxx' \
--header 'Content-Type: text/plain;charset=UTF-8' \
--data-raw '{
    "account":"CCCCCC",
    "library": {
        "customId":"MY_ROUTES_LIB"
    },
    "customId":"CYCLE_23143534",
    "remark":"This is a test route",
    "names": {
        "en": "Testroute in Arnhem",
        "de": ""
    },
    "descriptions": {
        "en": "",
        "de": ""
    },
    "color": "1c21e1",
    "icon": {
            "name": "hiking"
    },
    "waypoints": [
        {
            "lat": 51.96252,
            "lon": 5.88772,
            "ele": 13
        },
        {
            "lat": 51.96253,
            "lon": 5.88772,
            "ele": 13
        },
        {
            "lat": 51.9628,
            "lon": 5.88796,
            "ele": 13
        },
        {
            "lat": 51.96359,
            "lon": 5.88833,
            "ele": 14
        },
        {
            "lat": 51.96438,
            "lon": 5.88871,
            "ele": 11
        },
        {
            "lat": 51.96495,
            "lon": 5.88885,
            "ele": 9
        },
        {
            "lat": 51.96552,
            "lon": 5.889,
            "ele": 9
        }
        
    ]
}'
```

### Supported Icon Names for routes:

* Motorbike
* Sledding
* Ski touring
* Hiking
* Cycling
* Ferry route
* Bus tour
* Canoeing
* Mountaineering
* Snowshoeing
* Cross-country skiing
* Running
* Driving
* Transfer
* Walking
* Segment
* E-bike
* Nordic walking
* Mountain biking

### B) Update route

This example updates the route with internal ID "<mark style="color:orange;">rrrrrr</mark>" .

* Replace <mark style="color:orange;">rrrrrr</mark> with the route ID, you can find it in the Edit Route > Identifiers section.&#x20;
* Replace <mark style="color:orange;">xxxxxx-xxxxxx-xxxxxx-xxxxxx</mark> with the API key, you can find this in Account Settings > General Settings > API Key

```json
curl --location --request PUT 'https://services.schneidergeo.com/content/geodata/route/rrrrrr' \
--header 'Authorization: xxxxxx-xxxxxx-xxxxxx-xxxxxx' \
--header 'Content-Type: text/plain;charset=UTF-8' \
--data-raw '{
    "account":"DpRPNF",
    "library": {
        "customId":"RWR_ROUTES"
    },
    "customId": "CYCLE_23143534",
    "remark":"This is a test route",
    "names": {
        "en": "Testroute in Arnhem",
        "de": ""
    },
    "descriptions": {
        "en": "",
        "de": ""
    },
    "color": "1c21e1",
    "icon": {
            "name": "hiking"
    },
    "waypoints": [
        {
            "lat": 51.96252,
            "lon": 5.88772,
            "ele": 13
        },
        {
            "lat": 51.96253,
            "lon": 5.88772,
            "ele": 13
        },
        {
            "lat": 51.9628,
            "lon": 5.88796,
            "ele": 13
        },
        {
            "lat": 51.96359,
            "lon": 5.88833,
            "ele": 14
        },
        {
            "lat": 51.96438,
            "lon": 5.88871,
            "ele": 11
        },
        {
            "lat": 51.96495,
            "lon": 5.88885,
            "ele": 9
        },
        {
            "lat": 51.96552,
            "lon": 5.889,
            "ele": 9
        }
        
    ]
}'
```
