---
title: Route API - Notehub API Reference
description: The Notehub route API provides RESTful methods that can be used to GET, POST, PUT, and DELETE Notehub routes.
source_url: https://dev.blues.io/api-reference/notehub-api/route-api/
canonical_url: https://dev.blues.io/api-reference/notehub-api/route-api/
markdown_url: https://dev.blues.io/api-reference/notehub-api/route-api.md
---

# Route API

The Notehub route API provides RESTful methods that can be used to `GET`, `PUT`, `POST`, and `DELETE` [Notehub routes](https://dev.blues.io/notehub/notehub-walkthrough.md#routing-data-with-notehub).

| Name                              | HTTP Request                                                              |
| --------------------------------- | ------------------------------------------------------------------------- |
| [Get Routes](#get-routes)         | **GET** `/v1/projects/{projectOrProductUID}/routes`                       |
| [Get Route](#get-route)           | **GET** `/v1/projects/{projectOrProductUID}/routes/{routeUID}`            |
| [Get Route Logs](#get-route-logs) | **GET** `/v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs` |
| [Create Route](#create-route)     | **POST** `/v1/projects/{projectOrProductUID}/routes`                      |
| [Delete Route](#delete-route)     | **DELETE** `/v1/projects/{projectOrProductUID}/routes/{routeUID}`         |
| [Update Route](#update-route)     | **PUT** `/v1/projects/{projectOrProductUID}/routes/{routeUID}`            |

## Get Routes (Notehub)

Get an array of [routes](https://dev.blues.io/api-reference/glossary.md#route) associated with a Notehub [project](https://dev.blues.io/api-reference/glossary.md#project).

|                                                                                                               |                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| HTTP Method:                                                                                                  | `GET`                                                                                                                                                                                                  |
| URL:                                                                                                          | `https://api.notefile.net/v1/projects/{projectOrProductUID}/routes`                                                                                                                                    |
| Path Parameters:                                                                                              | - `projectOrProductUID` - The [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) or [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) of a Notehub project. |
| Minimum Notehub [project-level role:](https://dev.blues.io/notehub/notehub-walkthrough.md#collaborator-roles) | viewer                                                                                                                                                                                                 |
| Required HTTP Headers:                                                                                        | `Authorization: Bearer <token>`, where the token is a valid [authentication token](https://dev.blues.io/api-reference/notehub-api.md#authentication).                                                  |

Arguments

None

**Example**

**Bash**

```bash
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes'
    -H 'Authorization: Bearer <access_token>'
```

**JS**

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getRoutes(projectUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

**Python**

```python
import notehub_py
from notehub_py.models.notehub_route_summary import NotehubRouteSummary
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure Bearer authorization: personalAccessToken
configuration = notehub_py.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_routes(project_or_product_uid)
        print("The response of RouteApi->get_routes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->get_routes: %s\n" % e)
```

**Response Members**

### `uid`

*string*

The globally-unique identifier of the route.

### `label`

*string*

The name of the route.

### `type`

*string*

The service to which this route connects (see [Create Route](https://dev.blues.io/api-reference/notehub-api/route-api.md#create-route) for a full list of route types).

### `modified`

*string*

The date and time this route was last modified.

### `disabled`

*boolean*

Whether or not this route is disabled.

Example Response

```json
[
  {
    "uid": "route:0ac565deb7b478a250bb82347b9cfdd2",
    "label": "My HTTP Route",
    "type": "http",
    "modified": "2020-03-09T17:58:36Z",
    "disabled": false
  },
  {
    "uid": "route:fb1b9e0aba1bf030311ba2c3c1e7efd1",
    "label": "My Proxy Route",
    "type": "proxy",
    "modified": "2020-03-09T17:58:35Z",
    "disabled": false
  }
]
```

## Get Route (Notehub)

Get a single [route](https://dev.blues.io/api-reference/glossary.md#route) by its [RouteUID](https://dev.blues.io/api-reference/glossary.md#routeuid).

|                                                                                                               |                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HTTP Method:                                                                                                  | `GET`                                                                                                                                                                                                                                                                                                                       |
| URL:                                                                                                          | `https://api.notefile.net/v1/projects/{projectOrProductUID}/routes/{routeUID}`                                                                                                                                                                                                                                              |
| Path Parameters:                                                                                              | - `projectOrProductUID` - The [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) or [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) of a Notehub project.
- `routeUID` - The [RouteUID](https://dev.blues.io/api-reference/glossary.md#routeuid) of an existing Notehub route. |
| Minimum Notehub [project-level role:](https://dev.blues.io/notehub/notehub-walkthrough.md#collaborator-roles) | viewer                                                                                                                                                                                                                                                                                                                      |
| Required HTTP Headers:                                                                                        | `Authorization: Bearer <token>`, where the token is a valid [authentication token](https://dev.blues.io/api-reference/notehub-api.md#authentication).                                                                                                                                                                       |

Arguments

None

**Example**

**Bash**

```bash
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes/<routeUID>'
    -H 'Authorization: Bearer <access_token>'
```

**JS**

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.getRoute(projectOrProductUID, routeUID).then((data) => {
  console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
  console.error(error);
});
```

**Python**

```python
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure Bearer authorization: personalAccessToken
configuration = notehub_py.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 

    try:
        api_response = api_instance.get_route(project_or_product_uid, route_uid)
        print("The response of RouteApi->get_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->get_route: %s\n" % e)
```

**Response Members**

### `uid`

*string*

The globally-unique identifier of the route.

### `label`

*string*

The name of the route.

### `type`

*string*

The service to which this route connects (see above for a full list of route types).

### `modified`

*string*

The date and time this route was last modified.

### `disabled`

*boolean*

Whether or not this route is disabled.

### `schema`

*object*

Additional meta data specific to the type of route (see request members from [Create Route](https://dev.blues.io/api-reference/notehub-api/route-api.md#create-route) for a complete list).

Example Response

```json
{
  "uid": "route:0ac565deb7b478a250bb82347b9cfdd2",
  "label": "My HTTP Route",
  "type": "http",
  "modified": "2020-03-09T17:58:36Z",
  "disabled": false,
  "http": {
    "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
    "filter": {
      "type": "",
      "system_notefiles": false
    },
    "transform": {},
    "throttle_ms": 100,
    "url": "http://route.url",
    "http_headers": null,
    "disable_http_headers": false,
    "timeout": 0
  }
}
```

## Get Route Logs (Notehub)

Get an array of route logs associated with a Notehub [project](https://dev.blues.io/api-reference/glossary.md#project).

|                                                                                                               |                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HTTP Method:                                                                                                  | `GET`                                                                                                                                                                                                                                                                                                                       |
| URL:                                                                                                          | `https://api.notefile.net/v1/projects/<projectOrProductUID>/routes/<routeUID>/route-logs`                                                                                                                                                                                                                                   |
| Path Parameters:                                                                                              | - `projectOrProductUID` - The [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) or [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) of a Notehub project.
- `routeUID` - The [RouteUID](https://dev.blues.io/api-reference/glossary.md#routeuid) of an existing Notehub route. |
| Minimum Notehub [project-level role:](https://dev.blues.io/notehub/notehub-walkthrough.md#collaborator-roles) | viewer                                                                                                                                                                                                                                                                                                                      |
| Required HTTP Headers:                                                                                        | `Authorization: Bearer <token>`, where the token is a valid [authentication token](https://dev.blues.io/api-reference/notehub-api.md#authentication).                                                                                                                                                                       |

Arguments

### `pageSize`

*integer (optional)*

Specifies the number of events to be returned by a request (default 50).

### `pageNum`

*integer (optional)*

Specifies the page number of the results returned (useful when the `pageSize` is less than the total number of sessions that could be returned).

### `deviceUID`

*string (optional)*

The DeviceUID of a Notehub [device](https://dev.blues.io/api-reference/glossary.md#device).

You may alternatively provide a device serial number by prefixing this argument with `sn:`, for example `sn:my-device`.

### `sortBy`

*string (optional)*

Specifies a field in the result set to sort by, and must be one of the following: `date` or `event`.

### `sortOrder`

*string (optional)*

Specifies the ascending (`asc`) or descending (`desc`) order of the result set when paired with `sortBy`. The default is `desc`.

### `startDate`

*UNIX Epoch time (optional)*

Start date for filtering results, specified as a Unix timestamp.

### `endDate`

*UNIX Epoch time (optional)*

End date for filtering results, specified as a Unix timestamp.

### `systemFilesOnly`

*boolean (optional)*

If `true`, will only return [System Notefiles](https://dev.blues.io/api-reference/system-notefiles.md) in the response.

### `mostRecentOnly`

*boolean (optional)*

An event can be sent though a route multiple times via [manual rerouting](https://dev.blues.io/notehub/notehub-walkthrough.md#manually-routing-events) or [automatic retries](https://dev.blues.io/notehub/notehub-walkthrough.md#automatic-retry-of-failed-route).

Be default, the request returns all routing attempts. If you only wish to see the most recent routing attempt per event, set `mostRecentOnly` to `true`.

### `files`

*string (optional)*

A comma-delimited list of Notefile(s) this request should return events from. For example, setting this argument to `track.qo,sensor.qo` would return events only from the `track.qo` and `sensor.qo` Notefiles.

**Basic**

**Bash**

```bash
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes/<routeUID>/route-logs'
    -H 'Authorization: Bearer <access_token>'
```

**JS**

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  sortBy: "date", // String |
  sortOrder: "desc", // String |
  startDate: 1628631763, // Number | Unix timestamp
  endDate: 1657894210, // Number | Unix timestamp
  systemFilesOnly: true, // Boolean |
  mostRecentOnly: false, // Boolean |
  files: "_health.qo, data.qo" // String |
};
apiInstance.getRouteLogsByRoute(projectOrProductUID, routeUID, opts).then((data) => {
  console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
  console.error(error);
});
```

**Python**

```python
import notehub_py
from notehub_py.models.route_log import RouteLog
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure Bearer authorization: personalAccessToken
configuration = notehub_py.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    sort_by = "date" # str |  (optional) (default to "date")
    sort_order = "desc" # str |  (optional) (default to "desc")
    start_date = 1628631763 # int | Unix timestamp (optional)
    end_date = 1657894210 # int | Unix timestamp (optional)
    system_files_only = True # bool |  (optional)
    most_recent_only = True # bool |  (optional)  # Optional parameter to get only the most recent event for each Notefile
    files = "_health.qo, data.qo" # str |  (optional)

    try:
        api_response = api_instance.get_route_logs_by_route(project_or_product_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, most_recent_only=most_recent_only, files=files)
        print("The response of RouteApi->get_route_logs_by_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->get_route_logs_by_route: %s\n" % e)
```

**Optional Params**

**Bash**

```bash
curl -X GET
     -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes/<routeUID>/route-logs?pageSize=<pageSize>&pageNum=<pageNum>&deviceUID=<deviceUID>&sortBy=<sortBy>&sortOrder=<sortOrder>&startDate=<startDate>&endDate=<endDate>&systemFilesOnly=<systemFilesOnly>&mostRecentOnly=<mostRecentOnly>&files=<files>'
     -H 'Authorization: Bearer <access_token>'
```

**Response Members**

### `date`

*string*

The date/time stamp of the log entry.

### `routeUID`

*string*

The globally-unique identifier of the route.

### `eventUID`

*string*

The globally-unique identifier of the event.

### `attn`

*boolean*

If `true`, an error was returned when routing.

### `status`

*string*

The HTTP status code returned by the route's destination.

### `text`

*string*

The response body of the route.

### `url`

*string*

The URL of the route.

### `duration`

*integer*

The time in milliseconds the route took to process.

Example Response

```json
[
  {
      "date": "2023-05-06T05:40:51.80559Z",
      "routeUID": "app:4be5d3ac-998a-44f0-8ecd-6bd716858b3d/route:d632e16fc956162ae3db4f20ddacc2b8",
      "eventUID": "5ee2e385-e282-476e-afec-327498fe91a3",
      "attn": false,
      "status": "200",
      "text": "thanks",
      "url": "https://example.com/route"
  },
  {
      "date": "2023-05-06T05:40:51.318522Z",
      "routeUID": "app:4be5d3ac-998a-44f0-8ecd-6bd716858b3d/route:d632e16fc956162ae3db4f20ddacc2b8",
      "eventUID": "4fb2c905-080a-40c5-96f7-d8193fa18116",
      "attn": false,
      "status": "200",
      "text": "thanks",
      "url": "https://example.com/route"
  }
]
```

## Create Route (Notehub)

Create a new [route](https://dev.blues.io/api-reference/glossary.md#route) within a Notehub [project](https://dev.blues.io/api-reference/glossary.md#project).

|                                                                                                               |                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| HTTP Method:                                                                                                  | `POST`                                                                                                                                                                                                 |
| URL:                                                                                                          | `https://api.notefile.net/v1/projects/{projectOrProductUID}/routes`                                                                                                                                    |
| Path Parameters:                                                                                              | - `projectOrProductUID` - The [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) or [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) of a Notehub project. |
| Minimum Notehub [project-level role:](https://dev.blues.io/notehub/notehub-walkthrough.md#collaborator-roles) | developer                                                                                                                                                                                              |
| Required HTTP Headers:                                                                                        | `Authorization: Bearer <token>`, where the token is a valid [authentication token](https://dev.blues.io/api-reference/notehub-api.md#authentication).                                                  |

Arguments

### `label`

*string*

The name of the route.

### `disabled`

*boolean*

Whether or not this route is disabled.

### `notes`

*string (optional)*

Optional free-form text for annotating the route. Limited to 1024 characters.

### `type`

*string*

The specific service to which this route connects.

Must be one of: `"aws-iot-analytics"`, `"aws-lambda"`, `"aws-lambda-with-access-key"`, `"aws-sqs"`, `"aws-sqs-fifo"`, `"aws-sqs-fifo-with-access-key"`, `"aws-sqs-with-access-key"`, `"azure-function"`, `"azure-function-with-key"`, `"azure-service-bus-with-sas-token"`, `"blynk"`, `"datacake"`, `"google-function"`, `"http"`, `"mqtt"`, `"proxy"`, `"qubitro"`, `"radnote-radresp-fixed-survey"`, `"radnote-radresp-mobile-survey"`, `"slack-bearer"`, `"slack-webhook"`, `"snowflake"`, `"thingworx"`, `"twilio"`.

### `schema`

*string*

Name of the high-level route schema, used to supply settings specific to the chosen `type` above. This will be an object that includes route-specific configuration. For example, to specify the URL of an HTTPS route you would provide `{"http":{"url":"https://my-site.com"}}`.

Must be one of: `"aws"`, `"azure"`, `"blynk"`, `"datacake"`, `"google"`, `"http"`, `"mqtt"`, `"proxy"`, `"qubitro"`, `"radresponder"`, `"slack"`, `"snowflake"`, `"thingworx"`, `"twilio"`.

### `<schema>.fleets`

*string*

An array of fleetUIDs to which to apply the route. If empty, applies to all fleets.

### `<schema>.filter`

*object*

Route filtering settings; see below:

### `<schema>.filter.type`

*string*

Which Notefiles this route applies to. Must be one of: `"all"`, `"include"`, `"exclude"`.

### `<schema>.filter` `.system` `_notefiles`

*boolean*

Whether or not system Notefiles should be routed.

### `<schema>.filter.files`

*string*

An array of Notefile names to include in the filter. For example, if `include` is the `type`, these are the only Notefiles that will be included.

### `<schema>.transform`

*object*

Data transformation settings; see below:

### `<schema>.transform` `.format`

*string*

The data transformation to apply.

Must be one of: `"bridge"` (Azure only), `"jsonata"`, `"flatten"`, `"simple"`, `"body"`, `"payload"`.

### `<schema>.transform` `.jsonata`

*string*

If `jsonata` format, the JSONata expression used to transform the outgoing data payload.

### `<schema>.transform` `.jsonataIn`

*string*

If `jsonata` format, the JSONata expression used to transform inbound data payloads.

### `<schema>.throttle_ms`

*integer*

Minimum time between requests, in milliseconds.

### `<schema>.url`

*string*

The external service endpoint URL.

### `<schema>.http_headers`

*object*

Key:value pairs of HTTP headers. Both the key and value are strings.

### `<schema>.disable` `_http` `_headers`

*boolean*

Whether or not the HTTP header values should be disabled.

### `<schema>.timeout`

*integer*

Timeout in seconds for each request.

**Example**

**Bash**

```bash
curl -X POST
    -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes'
    -H 'Authorization: Bearer <access_token>'
    -d '{
            "label":"<label>",
            "type":"<type>",
            "<schema>":{
              "url":"<url>",
              "fleets": ["<fleetUID>"],
              "filter": {
                "type": "all",
                "system_notefiles": false
              }
            }
        }'
```

**JS**

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let notehubRoute = {
  "http": {
    "disable_http_headers": false,
    "filter": {},
    "fleets": [
      "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"
    ],
    "http_headers": {
      "X-My-Header": "value"
    },
    "throttle_ms": 100,
    "timeout": 5000,
    "transform": {},
    "url": "https://example.com/ingest"
  },
  "label": "Route Label"
} // NotehubRoute | Route to be Created
apiInstance.createRoute(projectOrProductUID, notehubRoute).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

**Python**

```python
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure Bearer authorization: personalAccessToken
configuration = notehub_py.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    notehub_route = {
      "http": {
        "disable_http_headers": false,
        "filter": {},
        "fleets": [
          "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"
        ],
        "http_headers": {
          "X-My-Header": "value"
        },
        "throttle_ms": 100,
        "timeout": 5000,
        "transform": {},
        "url": "https://example.com/ingest"
      },
      "label": "Route Label"
    }
    # NotehubRoute | Route to be Created
    try:
        api_response = api_instance.create_route(project_or_product_uid, notehub_route)
        print("The response of RouteApi->create_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->create_route: %s\n" % e)
```

**Response Members**

### `uid`

*string*

The globally-unique identifier of the route.

### `label`

*string*

The name of the route.

### `type`

*string*

The service to which this route connects (see above for a full list of route types).

### `modified`

*string*

The date and time this route was last modified.

### `disabled`

*boolean*

Whether or not this route is disabled.

### `schema`

*object*

Additional meta data specific to the type of route (see available arguments above for a complete list).

Example Response

```json
{
  "uid": "route:0ac565deb7b478a250bb82347b9cfdd2",
  "label": "My HTTP Route",
  "type": "http",
  "modified": "2020-03-09T17:58:36Z",
  "disabled": false,
  "http": {
    "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
    "filter": {
      "type": "",
      "system_notefiles": false
    },
    "transform": {},
    "throttle_ms": 100,
    "url": "http://route.url",
    "http_headers": null,
    "disable_http_headers": false,
    "timeout": 0
  }
}
```

## Delete Route (Notehub)

Delete a single [route](https://dev.blues.io/api-reference/glossary.md#route) by its [RouteUID](https://dev.blues.io/api-reference/glossary.md#routeuid).

|                                                                                                               |                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| HTTP Method:                                                                                                  | `DELETE`                                                                                                                                                                                               |
| URL:                                                                                                          | `https://api.notefile.net/v1/projects/{projectOrProductUID}/routes/{routeUID}`                                                                                                                         |
| Path Parameters:                                                                                              | - `projectOrProductUID` - The [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) or [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) of a Notehub project. |
| Minimum Notehub [project-level role:](https://dev.blues.io/notehub/notehub-walkthrough.md#collaborator-roles) | developer                                                                                                                                                                                              |
| Required HTTP Headers:                                                                                        | `Authorization: Bearer <token>`, where the token is a valid [authentication token](https://dev.blues.io/api-reference/notehub-api.md#authentication).                                                  |

Arguments

### `access_token`

**Example**

**Bash**

```bash
curl -X DELETE
     -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes/<routeUID>'
     -H 'Authorization: Bearer <access_token>'
```

**JS**

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.deleteRoute(projectOrProductUID, routeUID).then((data) => {
  console.log("API called successfully";
}, (error) => {
  console.error(error);
});
```

**Python**

```python
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure Bearer authorization: personalAccessToken
configuration = notehub_py.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 

    try:
        api_response = api_instance.delete_route(project_or_product_uid, route_uid)
    except Exception as e:
        print("Exception when calling RouteApi->delete_route: %s\n" % e)
```

## Update Route (Notehub)

Update a [route](https://dev.blues.io/api-reference/glossary.md#route) by its [RouteUID](https://dev.blues.io/api-reference/glossary.md#routeuid).

|                                                                                                               |                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HTTP Method:                                                                                                  | `PUT`                                                                                                                                                                                                                                                                                                                       |
| URL:                                                                                                          | `https://api.notefile.net/v1/projects/{projectOrProductUID}/routes/{routeUID}`                                                                                                                                                                                                                                              |
| Path Parameters:                                                                                              | - `projectOrProductUID` - The [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) or [ProductUID](https://dev.blues.io/api-reference/glossary.md#productuid) of a Notehub project.
- `routeUID` - The [RouteUID](https://dev.blues.io/api-reference/glossary.md#routeuid) of an existing Notehub route. |
| Minimum Notehub [project-level role:](https://dev.blues.io/notehub/notehub-walkthrough.md#collaborator-roles) | developer                                                                                                                                                                                                                                                                                                                   |
| Required HTTP Headers:                                                                                        | `Authorization: Bearer <token>`, where the token is a valid [authentication token](https://dev.blues.io/api-reference/notehub-api.md#authentication).                                                                                                                                                                       |

Arguments

### `object`

*object*

Additional meta data specific to the type of route.

Look up the specific argument list for your specified route in the [Create Route](https://dev.blues.io/api-reference/notehub-api/route-api.md#create-route) documentation.

**Example**

**Bash**

```bash
curl -X PUT
    -L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/routes/<routeUID>'
    -H 'Authorization: Bearer <access_token>'
    -d '{
            "label":"<label>",
            "type":"<type>",
            "<schema>":{
              "url":"<url>"
            }
        }'
```

**JS**

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let notehubRoute = {
  http: {
    filter: { 
      type: "include",
      system_notefiles: true,
      files: ["somefile.qo"]
    },
    throttle_ms: 50,
    url: "http://new-route.url",
  },
}; // NotehubRoute | Route settings to be updated
apiInstance.updateRoute(projectOrProductUID, routeUID, notehubRoute).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

**Python**

```python
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure Bearer authorization: personalAccessToken
configuration = notehub_py.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 
    notehub_route = {
        "http": {
            "filter": {
            "type": "include",
            "system_notefiles": true,
            "files": ["somefile.qo"],
            },
            "throttle_ms": 50,
            "url": "http://new-route.url",
        },
    }
    # NotehubRoute | Route settings to be updated
    try:
        api_response = api_instance.update_route(project_or_product_uid, route_uid, notehub_route)
        print("The response of RouteApi->update_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->update_route: %s\n" % e)
```

**Response Members**

### `uid`

*string*

The globally-unique identifier of the route.

### `label`

*string*

The name of the route.

### `type`

*string*

The service to which this route connects (see above for a full list of route types).

### `modified`

*string*

The date and time this route was last modified.

### `disabled`

*boolean*

Whether or not this route is disabled.

### `schema`

*object*

Additional meta data specific to the type of route (see request members from [Create Route](https://dev.blues.io/api-reference/notehub-api/route-api.md#create-route) for a complete list).

Example Response

```json
{
  "uid": "route:0ac565deb7b478a250bb82347b9cfdd2",
  "label": "My HTTP Route",
  "type": "http",
  "modified": "2020-03-09T17:58:36Z",
  "disabled": false,
  "http": {
    "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
    "filter": {
      "type": "",
      "system_notefiles": false
    },
    "transform": {},
    "throttle_ms": 100,
    "url": "http://route.url",
    "http_headers": null,
    "disable_http_headers": false,
    "timeout": 0
  }
}
```

[Project API](https://dev.blues.io/api-reference/notehub-api/project-api.md "Project API") [Usage API](https://dev.blues.io/api-reference/notehub-api/usage-api.md "Usage API")
