FlashMyPico.com
log in about discover docs scratchpad
topics howto compatibility known issues security q&a api reference

API reference

FlashMyPico provides a REST API with a JSON-based object representation. The API accepts parameters as form data.

The most of the API endpoints require an API key that you can create after logging into your account.

Below you'll find a list of the available endpoints, together with the data model description, and usage examples.

/v1/api (GET)

Description

This is a test endpoint. It always returns HTTP 200 OK.

Usage

curl https://flashmypico.com/v1/api

Response

{
    "status": "ok"
}

/v1/api/projects (GET)

Description

This endpoint will list all of your Projects (not "Builds"), along with their attributes, such as the title, the description, and so on.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/projects | jq

Response

{
  "projects": [
    {
      "handle": "pico2_adc_console",
      "title": "adc_console",
      "description": "(...)",
      "homepage": "https://github.com/raspberrypi/pico-examples",
      "repository": "https://github.com/raspberrypi/pico-examples/tree/master/adc/adc_console",
      "listed": true,
      "created_at": "2024-11-19T16:49:46.430914Z"
    },
    (...)
  ],
  "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE (GET)

Description

This endpoint returns a single Project object.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq

Response

{
  "project": {
    "handle": "pico2_adc_console",
    "title": "adc_console",
    "description": "(...)",
    "homepage": "https://github.com/raspberrypi/pico-examples",
    "repository": "https://github.com/raspberrypi/pico-examples/tree/master/adc/adc_console",
    "listed": true,
    "created_at": "2024-11-19T16:49:46.430914Z"
  },
  "status": "ok"
}

Response contents

/v1/api/project/NEW_PROJECT_HANDLE (POST)

Description

This endpoint creates new Project. The new project's handle (the identifier used in the project's on-line flashing tool link) is defined in the API call URL itself.

Request contents

Usage

curl -X POST \
-d title="Test project" -d device_handle=pico_2 \
-sH "Authorization: Bearer YOUR_API_KEY" \
https://flashmypico.com/v1/api/project/test_project | jq

Response

{
  "project": {
    "handle": "test_project",
    "title": "Test project",
    "description": "",
    "homepage": "",
    "repository": "",
    "listed": false,
    "created_at": "2024-11-22T15:42:41.698975731Z"
  },
  "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE (PUT)

Description

This endpoint updates Project's attributes, such as its title, its description, and so on.

Request contents

All of the listed fields are optional.

Usage

curl -X PUT \
-d title="A New Title" \
(...) \
-sH "Authorization: Bearer YOUR_API_KEY" \
https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq

Response

{
    "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE (DELETE)

Description

Deletes a Project given its unique handle.

Usage

curl -X DELETE -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq

Response

{
    "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE/builds (GET)

Description

Lists Project's Builds.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE/builds | jq

Response

{
  "builds": [
    {
      "id": "dbbf6200-b3da-11ef-b15a-6f2782a146bb",
      "version": "2.0",
      "hash": "bb9f8df61474d25e71fa00722318cd387396ca1736605e1248821cc0de3d3af8",
      "size": 4194304,
      "created_at": "2024-11-25T20:03:13.236862Z"
    },
    {
      "id": "e17cb774-b3da-11ef-9ab1-634325665976",
      "version": "1.1",
      "hash": "bb9f8df61474d25e71fa00722318cd387396ca1736605e1248821cc0de3d3af8",
      "size": 4194304,
      "created_at": "2024-11-25T19:54:28.730479Z"
    },
    {
      "id": "e6e63f78-b3da-11ef-830c-2f8203633a85",
      "version": "1.0",
      "hash": "bb9f8df61474d25e71fa00722318cd387396ca1736605e1248821cc0de3d3af8",
      "size": 4194304,
      "created_at": "2024-11-25T19:54:14.511173Z"
    }
  ],
  "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE/builds (POST)

Description

Adds a new Build to the Project.

Request contents

All of the listed fields are required.

Usage

curl -X POST -F version=1.0 -F file=@path/to/file \
-sH "Authorization: Bearer YOUR_API_KEY" \
https://flashmypico.com/v1/api/project/PROJECT_HANDLE/builds | jq

Response

{
  "build": {
    "id": "bc991d26-b3da-11ef-8813-531c53d06331",
    "version": "1.0",
    "hash": "bb9f8df61474d25e71fa00722318cd387396ca1736605e1248821cc0de3d3af8",
    "size": 4194304,
    "created_at": "2024-11-25T20:03:13.236862329Z"
  },
  "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE/build/BUILD_ID (DELETE)

Description

Deletes a Build given its unique identifier, and its Project handle.

Usage

curl -X DELETE -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE/build/BUILD_ID | jq

Response

{
    "status": "ok"
}

Response contents

/v1/api/project/PROJECT_HANDLE/build/BUILD_ID/blob (GET)

Description

Downloads the build's UF2 file.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE/build/BUILD_ID > build.uf2

Response

Raw UF2 file

/v1/api/devices (GET)

Description

Lists all of the microcontrollers/chips supported by this website. Device handles are required by the Project creation endpoint.

Usage

curl https://flashmypico.com/v1/api/devices

Response

{
  "devices": [
    {
      "handle": "pico",
      "name": "Pico",
    },
    {
      "handle": "pico_w",
      "name": "Pico W",
    },
    {
      "handle": "pico_2",
      "name": "Pico 2",
    }
  ],
  "status": "ok"
}

Response contents

/v1/api/auditlog (GET)

Description

Provides information on all the changes to the data associated with your profile.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/auditlog | jq
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/auditlog/PAGE (1..∞) | jq

Response

{
  "count": 2,
  "entries": [
    {
      "EventID": "5be0679c-3cde-467b-93d0-558dcf58c5e2",
      "Type": "CreateAPIKey",
      "Description": "API key was created.",
      "Metadata": {
        "APIKeyHandle": "key2",
        "AuthMethod": "Web session"
      },
      "Timestamp": "2024-12-09T21:02:41.593578Z"
    },
    {
      "EventID": "defd6021-49cb-4400-9a78-4fbb99e6e7f4",
      "Type": "DeleteAPIKey",
      "Description": "API key was deleted.",
      "Metadata": {
        "APIKeyHandle": "key1",
        "AuthMethod": "Web session"
      },
      "Timestamp": "2024-12-09T21:02:38.423772Z"
    },
    "limit": 100,
    "offset": 0,
    "page": 1,
    "status": "ok"
}

Response contents

/v1/api/boards (GET)

Description

Retrieves information on all of your registered boards, and their installed firmware.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/boards

Response

{
  "boards": [
    {
      "ID": "b442eb88-86b9-4cc1-98bd-6e5018c95d22",
      "Label": "Board #1",
      "ChipID": "4ee9834b70d68e3c7f9fd41cad84b663",
      "AssignedProjectHandle": "my_project",
      "LastFlashedImageHandle": "",
      "LastFlashedBuildID": "",
      "LastFlashedFirmwareVersion": "",
      "LastFlashedAt": "0001-01-01T00:00:00Z",
      "Status": "unknown",
      "CreatedAt": "2024-12-17T16:19:52.922732Z"
    }
  ],
  "status": "ok"
}

Response contents

/v1/api/board/BOARD_ID (GET)

Description

Retrieves information on a particular board, identified by BOARD_ID.

Usage

curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/board/BOARD_ID

Response

{
  "board": {
    "ID": "b442eb88-86b9-4cc1-98bd-6e5018c95d22",
    "Label": "Board #1",
    "ChipID": "4ee9834b70d68e3c7f9fd41cad84b663",
    "AssignedProjectHandle": "",
    "LastFlashedImageHandle": "",
    "LastFlashedBuildID": "",
    "LastFlashedFirmwareVersion": "",
    "LastFlashedAt": "0001-01-01T00:00:00Z",
    "Status": "unassigned",
    "CreatedAt": "2024-12-17T16:19:52.922732Z"
  },
  "status": "ok"
}

Response contents

/v1/api/boards (POST)

Description

Creates a new board entry.

Request contents

Both of the parameters are required.

Usage

curl -X POST \
-d label="Board #1" \
-d chip_id="4ee9834b70d68e3c7f9fd41cad84b663" \
-sH "Authorization: Bearer YOUR_API_KEY" \
https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq

Response

{
  "board_id": "c5390391-f0c6-4849-a640-a33a1faffb62",
  "status": "ok"
}

Response contents

/v1/api/board/BOARD_ID (PUT)

Description

Updates board's assigned project.

Usage

curl -X POST \
-d project_handle="my_project" \
-sH "Authorization: Bearer YOUR_API_KEY" \
https://flashmypico.com/v1/api/board/BOARD_ID | jq

curl -X POST \
-d project_handle="(none)" \
-sH "Authorization: Bearer YOUR_API_KEY" \
https://flashmypico.com/v1/api/board/BOARD_ID | jq

Response

{
    "status": "ok"
}

Response contents

/v1/api/board/BOARD_ID (DELETE)

Description

Deletes a board.

Usage

curl -X DELETE -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/board/BOARD_ID

Response

{
    "status": "ok"
}

Response contents