> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/losant.md).

# Losant

Create and list Losant devices, read device state, send commands, and run workflows through virtual buttons.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication        |
| --------- | --------------------- |
| Losant    | Application API Token |

#### Losant

Connect one Losant application to manage devices, inspect device state, send commands, and trigger workflows.

**Set up in Losant**

1. Prepare the Losant account or service that the workflow will access. Grant access to the required resources and operations.
2. **Application API Token:** Create an application API token in Losant and grant the scopes required by the actions you use.
3. **Application ID:** Copy the application ID from the Losant application dashboard URL.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Losant**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field         | Required | What to enter                                                                                                                                                                      |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Application API Token | Yes      | Create an application API token in Losant and grant the scopes required by the actions you use. [Provider instructions](https://docs.losant.com/applications/application-tokens/). |
| Application ID        | Yes      | Copy the application ID from the Losant application dashboard URL. [Provider instructions](https://docs.losant.com/applications/overview/).                                        |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Losant** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Create Device

Create a device in the connected Losant application.

**Required permissions:** `devices.post`.

**Inputs**

| Field        | Type            | Required | Description                                                                                                                         |
| ------------ | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Name         | string          | Yes      | Name shown for the new device.                                                                                                      |
| Device Class | select (string) | Yes      | How this device connects to Losant. Available values: Standalone, Gateway, Peripheral, Edge Compute, Embedded. Default: standalone. |
| Description  | textarea        | No       | Optional notes about the device.                                                                                                    |

**Outputs**

| Field     | Type   | Description                      |
| --------- | ------ | -------------------------------- |
| Device ID | string | Losant id of the created device. |
| Name      | string | Created device name.             |

#### Get Device State

Retrieve recent state reported by a Losant device.

**Required permissions:** `devices.get`, `device.getState`.

**Inputs**

| Field          | Type            | Required | Description                                                                                 |
| -------------- | --------------- | -------- | ------------------------------------------------------------------------------------------- |
| Device         | select (string) | Yes      | Device whose reported state should be retrieved. Options load from the selected connection. |
| Maximum States | integer         | No       | Maximum recent state entries to return. Default: 10.                                        |

**Outputs**

| Field  | Type          | Description                              |
| ------ | ------------- | ---------------------------------------- |
| States | object\_array | Recent timestamped device state entries. |

#### Send Device Command

Send a named command and optional JSON payload to a Losant device.

**Required permissions:** `devices.get`, `device.sendCommand`.

**Inputs**

| Field        | Type            | Required | Description                                                                        |
| ------------ | --------------- | -------- | ---------------------------------------------------------------------------------- |
| Device       | select (string) | Yes      | Device that should receive the command. Options load from the selected connection. |
| Command Name | string          | Yes      | Command name understood by the device.                                             |
| Payload      | textarea        | No       | Optional JSON value delivered with the command.                                    |

**Outputs**

| Field   | Type    | Description                          |
| ------- | ------- | ------------------------------------ |
| Success | boolean | Whether Losant accepted the command. |

#### List Devices

List devices in the connected Losant application.

**Required permissions:** `devices.get`.

**Inputs**

| Field           | Type    | Required | Description                                                                 |
| --------------- | ------- | -------- | --------------------------------------------------------------------------- |
| Name Filter     | string  | No       | Optional glob-style device name filter.                                     |
| Maximum Devices | integer | No       | Maximum number of devices to return. Minimum: 1. Maximum: 100. Default: 25. |
| Starting Page   | integer | No       | Zero-based page where listing should begin. Minimum: 0. Default: 0.         |

**Outputs**

| Field     | Type          | Description                                 |
| --------- | ------------- | ------------------------------------------- |
| Devices   | object\_array | Matching Losant devices.                    |
| Next Page | integer       | Next Losant page, when more devices remain. |

#### Trigger Workflow

Press a virtual button on a Losant workflow.

**Required permissions:** `flows.get`, `flow.get`, `flow.pressVirtualButton`.

**Inputs**

| Field              | Type            | Required | Description                                                                         |
| ------------------ | --------------- | -------- | ----------------------------------------------------------------------------------- |
| Workflow           | select (string) | Yes      | Workflow that should run. Options load from the selected connection.                |
| Virtual Button Key | select (string) | Yes      | Virtual button on the selected workflow. Options load from the selected connection. |
| Payload            | textarea        | No       | Optional JSON object sent to the workflow.                                          |

**Outputs**

| Field   | Type    | Description                                       |
| ------- | ------- | ------------------------------------------------- |
| Success | boolean | Whether Losant accepted the virtual button press. |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/losant.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
