Skip to main content
Version: 1.0

Memfault API Documentation

About

This is the documentation for the Memfault REST API.

For CI & scripting, we recommend using the Memfault CLI Tool which exposes an easy to use interface for a majority of the REST APIs detailed below.

Linked below are other useful resources:

Memfault URLs

There are four API related URLs that will be used with Memfault's service. The proper use for each is as follows:

  • api.memfault.com - Use along with an API Key for normal consumption and use of the API documented below.
  • chunks.memfault.com - Use with the Chunks API to push chunked data into Memfault.
  • ingress.memfault.com - Use with APIs that push data into Memfault, such as Events and Coredumps.
  • files.memfault.com - Use in Continuous Integration systems for uploading large files, such as binaries, symbol files, bugreports, etc.

Authentication

There are four ways to authenticate when interfacing with the Memfault API.

Email + Password

To test if the Email + Password works, one can try this example request

curl --user user@example.com:mypassword https://api.memfault.com/auth/me

where user@example.com is the User's email and mypassword is the User's password

Email + API Key

Please refer to the section 'Auth -> Generate User API Key' to learn how to get an API key. Once one is generated, the user can authenticate with the email + API key combination using Basic Auth.

To test if the Email + API Key works, one can try this example request

curl --user user@example.com:123e4567e89b12d3a456426655440000 https://api.memfault.com/auth/me

where user@example.com is the User's email and 123e4567e89b12d3a456426655440000 is the User's API Key

Organization Auth Token

Organization Auth Tokens allow access of the organization's resources for automation. They can be accessed and managed by Administrators at Admin → Organization Auth Tokens in the Memfault UI.

Organization Auth Tokens use Bearer Authentication.

To test if the Organization Auth Token works, one can try this example request

curl --header "Authorization: Bearer oat_123e4567e89b12d3a456426655440000" https://api.memfault.com/api/v0/organizations

Memfault Project Key

This is only for use when pushing data into Memfault, or by a Device that may have limited memory when accessing specific endpoints (such as the Latest Release endpoint).

This sort of authentication will not work with most API endpoints. API endpoints that accept or require this form of authentication will explicitly say so in their specific documentation.

This enables Devices to associate directly to a Project instead of with a particular User, Memfault account, or API Key. It also allows for a shorter URL which doesn't have to specify the Project or Organization. Devices can make requests such as:

curl \
https://ingress.memfault.com/api/v0/events \
-H "Memfault-Project-Key: 06e7916f2db44167a1f5196cfe83a898" \
-H 'Content-Type: application/json' \
-d '{ ... }'

The Memfault Project Key for a Project can be found in the Dashboard under Settings.

Requests

All API data sent and received is JSON.

Methods

MethodExample RouteCountDescription
GET/objectsmanyGet a list of the objects
GET/objects/:keysingleGet a single object
POST/objectssingleCreate a single object
PATCH/objects/:keysingleUpdate any number of fields in an object
PUT/objects/:keysingleCreate/Update a relationship object
DELETE/objectsmanyDelete many objects (sent as JSON data)
DELETE/objects/:keysingleDelete a single object

NOTE: Not all routes implemented for all types. Please reference the documentation for exact routes and features.

Parameters

Most endpoints with methods of type POST, PATCH, and PUT will accept parameters and data in JSON format.

Header: Content-Type: application/json

Query Parameters & Filtering

Many API endpoints allow filtering of the results through the use of query parameters. These are optional and URL encoded. The list of possible parameters are listed under each route. Many of them accept list of values, in the following format:

ex. single Cohort

/issues?cohort=alpha

ex. List of Cohorts

/issues?cohort=alpha&cohort=beta&cohort=internal

Query Parameters that accept lists are denoted by the [] signifier after their name in the documentation for each endpoint. ex. cohorts[]

Timestamps

When sending timestamps in requests as parameters, such as for created_date or first_seen, ISO 8601 standard with a Z is required.

Valid for requests: 2025-02-27T00:00:00Z

Not valid for requests (will return 'Not a valid datetime'):

  • 2025-02-27
  • 2025-02-27T00:00:00+00:00

Sorting

For all sort parameters, you may include - to force Descending sort, or leave it off to force Ascending sort.

The following will sort by created_date descending, with the newest entries last.

/projects?sort=-created_date

The following will sort by created_date ascending, with the newest entries first.

/projects?sort=created_date

Pagination

Pagination works on every endpoint, and the following parameters can be passed in to manipulate the page and size of each request.

Query String ParameterRequiredDescription
pageoptionalPage number of the result set (default: 1)
per_pageoptionalLimit the number of results per page. (default: 20, max: 100)

Example:

curl -X GET "https://api.memfault.com/api/v0/organizations/memfault/projects/demo/events?per_page=10&page=2"

Versions

All Versions are required to be Semantic Versions.

Responses

Pagination

On responses where multiple items could be returned, a paging field in the JSON object is returned.

{
"data": {
"..."
},
"paging": {
"item_count": 35,
"page": 1,
"page_count": 1,
"per_page": 20,
"total_count": 35
}
}
FieldTypeDescription
item_countNumberNumber of items returned in this response
total_countNumberNumber of items total on server that could be returned
pageNumberThe current page number
page_countNumberThe number of pages that could be returned from the server
per_pageNumberThe maximum number of items that will be returned in a response

Schema

Timestamps are returned in ISO 8601 format.

2014-12-22T03:12:58.019077+00:00

Memfault Resources

The following is a table of all Memfault Resources and their identifiers, URIs, and notes about each of them.

ResourceIdentifier TypeAPI URINotes
Organizationslug/organizations/<organization_slug>Max Length: 128
Regex: [-a-zA-Z0-9_]+
Projectslug/organizations/<organization_slug>/projects/<project_slug>Max Length: 128
Regex: [-a-zA-Z0-9_]+
Releaseslug/organizations/<organization_slug>/projects/<project_slug>/releases/<release_version>Max Length: 128
Regex: [-a-zA-Z0-9_.+]+
Cohortslug/organizations/<organization_slug>/projects/<project_slug>/cohorts/<cohort_slug>Max Length: 128
Regex: [-a-zA-Z0-9_]+
Deviceslug/organizations/<organization_slug>/projects/<project_slug>/devices/<device_serial>Max Length: 128
Regex: [-a-zA-Z0-9_]+
HardwareVersionslugN/AMax Length: 128
Regex: [-a-zA-Z0-9_.+]+
Deploymentid/organizations/<organization_slug>/projects/<project_slug>/deployments/<id>
Eventid/organizations/<organization_slug>/projects/<project_slug>/events/<id>
Traceid/organizations/<organization_slug>/projects/<project_slug>/traces/<id>
Issueid/organizations/<organization_slug>/projects/<project_slug>/issues/<id>
Installid/organizations/<organization_slug>/projects/<project_slug>/installs/<id>

Authentication

Security Scheme Type:

http

HTTP Authorization Scheme:

basic