---
title: Routes
description: This page provides detailed information about Scaleway IoT Hub Routes.
excerpt: |
  This page provides detailed information about Scaleway IoT Hub Routes.
totalTime: PT5M
tags: iot iot-hub route amazon-s3 database postgres postgresql mysql rest api inference
dates:
  validation: 2025-05-21
  posted: 2021-08-31
---

## Overview

IoT Routes interconnect your Hub with services that are not publish/subscribe compatible.

Routes subscribe to topics in your Hub and forward the messages' payloads to other services, automating the process.

You can [create](/iot-hub/how-to/create-route/) and [delete](/iot-hub/how-to/delete-route/) Routes in the **Routes** tab of your Hub in the console. All Routes require a name and a topic to subscribe to. Other settings are specific to the kind of Route you choose.

<Message type="tip">
  You can use wildcards as Routes topics.
</Message>

<Message type="important">
  If your route subscribes to Hub events, routes will drop events they generated themselves in order to avoid message loops. However, you need to make sure messages do not loop between different routes.
</Message>

## REST Route

REST Routes forward your messages to any RESTful API over HTTP or HTTPS.

You can choose the HTTP verb, the API endpoint and HTTP additional headers to be sent. The route will call the API for each received message.

The HTTP headers will contain the verb you configured as well as the message's topic (`X-MQTT-Topic`) and `X-MQTT-Retain` which can be `true` or `false`, depending on whether the message's retain flag is set or not.

The HTTP request body will contain the message's payload.

## Database Route

Database Routes forward your messages to a database. PostgreSQL and MySQL are currently supported.

You can choose the connection settings and write an SQL query. This query will be executed against the database each time a message is received. The query can contain two variables:

- `$TOPIC`: the topic of the received message
- `$PAYLOAD`: the payload of the received message

<Message type="note">
  The `$TOPIC` and `$PAYLOAD` variables cannot be written inside quotes nor can their contents be escaped. They are parameters to the prepared query, not substituted in the query string.
</Message>

## Object Storage Route

Object Storage Routes forward your messages to a [Scaleway Object Storage](/object-storage/quickstart/) bucket.

You can choose the bucket you want to write to, a path prefix, and one of the two following strategies:

- **Per topic**: where one topic received equals one object in your bucket. The following messages with the same topic will overwrite previously written objects.
- **Per message**: where one message received equals one object in your bucket

Depending on the strategy the message payload will be written:

- **Per topic**: s3://`my-bucket`/`my/prefix`/`my/topic`
- **Per message**: s3://`my-bucket`/`my/prefix`/`my/topic`/`timestamp`

Timestamp example:

```
2006-01-02T15:04:05.999999999Z
```

## Limits and quotas

| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Quotas | Limits |
|:----------------------------------------|:------:|:------:|
| Maximum number of Routes per Hub - Shared plan    | 100 |  |
| Maximum number of Routes per Hub - Dedicated plan | 100 |  |
| Maximum number of Routes per Hub - HA plan        | 100 |  |


