---
title: "Import one or more FIT/GPX activity files"
method: POST
path: "/activities/files"
tags: ["Activities"]
---

# Import one or more FIT/GPX activity files

`POST /activities/files`

## Request

- Base URL: `https://bodylab.lol/api/v1`
- URL: `https://bodylab.lol/api/v1/activities/files`
- Auth: HTTP bearer

multipart/form-data with one or more `file[]` parts (the trailing brackets keep a single file from decoding as a scalar instead of a one-element array). Each file is imported and reported on individually, in the order sent, so one bad file in a batch doesn't lose the rest. At most 50 files and 100 MB per request; a per-user rolling 24-hour storage quota applies across requests (QUOTA_EXCEEDED, 429).

## Headers

- `X-Client-Platform` string
- `X-Client-Version` string

## Request body

- object
  - `file` string[], required

## Response `200`

OK

- object
  - `results` object[], required
    - `filename` string, required
    - `ok` boolean, required
    - `activityId` string, nullable, required: Opaque identifier.
    - `error` string, nullable, required: Why one file in an upload batch wasn't imported. too_large: over the 25 MB per-file limit. unsupported_format: not a FIT or GPX file. duplicate: already imported (see existingActivityId). failed: the file claims to be FIT or GPX but couldn't be read. Known values: too_large, unsupported_format, duplicate, failed. Treat unknown values as "other".
    - `existingActivityId` string, nullable, required: Opaque identifier.

## Other responses

- `400`: Error: TOO_MANY_FILES.
- `401`: Error: UNAUTHORIZED.
- `429`: Error: QUOTA_EXCEEDED.

---

[API](https://skmtc.dev/bodylab/apis/body-lab-api.md) · [All operations](https://skmtc.dev/bodylab/apis/body-lab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bodylab/apis/body-lab-api/revisions/544c201eaf88?raw)
