> For the complete documentation index, see [llms.txt](https://docs.somewear.app/developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.somewear.app/developer-docs/beam/outbound-payloads.md).

# Outbound Payloads

When you do `beam up` , Beam runs as a background daemon service. By default, the Beam daemon runs a HTTP server which includes a REST API. You can programmatically interact with Beam and the GRID network over this API.

Beam's REST API server can be reached at `http://127.0.0.1:9091`.

## Send a Package

<mark style="color:green;">`POST`</mark> `/api/package`

Sends a package synchronously.&#x20;

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

<table><thead><tr><th width="157.65234375">Field</th><th width="215.26953125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>Int32 (Optional)</td><td>Package id</td></tr><tr><td><code>channels</code></td><td>Array&#x3C;<a href="#channel">Channel</a>> (Optional)</td><td>Channels to send Package over. If none are provided, all channels are used.</td></tr><tr><td><code>collapseKey</code></td><td>Int32 (Optional)</td><td>If set, the given Package will replace any queued Packages that have a matching <code>collapseKey</code>. Use this to replace in-progress Packages with fresh data.</td></tr><tr><td><code>priority</code></td><td>Int32 (Optional)</td><td>Higher priority Packages will jump ahead of other Packages in the queue. Default is 11, Messages are 12, Locations are 10, Sos is 100.</td></tr><tr><td><code>data</code></td><td><a href="#data">Data</a> (one-of type)</td><td>Present when sending a Data Package</td></tr><tr><td><code>message</code></td><td><a href="#message">Message</a> (one-of type)</td><td>Present when sending a Message Package</td></tr><tr><td><code>location</code></td><td><a href="#location">Location</a> (one-of type)</td><td>Present when sending a Location Package</td></tr><tr><td><code>waypoint</code></td><td><a href="#waypoint">Waypoint</a> (one-of type)</td><td>Present when sending a Waypoint Package</td></tr></tbody></table>

<details>

<summary>Channel</summary>

| Name      | Description                                  |
| --------- | -------------------------------------------- |
| Satellite | Sends Package over satellite                 |
| Radio     | Sends Package over radio (Node only)         |
| Cellular  | Sends Package over cellular networks or WiFi |

</details>

<details>

<summary>Data</summary>

| Field     | Type                    | Description       |
| --------- | ----------------------- | ----------------- |
| `payload` | String (Base64 Encoded) | Raw bytes to send |

</details>

<details>

<summary>Message</summary>

| Field     | Type   | Description     |
| --------- | ------ | --------------- |
| `content` | String | Message content |

</details>

<details>

<summary>Location</summary>

| Field              | Type              | Description                                           |
| ------------------ | ----------------- | ----------------------------------------------------- |
| `latitude`         | Double            | Latitude of coordinate (WGS84)                        |
| `longitude`        | Double            | Longitude of coordinate (WGS84)                       |
| `timestamp`        | String (ISO 8601) | Timestamp of coordinate (optional)                    |
| `altitude`         | Float             | Altitude above mean sea level (optional)              |
| `speedOverGround`  | Float             | Speed relative to the earth surface in m/s (optional) |
| `courseOverGround` | Float             | Degrees clockwise from true north (optional)          |

</details>

<details>

<summary>Waypoint</summary>

| Field       | Type              | Description                                             |
| ----------- | ----------------- | ------------------------------------------------------- |
| `latitude`  | Double            | Latitude of coordinate (WGS84)                          |
| `longitude` | Double            | Longitude of coordinate (WGS84)                         |
| `timestamp` | String (ISO 8601) | Timestamp of coordinate (optional)                      |
| `name`      | String            | Name of the point of interest                           |
| `notes`     | String            | Additional notes about the point of interest (optional) |

</details>

**Response**

Your response will include a [status](#package-status). When using this endpoint, your status cases are *terminal* statuses which are listed below.

{% tabs %}
{% tab title="200" %}

```json
{
  "id": 1,
  "status": "Delivered",
  "data": {
    "payload": ""
  }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}

{% tab title="429" %}

```json
{
  "error": "Too many requests"
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Package Status</summary>

<table><thead><tr><th width="178.80078125">Name</th><th>Description</th></tr></thead><tbody><tr><td>Delivered</td><td>Package was sent over the channel successfully. This doesn't necessarily mean that the Package reached its final destination. For example, when sent over satellite this means the Package successfully reached the satellite gateway, but not when the target client actually receives it.</td></tr><tr><td>Error</td><td>Package failed to send over any channel.</td></tr><tr><td>Collapsed</td><td>Package was <em>collapsed</em>, or replaced by a more recent Package.</td></tr><tr><td>Canceled</td><td>Package was canceled by calling <code>/api/package/{id}/cancel</code></td></tr></tbody></table>

</details>
