Skip to main content

Upload a recording

Request

Use this endpoint to upload data to your foxglove-hosted site. The upload is a two-request process.

  1. Make a request to this upload endpoint to create an upload link.
  2. Issue a PUT HTTP request to the link response field URL.

Your PUT request header should have Content-Type: application/octet-stream, and your request body should contain your file content.

Note: If you are using a self-hosted site, see this guide for uploading data.

Size considerations

While we support processing very large files, we generally recommend avoiding large (50GB+) files to reduce the chance of upload failures or processing issues. If you have tooling that generates very large files, consider splitting them up into smaller chunks.

Security
ApiKey(Required scopes: data.upload)
Bodyapplication/jsonrequired

In addition to filename, one of deviceId, deviceName, or key is required and projectId is recommended.

deviceIdstring

Foxglove ID of the associated device

deviceNamestring

Unique name of the associated device. If no device exists with this name, the device will be created.

A name that does not match an existing device must satisfy the same rules as POST /devices: at most 100 characters, containing only letters, numbers, underscores, periods, and hyphens.

filenamestringrequired

Name of the file that will be uploaded

keystring, non-empty

A unique key to identify the recording

projectIdstring

The project ID that the recording belongs to. Required for multi-project orgs if an existing device is not provided

sessionIdstring

ID of an existing session to associate the upload with.

sessionKeystring

Key of a session to associate the upload with. If no session exists with this key, a new session will be created using the provided device.

device.namestringdeprecated

Equivalent to deviceName, and ignored if deviceName is supplied

device.idstringdeprecated

Equivalent to deviceId, and ignored if deviceId is supplied

from foxglove.client import Client
from pathlib import Path

token = "<YOUR API TOKEN HERE>"
client = Client(token=token)

with Path("my_mcap_data.mcap").open("rb") as byte_stream:
    client.upload_data(
        device_id=device_id,
        filename="my_mcap_data.mcap",
        data=byte_stream,
        callback=lambda size, progress: print(size, progress),
        project_id="<YOUR PROJECT ID HERE>",
    )

Responses

Upload details

Bodyapplication/json
requestIdstringrequired
Response
{ "link": "string", "requestId": "string" }