Meshtastic Web API (0.1)

Download OpenAPI specification:Download

A web interface for interacting with a Meshtastic node over serial connection.

Node Info

Information about the node(s)

get_node_info

Returns all the known nodes as list.

header Parameters
X-Fields
string <mask>

An optional fields mask

Responses

Response samples

Content type
application/json
{
  • "num": 1439136840,
  • "user": {
    },
  • "position": {
    },
  • "lastHeard": 1671952630,
  • "deviceMetrics": {
    }
}

get_single_node_info

Returns info of a node in JSON format.

path Parameters
node
required
string

The Node ID, Long Name, Short Name, or MAC Address.

header Parameters
X-Fields
string <mask>

An optional fields mask

Responses

Response samples

Content type
application/json
{
  • "num": 1439136840,
  • "user": {
    },
  • "position": {
    },
  • "lastHeard": 1671952630,
  • "deviceMetrics": {
    }
}

Local Config

Config operations

post_local_config

Update the current configuration

Request Body schema: application/json
owner
string
owner_short
string
ownerShort
string
channel_url
string
channelUrl
string
object (Location)
object (AbstractConfig)
object (AbstractConfig)

Responses

Request samples

Content type
application/json
{
  • "owner": "string",
  • "owner_short": "string",
  • "ownerShort": "string",
  • "channel_url": "string",
  • "channelUrl": "string",
  • "location": {
    },
  • "config": {
    },
  • "module_config": {
    }
}

get_local_config

Returns the configuration of the node connected via serial.

Responses

Serial Port

Information about the serial connection

get_port

Returns JSON containing the port the device is connected on.

Responses

Response samples

Content type
application/json
{
  • "port": "COM4, /dev/ttyUSB0, etc."
}

Messages

Sending and recieving text messages

post_text_message

Send a message on a channel, defaults to primary channel

Request Body schema: application/json
text
required
string

The text to send

destinationId
string
Default: "^all"

Where to send this message

wantAck
boolean
Default: true

If you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)

wantResponse
boolean
Default: false

If you want the service on the other side to send an application layer response

channelIndex
integer
Default: 0

The channel to send the message on

Responses

Request samples

Content type
application/json
{
  • "text": "Hello world!",
  • "destinationId": "^all",
  • "wantAck": true,
  • "wantResponse": false,
  • "channelIndex": 0
}

get_text_message

Get messages stored in the database

query Parameters
limit
string

Limit how many messages to output

dm
string

Shows only direct messages

header Parameters
X-Fields
string <mask>

An optional fields mask

Responses

Response samples

Content type
application/json
{
  • "uuid": 0,
  • "sender": "!9388f81c",
  • "target": "^all",
  • "text": "Hello world!",
  • "channel": "0",
  • "timestamp": "2022-12-23T14:51:15.784133"
}

Canned Message Module Config

Canned message module configuration.

post_canned_message

Update the current canned message

Request Body schema: application/json
messages
required
string

Predefined messages for canned message module separated by '|' characters.

Responses

Request samples

Content type
application/json
{
  • "messages": "My new message"
}

get_canned_message

Get the current canned message

header Parameters
X-Fields
string <mask>

An optional fields mask

Responses

Response samples

Content type
application/json
{
  • "messages": "My new message"
}

Positions

Get information about the positions of nodes.

get_positions

Get position entries from the database, most recent first.

header Parameters
X-Fields
string <mask>

An optional fields mask

Responses

Response samples

Content type
application/json
{
  • "uuid": 111234,
  • "sender": "!55c77c48",
  • "target": "^all",
  • "altitude": 327,
  • "latitude": 33.5415,
  • "longitude": 112.3755,
  • "timestamp": "2022-12-23T14:51:15.784133"
}

get_node_position

Get the positions of a single node, by name, ID, etc.

path Parameters
node
required
string
header Parameters
X-Fields
string <mask>

An optional fields mask

Responses

Response samples

Content type
application/json
{
  • "uuid": 111234,
  • "sender": "!55c77c48",
  • "target": "^all",
  • "altitude": 327,
  • "latitude": 33.5415,
  • "longitude": 112.3755,
  • "timestamp": "2022-12-23T14:51:15.784133"
}

Mattermost

Extend Mattermost messages to Meshtastic.

post_mattermost_message

Send a message from Mattermost to Meshtastic

Request Body schema: application/json
channel_id
string

Mattermost Channel ID

channel_name
string

Mattermost Channel Name

team_domain
string

Mattermost Team Name

team_id
string

Mattermost Team ID

post_id
string

Mattermost Post ID

text
required
string

Text to send to Meshtastic

timestamp
integer

Mattermost timestamp for message

token
required
string

Mattermost token, changes per deployment

trigger_word
string

Trigger word that activated the webhook

user_id
string

Mattermost User ID

user_name
required
string

Mattermost Usernam

Responses

Request samples

Content type
application/json
{
  • "channel_id": "hawos4dqtby53pd64o4a4cmeoo",
  • "channel_name": "town-square",
  • "team_domain": "someteam",
  • "team_id": "kwoknj9nwpypzgzy78wkw516qe",
  • "post_id": "axdygg1957njfe5pu38saikdho",
  • "text": "some+text+here",
  • "timestamp": 1445532266,
  • "token": "zmigewsanbbsdf59xnmduzypjc",
  • "trigger_word": "some",
  • "user_id": "rnina9994bde8mua79zqcg5hmo",
  • "user_name": "somename"
}