---
title: hub Requests - API Reference
description: The hub set of requests provide a variety of ways for a developer to configure and monitor the connection between the Notecard and Notehub.
source_url: https://dev.blues.io/api-reference/notecard-api/hub-requests/
canonical_url: https://dev.blues.io/api-reference/notecard-api/hub-requests/
markdown_url: https://dev.blues.io/api-reference/notecard-api/hub-requests.md
---

# hub Requests

The `hub` set of requests provide a variety of ways for a developer to configure and monitor the connection between the Notecard and Notehub.

## hub.get

Supported on

(Cell, Cell+WiFi, LoRa, Skylo, WiFi)

Retrieves the current Notehub configuration for the Notecard.

Arguments

None

**Example**

**JSON**

```json
{
  "req": "hub.get"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.get");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.get"}
rsp = card.Transaction(req)
```

Retrieve the current Notehub configuration for the Notecard.

**Response Members**

### `device`

*string*

The [DeviceUID](https://dev.blues.io/api-reference/glossary.md#deviceuid) for the Notecard.

### `host`

*string*

The URL of the Notehub host.

### `inbound`

*integer*

The max wait time, in minutes, to sync inbound data from Notehub.

### `mode`

*string*

The current operating `mode` of the Notecard, as defined in `hub.set`.

`"periodic"`: Periodically connect to the Notehub. This is the default value set on each Notecard after a factory reset.

`"continuous"`: Enables an always-on network connection, for high power devices. Outbound data still syncs periodically, unless specified in a Note or File request.

`"minimum"`: Disables periodic connection. The Notecard will not sync until it receives an explicit `hub.sync` request. OTA DFU updates are not available when using this mode.

`"off"`: Disables automatic and manual syncs. `hub.sync` requests will be ignored in this mode. OTA DFU updates are not available when using this mode.

`"dfu"`: Puts the Notecard in DFU mode for IAP host MCU firmware updates. This mode is effectively the same as `off` in terms of the Notecard's network and Notehub connections.

### `outbound`

*integer*

The max wait time, in minutes, to sync outbound data from the Notecard.

### `product`

*string*

The ProductUID to which the Notecard is registered.

### `sn`

*string*

The serial number of the device, if set.

### `sync`

*boolean*

`true` if the device is in `continuous` mode and set to sync every time a change is detected.

### `vinbound`

*string*

If `inbound` has been overridden with a voltage-variable value.

### `voutbound`

*string*

If `outbound` is overridden with a voltage-variable value.

Example Response

```json
{
  "device": "dev:000000000000000",
  "product": "com.your-company.your-name:your_product",
  "mode": "periodic",
  "outbound": 60,
  "inbound": 240,
  "host": "a.notefile.net",
  "sn": "your-serial-number"
}
```

## hub.log

Supported on

(Cell, Cell+WiFi, Skylo, WiFi)

Add a "device health" log message to send to Notehub on the next sync via the [\_health\_host.qo Notefile](https://dev.blues.io/api-reference/system-notefiles.md#healthhost-qo).

Arguments

### `alert`

*boolean (optional)*

`true` if the message is urgent. This doesn't change any functionality, but rather `alert` is provided as a convenient flag to use in your program logic.

### `sync`

*boolean (optional)*

`true` if a sync should be initiated immediately. Setting `true` will also remove the Notecard from certain types of penalty boxes.

### `text`

*string (optional)*

Text to log.

**Log Health Alert with Immediate Sync**

**JSON**

```json
{
  "req": "hub.log",
  "text": "something is wrong!",
  "alert": true,
  "sync": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.log");
JAddStringToObject(req, "text", "something is wrong!");
JAddBoolToObject(req, "alert", true);
JAddBoolToObject(req, "sync", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.log"}
req["text"] = "something is wrong!"
req["alert"] = True
req["sync"] = True
rsp = card.Transaction(req)
```

Log an urgent health alert and sync immediately.

**Log Simple Message**

**JSON**

```json
{
  "req": "hub.log",
  "text": "System status: normal"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.log");
JAddStringToObject(req, "text", "System status: normal");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.log"}
req["text"] = "System status: normal"
rsp = card.Transaction(req)
```

Log a simple text message.

**Response Members**

None: an empty object `{}` means success.

## hub.set

Supported on

(Cell, Cell+WiFi, LoRa, Skylo, WiFi)

The hub.set request is the primary method for controlling the Notecard's Notehub connection and sync behavior.

Arguments

### `align`

*boolean (optional)*

Use `true` to align syncs on a regular time-periodic cycle.

### `details`

*string or object (optional)*

(LoRa)

When using Notecard LoRa you can use this argument to provide information about an alternative LoRaWAN server or service you would like the Notecard to use. The argument you provide must be a JSON object with three keys, "deveui", "appeui", and "appkey", all of which are hexadecimal strings with no leading 0x. For example:

`{"deveui":"0080E11500088B37","appeui":"6E6F746563617264","appkey":"00088B37"}`

The LoRaWAN details you send to a Notecard become part of its permanent configuration, and survive factory resets. You can reset a Notecard's LoRaWAN details to its default values by providing a `"-"` for the details argument.

### `duration`

*integer (optional)*

When in `continuous` mode, the amount of time, in minutes, of each session (the minimum allowed value is `15`). When this time elapses, the Notecard gracefully ends the current session and starts a new one in order to sync session-specific data to Notehub.

### `host`

*string (optional)*

The URL of the Notehub service. Use `"-"` to reset to the default value.

### `inbound`

*integer (optional)*

The max wait time, in minutes, to sync inbound data from Notehub. Explicit syncs (e.g. using `hub.sync`) do not affect this cadence.

When in `periodic` or `continuous` mode this argument is required, otherwise the Notecard will function as if it is in `minimum` mode as it pertains to syncing behavior.

Use `-1` to reset the value back to its default of `0`.

A value of `0` means that the Notecard will never sync inbound data unless explicitly told to do so (e.g. using `hub.sync`).

### `mode`

*string (optional)*

The Notecard's synchronization mode.

**NOTE:** The Notecard must be in `periodic` or `continuous` mode to use the onboard GPS module.

`"periodic"`: Periodically connect to the Notehub. This is the default value set on each Notecard after a factory reset.

`"continuous"`: Enables an always-on network connection, for high power devices. Outbound data still syncs periodically, unless specified in a Note or File request.

`"minimum"`: Disables periodic connection. The Notecard will not sync until it receives an explicit `hub.sync` request. OTA DFU updates are not available when using this mode.

`"off"`: Disables automatic and manual syncs. `hub.sync` requests will be ignored in this mode. OTA DFU updates are not available when using this mode.

`"dfu"`: Puts the Notecard in DFU mode for IAP host MCU firmware updates. This mode is effectively the same as `off` in terms of the Notecard's network and Notehub connections.

`"dfu-completed"`: Takes the Notecard out of DFU mode and resumes its previous synchronization mode. Used by an [IAP host MCU](https://dev.blues.io/notehub/host-firmware-updates/iap-firmware-update.md) once it has finished retrieving host firmware with `dfu.get`.

`"-"`: Resets the mode to the default value (`periodic`).

### `off`

*boolean (optional)*

Set to `true` to manually instruct the Notecard to resume periodic mode after a web transaction has completed.

### `on`

*boolean (optional)*

If in `periodic` mode, used to temporarily switch the Notecard to `continuous` mode to perform a web transaction.

Ignored if the Notecard is already in `continuous` mode or if the Notecard is NOT performing a web transaction.

### `outbound`

*integer (optional)*

The max wait time, in minutes, to sync outbound data from the Notecard. Explicit syncs (e.g. using `hub.sync`) do not affect this cadence.

When in `periodic` or `continuous` mode this argument is required, otherwise the Notecard will function as if it is in `minimum` mode as it pertains to syncing behavior.

Use `-1` to reset the value back to its default of `0`.

A value of `0` means that the Notecard will never sync outbound data unless explicitly told to do so (e.g. using `hub.sync`).

### `product`

*string (optional)*

A Notehub-managed unique identifier that is used to match Devices with Projects. This string is used during a device's auto-provisioning to find the Notehub Project that, once provisioned, will securely manage the device and its data.

### `seconds`

*integer (optional)*

If in `periodic` mode and using `on` above, the number of seconds to run in continuous mode before switching back to periodic mode. If not set, a default of 300 seconds is used. Ignored if the Notecard is already in continuous mode.

### `sn`

*string (optional)*

The end product's serial number.

### `sync`

*boolean (optional)*

(Cell)  (Cell+WiFi)  (Skylo)  (WiFi)

If in `continuous` mode, automatically and immediately sync each time an inbound Notefile change is detected on Notehub.

**NOTE:** The `sync` argument is not supported when a Notecard is in NTN mode.

### `umin`

*boolean (optional)*

Set to `true` to use USB/line power variable sync behavior, enabling the Notecard to stay in `continuous` mode when connected to USB/line power and fallback to `minimum` mode when disconnected.

### `uoff`

*boolean (optional)*

Set to `true` to use USB/line power variable sync behavior, enabling the Notecard to stay in `continuous` mode when connected to USB/line power and fallback to `off` mode when disconnected.

### `uperiodic`

*boolean (optional)*

Set to `true` to use USB/line power variable sync behavior, enabling the Notecard to stay in `continuous` mode when connected to USB/line power and fallback to `periodic` mode when disconnected.

### `version`

*string or object (optional)*

The version of your host firmware. The value provided will appear on your device in Notehub under the "Host Firmware" tab.

You may pass a simple version number string (e.g. "1.0.0.0"), or an object with detailed information about the firmware image. If you provide an object it must take the following form.

`{"org":"my-organization","product":"My Product","description":"A description of the image","version":"1.2.4","built":"Jan 01 2025 01:02:03","ver_major":1,"ver_minor":2,"ver_patch":4,"ver_build": 5,"builder":"The Builder"}`

If your project uses [Notecard Outboard Firmware Update](https://dev.blues.io/notehub/host-firmware-updates/notecard-outboard-firmware-update.md), you can alternatively use the [`dfu.status` request](https://dev.blues.io/api-reference/notecard-api/dfu-requests/latest.md#dfu-status) to set your host firmware version.

### `vinbound`

*string (optional)*

(Cell)  (Cell+WiFi)  (Skylo)  (WiFi)

Overrides `inbound` with a voltage-variable value. Use `"-"` to clear this value.

**NOTE:** Setting voltage-variable values is not supported on Notecard XP.

### `voutbound`

*string (optional)*

(Cell)  (Cell+WiFi)  (Skylo)  (WiFi)

Overrides `outbound` with a voltage-variable value. Use `"-"` to clear this value.

**NOTE:** Setting voltage-variable values is not supported on Notecard XP.

**Set ProductUID**

**JSON**

```json
{
  "req": "hub.set",
  "product": "com.your-company.your-name:your_product",
  "sn": "my-device"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddStringToObject(req, "product", "com.your-company.your-name:your_product");
JAddStringToObject(req, "sn", "my-device");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["product"] = "com.your-company.your-name:your_product"
req["sn"] = "my-device"
rsp = card.Transaction(req)
```

Change device ProductUID and serial number.

**Periodic Mode**

**JSON**

```json
{
  "req": "hub.set",
  "mode": "periodic",
  "product": "com.your-company.your-name:your_product",
  "outbound": 90,
  "inbound": 240
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddStringToObject(req, "mode", "periodic");
JAddStringToObject(req, "product", "com.your-company.your-name:your_product");
JAddNumberToObject(req, "outbound", 90);
JAddNumberToObject(req, "inbound", 240);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["mode"] = "periodic"
req["product"] = "com.your-company.your-name:your_product"
req["outbound"] = 90
req["inbound"] = 240
rsp = card.Transaction(req)
```

Configure periodic mode with outbound and inbound sync timing.

**Continuous Mode**

**JSON**

```json
{
  "req": "hub.set",
  "mode": "continuous",
  "product": "com.your-company.your-name:your_product",
  "outbound": 30,
  "inbound": 60,
  "duration": 240,
  "sync": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddStringToObject(req, "mode", "continuous");
JAddStringToObject(req, "product", "com.your-company.your-name:your_product");
JAddNumberToObject(req, "outbound", 30);
JAddNumberToObject(req, "inbound", 60);
JAddNumberToObject(req, "duration", 240);
JAddBoolToObject(req, "sync", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["mode"] = "continuous"
req["product"] = "com.your-company.your-name:your_product"
req["outbound"] = 30
req["inbound"] = 60
req["duration"] = 240
req["sync"] = True
rsp = card.Transaction(req)
```

Configure continuous mode with session duration and automatic sync.

**Voltage-Variable Sync**

**JSON**

```json
{
  "req": "hub.set",
  "mode": "periodic",
  "voutbound": "usb:30;high:60;normal:90;low:120;dead:0",
  "vinbound": "usb:60;high:120;normal:240;low:480;dead:0"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddStringToObject(req, "mode", "periodic");
JAddStringToObject(req, "voutbound", "usb:30;high:60;normal:90;low:120;dead:0");
JAddStringToObject(req, "vinbound", "usb:60;high:120;normal:240;low:480;dead:0");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["mode"] = "periodic"
req["voutbound"] = "usb:30;high:60;normal:90;low:120;dead:0"
req["vinbound"] = "usb:60;high:120;normal:240;low:480;dead:0"
rsp = card.Transaction(req)
```

Configure voltage-dependent synchronization periods.

**Set Host Firmware Version String**

**JSON**

```json
{
  "req": "hub.set",
  "version": "1.2.3"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddStringToObject(req, "version", "1.2.3");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["version"] = "1.2.3"
rsp = card.Transaction(req)
```

Set host firmware version using a simple string.

**Set Host Firmware Version Object**

**JSON**

```json
{
  "req": "hub.set",
  "version": {
    "org": "my-organization",
    "product": "My Product",
    "description": "A description of the image",
    "version": "1.2.4",
    "built": "Jan 01 2025 01:02:03",
    "ver_major": 1,
    "ver_minor": 2,
    "ver_patch": 4,
    "ver_build": 5,
    "builder": "The Builder"
  }
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
J *version = JAddObjectToObject(req, "version");
JAddStringToObject(version, "org", "my-organization");
JAddStringToObject(version, "product", "My Product");
JAddStringToObject(version, "description", "A description of the image");
JAddStringToObject(version, "version", "1.2.4");
JAddStringToObject(version, "built", "Jan 01 2025 01:02:03");
JAddNumberToObject(version, "ver_major", 1);
JAddNumberToObject(version, "ver_minor", 2);
JAddNumberToObject(version, "ver_patch", 4);
JAddNumberToObject(version, "ver_build", 5);
JAddStringToObject(version, "builder", "The Builder");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["version"] = {"org": "my-organization", "product": "My Product", "description": "A description of the image", "version": "1.2.4", "built": "Jan 01 2025 01:02:03", "ver_major": 1, "ver_minor": 2, "ver_patch": 4, "ver_build": 5, "builder": "The Builder"}
rsp = card.Transaction(req)
```

Set host firmware version using detailed object information.

**Configure LoRaWAN Details**

**JSON**

```json
{
  "req": "hub.set",
  "details": {
    "deveui": "0080E11500088B37",
    "appeui": "6E6F746563617264",
    "appkey": "00088B3700112233445566778899AABB"
  }
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
J *details = JAddObjectToObject(req, "details");
JAddStringToObject(details, "deveui", "0080E11500088B37");
JAddStringToObject(details, "appeui", "6E6F746563617264");
JAddStringToObject(details, "appkey", "00088B3700112233445566778899AABB");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["details"] = {"deveui": "0080E11500088B37", "appeui": "6E6F746563617264", "appkey": "00088B3700112233445566778899AABB"}
rsp = card.Transaction(req)
```

Set alternative LoRaWAN server details for Notecard LoRa.

**Reset LoRaWAN Details**

**JSON**

```json
{
  "req": "hub.set",
  "details": "-"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddStringToObject(req, "details", "-");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["details"] = "-"
rsp = card.Transaction(req)
```

Reset LoRaWAN details to default values using dash.

**USB Power Variable Sync**

**JSON**

```json
{
  "req": "hub.set",
  "umin": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddBoolToObject(req, "umin", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["umin"] = True
rsp = card.Transaction(req)
```

Configure USB/line power variable sync to minimum mode.

**Web Transaction Control**

**JSON**

```json
{
  "req": "hub.set",
  "on": true,
  "seconds": 300
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.set");
JAddBoolToObject(req, "on", true);
JAddNumberToObject(req, "seconds", 300);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.set"}
req["on"] = True
req["seconds"] = 300
rsp = card.Transaction(req)
```

Temporarily switch to continuous mode for web transactions.

**Response Members**

None: an empty object `{}` means success.

## hub.signal

Supported on

(Cell, Cell+WiFi, Skylo, WiFi)

Receive a [Signal](https://dev.blues.io/api-reference/glossary.md#signal) (a near-real-time Note) from Notehub.

This request checks for an inbound signal from Notehub. If it finds a signal, this request returns the signal's body and deletes the signal. If there are multiple signals to receive, this request reads and deletes signals in FIFO (first in first out) order.

> **Warning:**
>
> A Notecard must be in [continuous mode](https://dev.blues.io/api-reference/notecard-api/hub-requests/latest.md#hub-set) and have its `sync` argument set to `true` to receive signals.

> **Note:**
>
> See our guide to [Using Inbound Signals](https://dev.blues.io/guides-and-tutorials/notecard-guides/minimizing-latency.md#using-inbound-signals) for more information on how to set up a host microcontroller or single-board computer to receive inbound signals.

Arguments

### `seconds`

*integer (optional)*

The number of seconds to wait before timing out the request.

**Receive a Signal**

**JSON**

```json
{
  "req": "hub.signal"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.signal");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.signal"}
rsp = card.Transaction(req)
```

Check for an inbound signal from Notehub.

**Receive Signal with Timeout**

**JSON**

```json
{
  "req": "hub.signal",
  "seconds": 30
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.signal");
JAddNumberToObject(req, "seconds", 30);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.signal"}
req["seconds"] = 30
rsp = card.Transaction(req)
```

Check for an inbound signal with custom timeout.

**Response Members**

### `body`

*object*

The JSON body of a received signal.

### `connected`

*boolean*

`true` if the Notecard is connected to Notehub.

### `signals`

*integer*

The number of queued signals remaining.

Example Response

```json
{
  "body": {
    "example-key": "example-value"
  },
  "connected": true
}
```

Response when a signal is received from Notehub.

```json
{
  "connected": true
}
```

Response when no signals are available.

```json
{
  "body": {
    "data": "signal-data"
  },
  "connected": true,
  "signals": 3
}
```

Response with remaining queued signals.

## hub.status

Supported on

(Cell, Cell+WiFi, LoRa, Skylo, WiFi)

Displays the current status of the Notecard's connection to Notehub.

Arguments

None

**Example**

**JSON**

```json
{
  "req": "hub.status"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.status");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.status"}
rsp = card.Transaction(req)
```

Check the current status of the Notecard's connection to Notehub.

**Response Members**

### `connected`

*boolean*

`true` if the Notecard is connected to Notehub.

### `err`

*string*

If present, a string describing a connection or authentication error, e.g. `{"err":"unable to connect to notehub {notehub-open-failure}"}`.

### `status`

*string*

Details about the Notecard's transport (e.g. cellular, WiFi, LoRa) connection status.

Use `connected` to check if the Notecard is connected to Notehub.

Example Response

```json
{
  "status": "connected (session open) {connected}",
  "connected": true
}
```

Response when Notecard is connected to Notehub.

```json
{
  "status": "disconnected"
}
```

Response when Notecard is not connected to Notehub.

## hub.sync

Supported on

(Cell, Cell+WiFi, LoRa, Skylo, WiFi)

Manually initiates a sync with Notehub.

Arguments

### `allow`

*boolean (optional)*

Set to `true` to remove the Notecard from certain types of [penalty boxes](https://dev.blues.io/support/understanding-notecard-penalty-boxes.md) (the default is `false`).

### `in`

*boolean (optional)*

Set to `true` to only sync pending inbound Notefiles. **Required** when using NTN mode with Starnote to check for inbound Notefiles.

### `out`

*boolean (optional)*

Set to `true` to only sync pending outbound Notefiles.

**Manual Sync**

**JSON**

```json
{
  "req": "hub.sync"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.sync");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.sync"}
rsp = card.Transaction(req)
```

Initiate a manual sync with Notehub.

**Sync with Penalty Box Removal**

**JSON**

```json
{
  "req": "hub.sync",
  "allow": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.sync");
JAddBoolToObject(req, "allow", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.sync"}
req["allow"] = True
rsp = card.Transaction(req)
```

Sync and remove Notecard from penalty boxes.

**Outbound Only Sync**

**JSON**

```json
{
  "req": "hub.sync",
  "out": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.sync");
JAddBoolToObject(req, "out", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.sync"}
req["out"] = True
rsp = card.Transaction(req)
```

Sync only pending outbound Notefiles.

**Inbound Only Sync**

**JSON**

```json
{
  "req": "hub.sync",
  "in": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.sync");
JAddBoolToObject(req, "in", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.sync"}
req["in"] = True
rsp = card.Transaction(req)
```

Sync only pending inbound Notefiles (required for NTN mode).

**Response Members**

None: an empty object `{}` means success.

## hub.sync.status

Supported on

(Cell, Cell+WiFi, LoRa, Skylo, WiFi)

Check on the status of a recently triggered or previous sync.

Arguments

### `sync`

*boolean (optional)*

`true` if this request should auto-initiate a sync pending outbound data.

**Check Sync Status**

**JSON**

```json
{
  "req": "hub.sync.status"
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.sync.status");

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.sync.status"}
rsp = card.Transaction(req)
```

Check the status of a recent or previous sync.

**Check Status and Auto-Initiate Sync**

**JSON**

```json
{
  "req": "hub.sync.status",
  "sync": true
}
```

**C/C++**

```cpp
J *req = NoteNewRequest("hub.sync.status");
JAddBoolToObject(req, "sync", true);

NoteRequest(req);
```

**Python**

```python
req = {"req": "hub.sync.status"}
req["sync"] = True
rsp = card.Transaction(req)
```

Check sync status and auto-initiate sync if there is pending outbound data.

**Response Members**

### `alert`

*boolean*

`true` if an error occurred during the most recent sync.

### `completed`

*integer*

Number of seconds since the last sync completion.

### `err`

*string*

If present, a string describing the error that occurred during sync, e.g. `{"err":"sync error {sync-error}"}`.

### `mode`

*string*

The current state of the wireless connectivity module in use.

### `requested`

*integer*

Number of seconds since the last explicit sync request.

### `scan`

*boolean*

Returns `true` if triangulation data was sent to Notehub in the most recent sync.

### `seconds`

*integer*

If the Notecard is in a [Penalty Box](https://dev.blues.io/support/understanding-notecard-penalty-boxes.md), the number of seconds until the penalty condition ends.

### `status`

*string*

The status of the current or previous sync.

### `sync`

*boolean*

`true` if the notecard has unsynchronized notes, or requires a sync to set its internal clock.

### `time`

*UNIX Epoch time*

Time of the last sync completion. Will only populate if the Notecard has completed a sync to Notehub to obtain the time.

Example Response

```json
{
  "status": "completed {sync-end}",
  "mode": "{modem-off}",
  "time": 1598367163,
  "alert": true,
  "sync": true,
  "completed": 1648
}
```

Response showing sync status with completion time and alert.

```json
{
  "status": "waiting {network-down}",
  "mode": "{modem-off}",
  "seconds": 300
}
```

Response when Notecard is in penalty box.

```json
{
  "status": "completed {sync-end}",
  "mode": "{modem-off}",
  "time": 1598367163,
  "completed": 45,
  "scan": true
}
```

Response showing recent sync with scan data.

[file Requests](https://dev.blues.io/api-reference/notecard-api/file-requests.md "file Requests") [note Requests](https://dev.blues.io/api-reference/notecard-api/note-requests.md "note Requests")
