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.
This is a test endpoint. It always returns HTTP 200 OK.
curl https://flashmypico.com/v1/api
{
"status": "ok"
}
This endpoint will list all of your Projects (not "Builds"), along with their attributes, such as the title, the description, and so on.
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/projects | jq
{
"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"
}
This endpoint returns a single Project object.
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq
{
"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"
}
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.
/v1/api/devices call
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
{
"project": {
"handle": "test_project",
"title": "Test project",
"description": "",
"homepage": "",
"repository": "",
"listed": false,
"created_at": "2024-11-22T15:42:41.698975731Z"
},
"status": "ok"
}
/v1/api/devices call.This endpoint updates Project's attributes, such as its title, its description, and so on.
All of the listed fields are optional.
/v1/api/devices
curl -X PUT \ -d title="A New Title" \ (...) \ -sH "Authorization: Bearer YOUR_API_KEY" \ https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq
{
"status": "ok"
}
/v1/api/devices call.Deletes a Project given its unique handle.
curl -X DELETE -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE | jq
{
"status": "ok"
}
Lists Project's Builds.
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE/builds | jq
{
"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"
}
Adds a new Build to the Project.
All of the listed fields are required.
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
{
"build": {
"id": "bc991d26-b3da-11ef-8813-531c53d06331",
"version": "1.0",
"hash": "bb9f8df61474d25e71fa00722318cd387396ca1736605e1248821cc0de3d3af8",
"size": 4194304,
"created_at": "2024-11-25T20:03:13.236862329Z"
},
"status": "ok"
}
Deletes a Build given its unique identifier, and its Project handle.
curl -X DELETE -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE/build/BUILD_ID | jq
{
"status": "ok"
}
Downloads the build's UF2 file.
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/project/PROJECT_HANDLE/build/BUILD_ID > build.uf2
Raw UF2 file
Lists all of the microcontrollers/chips supported by this website. Device handles are required by the Project creation endpoint.
curl https://flashmypico.com/v1/api/devices
{
"devices": [
{
"handle": "pico",
"name": "Pico",
},
{
"handle": "pico_w",
"name": "Pico W",
},
{
"handle": "pico_2",
"name": "Pico 2",
}
],
"status": "ok"
}
Provides information on all the changes to the data associated with your profile.
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
{
"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"
}
Retrieves information on all of your registered boards, and their installed firmware.
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/boards
{
"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"
}
Retrieves information on a particular board, identified by BOARD_ID.
curl -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/board/BOARD_ID
{
"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"
}
Creates a new board entry.
Both of the parameters are required.
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
{
"board_id": "c5390391-f0c6-4849-a640-a33a1faffb62",
"status": "ok"
}
Updates board's assigned project.
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
{
"status": "ok"
}
Deletes a board.
curl -X DELETE -sH "Authorization: Bearer YOUR_API_KEY" https://flashmypico.com/v1/api/board/BOARD_ID
{
"status": "ok"
}