引言

适用于组织的 Connect允许多个用户共享对设备的访问权限,使用Raspberry Pi Connect.

组织中的设备支持 Connect 的所有功能,包括屏幕共享, 远程 Shell访问权限,以及远程更新。适用于组织的 Connect 还提供:

  • 带角色的共享访问。可以邀请用户成为成员或管理员。更多信息,请参阅管理用户.

  • 设备标签与搜索。可以按标签、型号、内存或操作系统来整理和查找设备。更多信息,请参阅为设备添加标签和搜索和筛选设备.

  • 资产库与自托管资产。可以多次部署同一更新,并自行托管资产以避免其过期。更多信息,请参阅部署远程更新.

  • 审计日志。可以查看组织内过去 90 天的活动记录。更多信息,请参阅查看审计日志.

  • 双因素认证要求。可以要求所有成员启用双因素认证。更多信息,请参阅要求启用双因素认证.

  • 配置。使用认证密钥或设备身份,在无需逐台登录的情况下连接设备,并一次性完成大量设备的配置。更多信息,请参阅配置设备.

  • 管理 API。自动管理设备、认证密钥、设备身份及更新。更多信息,请参阅管理 API.

创建您的第一个组织时,将自动为该组织启动为期四周的免费试用期。试用期结束后,组织将按月计费。更多信息,请参阅设置您的订阅.

角色

组织中的每位用户都具有以下角色之一:

  • 成员。可通过屏幕共享和远程 Shell 访问组织内的所有设备,但无法部署远程更新或对组织进行任何更改。

  • 管理员。可访问组织内的所有设备、部署远程更新,并对组织进行更改。管理员还会收到与敏感操作相关的全组织范围通知邮件,例如新增设备和新增管理 API 访问令牌等。

切换账户

如果您属于某个组织,Connect 网站每次仅显示一个账户:您的个人账户或其中一个组织账户。

要在不同账户之间切换,请选择导航菜单右上角的账户切换图标(两个相对的箭头),然后选择您要使用的账户。

The Raspberry Pi Connect interface, showing the account switcher dropdown menu, which lets you change between personal and organisation Connect accounts.
图 1. 账户切换器。

本指南中的操作步骤默认假设您已登录connect.raspberrypi.com并切换至您的组织,除非另有说明。

创建组织

  1. 登录到connect.raspberrypi.com.

  2. 选择账户切换图标在页面右上角。

    The Raspberry Pi Connect interface, showing the account switcher dropdown menu with the option to create a new organisation.
  3. 选择+新建组织,然后输入组织名称。

  4. 选择开始您的免费试用如果这是您的第一个组织,或者创建组织如果您之前已经创建过组织。

    Connect 会创建该组织,并将您添加为管理员。

如果您的个人账户已关联设备,Connect 会提示您将其转移到新组织。如需立即转移:

  1. 选择将所有设备转移到此组织链接。

    The Raspberry Pi Connect interface, showing a link to transfer devices from a personal account to the new organisation.

    该转移个人设备页面将打开,并要求您确认转移操作。

    The Raspberry Pi Connect interface, asking you to confirm the transfer of devices to an organisation.
  2. 选择个人设备链接以查看设备列表,或选择转移 x 台设备(其中x是设备数量)以确认。您转移的设备将成为该组织中的计费设备。

您也可以稍后转移设备。更多信息,请参见转移设备.

设置您的订阅

组织版 Connect 订阅将在您的四周试用期结束后开始。此后,您将按月后付费。如果在试用期结束前未设置订阅,您将无法远程访问该组织的设备,直到完成设置为止。

如果届时仍未设置账单信息,Connect 将删除该组织。试用期结束后约两周,Connect 会发送删除提醒;再过约两周,Connect 将删除该组织及其下的设备和成员关系。

您必须是管理员才能设置订阅。

  1. 选择设置账单点击页面顶部标签下方的试用横幅中的

  2. 输入用于接收账单等通知的电子邮件地址。

  3. 填写付款信息并提交:

    • 如果您的试用期尚未结束,按钮上显示的是开始试用您的试用期将继续,试用期结束后将开始按月计费。

    • 如果您的试用期已结束,按钮上会显示支付并订阅。您的按月订阅将立即生效。

The Connect billing page, showing the 28-day free trial and the payment details fields.
图2. 计费页面。

管理用户

您必须是管理员才能邀请用户、移除用户或更改用户的角色。

邀请用户

  1. 选择用户选项卡,然后选择邀请他人.

    The Users tab of an organisation in Connect, showing the organisation’s users.
  2. 选择一个角色。有关各角色的说明,请参阅角色.

  3. 输入要发送邀请的电子邮件地址。

  4. 选择发送邀请.

    The Invite user page, with a role dropdown menu, an email address field, and a Send invitation button.

系统会向您输入的地址发送一封包含邀请的电子邮件。用户可以点击邮件中的链接,并使用该电子邮件地址或任何其他 Raspberry Pi ID 登录。

移除用户

  1. 选择用户选项卡。

  2. 在您要移除的用户旁边,选择更多选项图标(三个竖排点),然后选择移除….

  3. 在确认窗口中,选择移除用户.

该用户将被立即从组织中移除。他们与组织设备正在进行的任何屏幕共享或远程 Shell 会话将在几分钟内结束。

更改用户的角色

  1. 选择用户选项卡。

  2. 在您要更改角色的用户旁边,选择更多选项图标(三个竖排点),然后选择更改角色….

  3. 选择新角色,然后选择更改角色.

管理组织中的设备

您必须是管理员才能将设备关联到组织。有三种方法可以实现:

您可以在个人账户与组织之间,或在不同组织之间转移设备。您必须是相关各组织的管理员。

转移设备

切换到当前拥有该设备的账户。

  1. 在设备页面的

  2. 中选择该设备。设备选项卡,然后选择设置危险区域

  3. 在转移设备…下,选择选择要转移至的目标账户,然后选择.

    The Transfer device dialog, showing the accounts that a device can be transferred to.
  4. 转移转移.

为设备添加标签

标签可以帮助您对设备进行分类和查找。例如,您可以按位置为设备添加标签(london, leeds), environment (production, staging), or function (point-of-sale, kiosk). Tags appear below the device name on the device page and in the device list.

您必须是管理员才能添加或删除标签。

  1. 中选择该设备。设备选项卡,然后选择设置危险区域

    The Edit tags field, showing applied tags and a dropdown menu of suggested tags.
  2. 在标签字段位于常规部分:

    • 要添加标签,请开始输入标签名称。从下拉菜单中选择一个已有标签,或者输入一个新的标签名称并选择创建.

    • 要移除标签,请选择该标签旁边的x。

  3. 选择更新设备.

每台设备最多可设置十个标签。标签名称长度不超过30个字符,且只能包含小写字母、数字、连字符和下划线。

要在设备关联时自动应用标签,请在用于关联的认证密钥或设备身份上设置标签。您可以在Connect 网站上创建认证密钥时设置标签和设备名称,或者通过管理 API 进行设置。认证密钥和设备身份.

搜索和筛选设备

设备列表顶部的搜索栏结合了自由文本搜索与筛选功能。

要按设备名称或序列号搜索,请在搜索栏中输入任意文本。结果会随着您的输入实时更新。

要按某个属性筛选,请输入限定词、冒号和对应的值:

限定词 筛选依据

model:

树莓派型号(例如,model:5, model:4b)

memory:

内存大小(例如,memory:4gb, memory:512mb)

os:

操作系统(例如,os:raspios-13)

tag:

标签(例如,tag:kiosk, tag:production)

[8] MiRo-Emodel:, memory:, and os: qualifiers only find devices running Connect client version 2.9.0 or later. To update Connect on your devices, see 更新客户端.

当您开始输入时,下拉菜单会提示可用的限定词和取值。选择一个限定词以查看其可选项,然后选择一个值将其添加为筛选条件。已应用的筛选条件会显示在搜索栏中。要移除某个筛选条件,请选择其旁边的x,或按下退格键.

您可以在一次搜索中同时使用筛选条件和自由文本。例如,model:5 tag:production dashboard finds Raspberry Pi 5 devices tagged production that have 'dashboard' in their name. If you use tag: more than once, Connect only finds devices that have 大家标签。例如,tag:production tag:kiosk finds devices that have both tags.

The device list with model and tag filters applied in the search bar.
图3:应用筛选条件后的设备列表。
在列表中的任意设备上选择一个标签,即可将其添加为筛选条件。

配置设备

预配功能可将设备关联到您的组织,而无需用户在Connect网站上登录。这对于没有显示屏的设备以及一次性设置大量设备的情况非常有用。

您可以通过以下两种方式之一对设备进行预配:

  • 认证密钥。一种用于关联单个设备的临时令牌。更多信息请参见授权密钥.

  • 设备身份。一种与设备一次性可编程(OTP)存储器中的私钥绑定的凭据,您可在设备部署前进行注册。更多信息请参见设备身份.

必须是管理员才能对设备进行预配。认证密钥和设备身份均会显示在组织的预配选项卡。

选择预配方法

表1:认证密钥与设备身份的对比
认证密钥 设备身份

相关链接

仅适用于单个设备。每个认证密钥只能使用一次。

与之对应的设备,即该身份所基于的私钥所属的设备。设备身份可以多次使用。

设备上的凭据

认证密钥,您在登录时将其提供给Connect客户端。

存储在设备OTP存储器中的私钥。

创建方式

在预配选项卡,或通过管理API。

仅可通过管理API创建,可以直接操作,也可以通过rpi-sb-provisioner.

计费

从设备与您的组织关联之时起。

创建设备身份是免费的。当设备首次向您的组织进行身份验证时,计费才会开始。

适用于

关联少量设备,或无显示屏的设备。

在部署设备之前预先准备大量设备。

两种方法都不会发送登录通知邮件。相反,每次登录都会记录在组织的审计日志中。.

授权密钥

身份验证密钥是一种一次性使用的临时令牌,用于将一台设备与您的组织关联。组织的身份验证密钥以rpoak_, expire between 1 and 90 days after you create them, and you can have several active at once. For more information about auth keys, and how to use one on a device, see 授权密钥.

开头。

您可以在身份验证密钥上设置设备名称和标签,以便在设备关联时自动应用这些信息。

  1. 选择预配选项卡。

  2. 在授权密钥部分,选择新建.

  3. 在 Connect 网站上创建身份验证密钥。

  4. 输入描述和有效期,范围为 1 至 90 天。(可选)在设备设置姓名下,为该密钥所关联的设备输入一个标签,并指定要应用的任何

  5. 选择。.

  6. 创建身份验证密钥。

    选择新生成的身份验证密钥旁边的复制图标将其复制。Connect 只会显示一次身份验证密钥,请立即复制,因为之后无法再次查看。

使用管理 API 创建身份验证密钥。

若要自动创建身份验证密钥,例如通过配置脚本,可以使用管理 API。.

设备身份

设备身份通过存储在设备一次性可编程(OTP)存储器中的私钥,将设备与您的组织关联起来,因此无需在设备上进行手动登录。与身份验证密钥不同,设备身份可以多次使用。

由于您只需在设备首次向您的组织进行身份验证时才付费,因此您可以在准备设备的同时注册设备身份,然后直接发货。每台设备在首次启动并连接到互联网时,就会与您的组织建立关联。

创建设备身份

您无法在 Connect 网站上创建设备身份。创建设备身份需要使用该设备的私钥进行签名,而私钥仅存在于设备本身中。请改用以下方法之一:

  • rpi-sb-provisioner.在每个设备完成配置时为其注册一个设备身份。有关更多信息,请参阅批量配置.

  • 管理 API。直接创建设备身份。有关更多信息,请参阅创建设备身份.

创建设备身份后,您可以在以下位置查看它们:预配选项卡。

批量配置

您可以依次为 Raspberry Pi 5 系列设备(Raspberry Pi 5、Raspberry Pi 500 和 Raspberry Pi 500+)进行配置,只需将其中一台 Raspberry Pi 5 系列设备设置为配置主机即可。该主机将操作系统镜像写入每台目标设备,并为其注册一个设备身份,同时将其与您的组织关联,这样设备在首次启动时便会自动连接到您的组织。

要求

  • 两台 Raspberry Pi 5 系列设备:一台用作主机,另一台作为接收设备。

  • 一个 Connect 组织账户,以及对该账户的管理员访问权限。

  • 一根以太网电缆,或用于在镜像中添加的无线网络凭据。– 断开 Pico.

  • 一根短而优质的 USB-A 转 USB-C 数据线,用于在配置过程中传输电源和数据。请勿使用质量较差、仅支持充电或过长的数据线,因为这些可能导致配置失败。

  • 对于接收设备:一张 32 GB 或更大的 microSD 卡,用于引导系统。

  • 对于主机设备:一张 32 GB 或更大的 microSD 卡。若希望加快配置速度,可改用一块 32 GB 或更大的 SSD。

步骤 1:准备设备

从主机和接收设备上拔下所有 USB 设备及 HAT 扩展板。这些设备会额外消耗电力,从而影响配置过程。

有关 rpi-sb-provisioner 的更多信息,请参阅安全启动配置.

步骤 2:在主机设备上安装 rpi-sb-provisioner

构建镜像会占用大量磁盘空间(每次构建需数 GB),且在 SSD 上的速度明显快于 microSD 卡。Raspberry Pi 500+ 或配备 M.2 HAT+ 的 Raspberry Pi 5 都是非常合适的主机。
  1. 更新主机设备上的软件和固件。如果出现提示,请输入密码。

    $ sudo apt update
    $ sudo apt upgrade
  2. 安装 Raspberry Pi 安全启动配置工具 (rpi-sb-provisioner) on the host device. Enter your password if prompted.

    $ sudo apt update
    $ sudo apt install rpi-sb-provisioner
  3. 在主机设备上,通过浏览器打开配置工具的 Web 界面,地址为http://localhost:3142.

    如果 Web 界面成功打开,rpi-sb-provisioner is installed correctly.

    The Raspberry Pi Secure Boot Provisioner web interface.
    Figure 4. The provisioner’s web interface.

Step 3: Install rpi-image-gen

rpi-image-gen builds the operating system image that the host writes to each recipient device.

  1. On the host device, clone the rpi-image-gen repository from GitHub:

    $ git clone https://github.com/raspberrypi/rpi-image-gen.git
  2. 进入克隆的目录并安装依赖。如果提示,请输入您的密码。

    $ cd rpi-image-gen
    $ sudo ./install_deps.sh

步骤4:配置并构建镜像

rpi-image-gen includes an example application, with layers and configuration, that builds an image compatible with remote updates. For more information, see 设置 A/B 启动更新.
  1. 前往rpi-image-gen directory.

  2. 定义在构建时要安装的任何其他软件包。有关更多信息,请参阅软件包.

  3. 添加无线网络凭据。有关更多信息,请参阅无线网络.

  4. 构建镜像,并为接收设备设置用户账户和密码。替换admin and the example password with your own:

    $ ./rpi-image-gen build -S ./examples/ota/ -c ota.yaml -- \
      IGconf_device_user1=admin \
      IGconf_device_user1pass='R@spb3rry*pi'

    rpi-image-gen saves a .tar.zst image file in the rpi-image-gen/work/deploy directory.

步骤5:导入镜像并配置配置器

  1. 在主机设备上,打开配置工具的Web界面,网址为:http://localhost:3142/options/get,或选择选项从界面顶部的选项卡中。

  2. 在在 OS Image框,选择上传新镜像,然后拖动.tar.zst file you built in Step 4 into the box. For example, rpi-image-gen/work/deploy-1.0.0/myapp-1.0.0.tar.zst.

    该图像出现在可用图像系统服务

    The provisioner web interface, showing OS images listed in the Available Images table.
    图5. 可用图像表,显示已上传的图像。
  3. 在……中选择图像可用图像系统服务

  4. 在在 Device & Firmware表中,选择以下内容:

    • 设备系列: 树莓派 5

    • 存储类型: SD卡

    • 设备固件: 2026-05-26

      The Device & Firmware table, showing the device type, storage type, and firmware settings for the recipient device.
      图6. “设备与固件”表格,用于设置接收设备的类型、存储和固件。
  5. 在Security Configuration 的表格中,选择裸机。这将为设备进行无加密的配置。

    The Security Configuration table of the provisioner web interface, with Naked selected.
    图7. 裸机安全配置。

配置工具会自动保存您的更改。

第6步:添加管理API访问令牌

配置工具使用管理API访问令牌,为每个接收设备在您的组织中注册设备身份。

  1. 创建管理API访问令牌在您的组织中生成,并将其复制。

    仅将访问令牌保留在主机设备上。切勿将其包含在写入接收设备的镜像中。
  2. 打开配置工具的Web界面,进入http://localhost:3142/options/get.

  3. 在云服务部分,将访问令牌粘贴到连接管理API访问令牌字段中输入新主机名。

    The Cloud Services section of the provisioner web interface, showing the field for the management API access token and an optional prefix field.
    中。图8. “云服务”部分,用于输入访问令牌。

第7步:将接收设备连接至主机设备

接下来,将接收设备置于USB启动模式,以便主机设备对其进行配置。

  1. 将线缆的USB-A端插入主机设备。

  2. 插入线缆的USB-C端时,请按住接收设备的电源键。待接收设备开机后,松开电源键。

    接收设备将显示在配置工具的Web界面中,配置过程将自动开始。

第8步:启动接收设备

当配置完成后:

  1. 将接收设备从主机设备上拔下。

  2. 将接收设备连接至其电源。

  3. 将以太网电缆连接到接收设备。

  4. 打开接收设备的电源。

当接收设备启动后,它会出现在 Connect 中您所在组织的设备选项卡中。

若要配置更多设备,请对每台设备重复步骤 7 和 8。

部署远程更新

您可以使用 Connect 的远程更新功能向您组织内的设备推送更新。向组织内设备部署与向个人设备部署的方式大致相同,只存在以下差异:[12] 组织会保存一个

  • 一个组织保留一个工件库,您可以多次从中部署工件。

  • 除了上传工件外,您还可以自行托管工件,这样在等待设备上线期间,工件不会过期。

  • 您可以通过管理 API。.

只有管理员才能部署远程更新并管理更新工件。

要部署更新:

  1. 按照“构建脚本工件”中的说明构建更新工件。选择向 Connect 提供工件的方式:或设置 A/B 启动更新.

  2. 上传工件。

    • Connect 会为您存储该文件。上传文件的大小上限为 2 GB,且在上传后两小时内过期。如果设备在此时间内未开始部署,则将无法收到该更新。Connect 会为您存储该文件。上传文件的大小上限为 2 GB,且在上传后两小时后到期。如果设备在此时间内未开始部署,则将无法接收该文件。

    • 自行托管您的工件。您将文件存储在接收设备可以下载的位置,并将该位置提供给 Connect。请参阅托管更新工件。您自行托管的工件不会过期,因此对于可能离线超过两小时的设备,或需要随时间向多台设备部署同一工件的情况,请选择此选项。

  3. 您还可以选择,在部署前将工件添加到库中。。

  4. 部署工件.

托管更新工件

当您自行托管工件时,Connect 不会存储该文件。相反,您只需向 Connect 提供文件的位置,Connect 会将其传递给接收设备,由设备直接下载该文件。

您可以在接收设备能够访问的任何位置托管工件:您自己的 Web 服务器、S3 存储桶、FTP 或 SFTP 服务器,或者使用以下方式在接收设备本身上的某个路径:file:// URI. Remote update supports HTTP, HTTPS, FTP, SFTP, and file URIs.

该位置必须能被接收设备访问,但无需能被 Connect 服务器或互联网访问。例如,您可以从与接收设备位于同一本地网络的另一台计算机上提供工件。

  • 主机 IP 地址:192.168.0.1

  • 端口:8080

  • 路径:/path/to/app.update.tar.zst

您还需要工件的 SHA-256 校验和。Connect 会将其传递给设备,设备会用它来验证工件在传输过程中是否被损坏或篡改。otamaker prints the checksum when it builds a script artefact; for other artefacts, calculate it with sha256sum.

请记下 URI 和校验和。部署工件时您需要同时使用这两项信息。

示例:从树莓派提供工件

此示例从与接收设备位于同一网络的树莓派上提供更新工件。

  1. 在主机树莓派上,启动一个 HTTP 服务器,将目录替换为您存放工件的目录:

    $ python -m http.server 8080 --directory ./work/image-myapp
  2. 计算工件的 SHA-256 校验和,然后记下:

    $ sha256sum ./work/image-myapp/myapp-update.tar.zst
  3. 查找主机在本地网络中的 IP 地址,然后记下以便在工件的 URI 中使用:

    $ hostname -I

管理工件库

该远程更新选项卡列出了您组织的工件库。当您在部署过程中创建工件时,Connect 会自动将其添加到库中。

在部署工件之前,要将其添加到库中,请转到远程更新选项卡,选择新建,然后执行以下操作之一:

  • Connect 会为您存储该文件。上传文件的大小上限为 2 GB,且在上传后两小时内过期。如果设备在此时间内未开始部署,则将无法收到该更新。按照“上传工件,然后选择上传工件.

  • 自行托管您的工件。”中的说明,输入名称并选择文件;或者输入名称、URI 和 SHA-256 校验和,然后选择保存工件.

The Host your own artefact screen, showing the Name, URI, and SHA-256 checksum fields.
图9. “托管您自己的工件”界面,显示必填字段:名称、URI 和 SHA-256 校验和。

对于已上传的工件,库会显示每个工件的过期时间时间,或其过期时间。过期的工件仍保留在库中,以便您可以查看已部署的内容,但无法再次部署。如需再次部署同一文件,请重新上传。

工件一旦被部署或尝试部署后,便无法删除。这样做是为了保留部署记录,以防您的账户遭到入侵。

部署工件

  1. 前往设备选项卡,然后选择部署收件设备旁边的按钮。

    部署该按钮仅对已开启远程更新.

    The Connect Devices tab, showing a list of devices, one of which has a Deploy button next to it.
    的设备显示。图10. 设备列表为已开启远程更新的设备显示“部署”按钮。
  2. 在新部署界面中,选择以下选项之一,然后选择下一步:

    • 使用现有工件。从库中选择一个工件。每个工件会显示其名称、校验和的前几个字符、URI 或文件名及大小,对于已上传的工件,还会显示距离过期的时间。已过期的工件不会显示。

    • Connect 会为您存储该文件。上传文件的大小上限为 2 GB,且在上传后两小时内过期。如果设备在此时间内未开始部署,则将无法收到该更新。按照“上传工件.

    • 自行托管您的工件。输入名称、URI 和 SHA-256 校验和。

      Step 1 of the New deployment screen in Connect, showing the options to use an existing artefact, upload an artefact, or host your own artefact.
      图11. “新部署”界面,提供使用现有工件、上传工件或托管自定义工件的选项。
  3. 在第2步:查看并部署,检查工件的详细信息,然后选择部署.

    对于已上传的工件,此步骤还会显示文件的过期时间。只有在接收设备在此前上线并下载该文件的情况下,部署才会成功。如果该设备已有待处理的部署任务,此步骤会提示您,继续部署将取消原有任务。

要跟踪部署进度,请参阅监控部署.

查看审计日志

审计日志会列出您组织在过去90天内的所有活动,按时间倒序排列。事件包括设备、组织成员和API访问令牌的变更,以及远程访问会话的启动。Connect会在90天后删除这些事件。

您必须是管理员才能查看审计日志。

要查看审计日志,请选择审计日志选项卡。

The Audit log tab, showing the Actions filter dropdown menu and a list of events.

每个事件包含:

  • 时间戳。事件发生的时间。

  • 来源。事件是在Connect网站上发生,还是通过API触发。

  • 操作。发生了什么(例如,创建了API访问令牌),并附有详细信息。

  • 主体。操作所影响的对象,如设备、组织或访问令牌。

  • 执行者。执行操作的用户,以及其所在国家。

若要按操作类型筛选事件(例如,启动了远程Shell会话),请选择行动……旁边的下拉菜单筛选器,在列表上方。

要将列表下载为 CSV 文件,请选择下载 CSV,在列表上方。

更改组织设置

管理员可以从以下位置更改相关设置:设置选项卡。

The Settings tab of an organisation, showing the organisation name and other settings.
图 12. 组织的“设置”选项卡。

重命名组织

在“”部分输入新名称。重命名组织不会影响其设备或成员。常规您可以要求组织中的所有成员为其 Raspberry Pi ID 启用双重身份验证(2FA)。这有助于防止被入侵的成员账户被用于访问您组织的设备。

要求启用双因素认证

要启用 2FA:

将会显示一条通知,确认设置已更新。

  1. 选择设置选项卡,然后选择要求启用双因素认证.

    这将启动一个为期 14 天的宽限期,在此期间,尚未设置 2FA 的成员会看到一个提示横幅,要求他们进行设置。宽限期结束后,仍未设置 2FA 的成员将无法访问您组织的设备或其他资源,直到他们为自己的 Raspberry Pi ID 启用 2FA 为止。

    The Authentication section of the organisation settings, showing the Require two-factor authentication button.

图 13. “需要双重身份验证”页面。

The Two-factor authentication required page shown to members without 2FA after the grace period ends, with a link to set up 2FA for their Raspberry Pi ID.
要取消强制使用 2FA:

取消强制使用双重身份验证

  1. 选择设置选项卡,然后选择如果先取消强制使用 2FA,然后再重新启用,则 14 天的宽限期将再次开始。.

    这将启动一个为期 14 天的宽限期,在此期间,尚未设置 2FA 的成员会看到一个提示横幅,要求他们进行设置。宽限期结束后,仍未设置 2FA 的成员将无法访问您组织的设备或其他资源,直到他们为自己的 Raspberry Pi ID 启用 2FA 为止。

创建管理 API 访问令牌

管理 API 访问令牌使您能够使用

自动管理您的组织,例如创建认证密钥和设备身份、管理设备以及部署更新。管理 API。管理 API 访问令牌相当于您组织中管理员的用户名和密码。它可以管理组织中的每台设备、每个认证密钥和每个设备身份。请将其保存在调用管理 API 的计算机上,例如配置工作站或持续集成系统。切勿将其包含在 Raspberry Pi OS 镜像中,也不要将其复制到任何设备上。要对设备本身进行身份验证,请使用特定于设备的凭据,例如

,这些凭据在认证密钥或设备身份选项卡中进行管理。预配[24] API 访问令牌
  1. 在API 访问令牌部分,选择新建.

  2. 输入访问令牌的描述,然后选择创建访问令牌.

  3. 选择新访问令牌旁边的剪贴板图标以复制它。

    Connect 只会显示一次访问令牌。请立即复制,因为之后无法再次查看。

管理 API

管理 API 可让您自动管理您的组织,而无需使用 Connect 网站。您可以使用它来:

只有管理员才能创建管理 API 访问令牌。

身份验证

使用管理 API 访问令牌对每个请求进行身份验证,将其作为 Bearer 令牌在Authorization header:

Authorization: Bearer rporg_accesstokenhere

如果访问令牌无效,您将收到401 未授权响应。每个请求还可能返回403 禁止访问,如果组织被封禁,或者未接受更新后的 Connect 条款。

所有请求的基础 URL 为https://api.connect.raspberrypi.com.

速率限制

每个管理 API 访问令牌每小时最多可发起 5,000 个请求。该限制按固定的一小时窗口计算:计数器在每小时开始时重置,无论您在该小时内何时发起第一个请求。

对已验证请求的每个响应都包含以下标头,以便您跟踪使用情况:

X-Rate-Limit-Limit

每小时允许的最大请求数。

X-Rate-Limit-Remaining

当前小时内剩余的请求数。

X-Rate-Limit-Reset

当前小时结束并重置计数器前的剩余秒数。

例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8
X-Rate-Limit-Limit: 5000
X-Rate-Limit-Remaining: 4999
X-Rate-Limit-Reset: 3600

如果超出限制,您将收到一个429 请求过多响应,其中包含相同的标头。请等待X-Rate-Limit-Reset before retrying. For example:

HTTP/2 429
X-Rate-Limit-Limit: 5000
X-Rate-Limit-Remaining: 0
X-Rate-Limit-Reset: 1800

Throttled
使用无效访问令牌发出的请求仍计入该令牌的限额,但响应中不包含速率限制标头。

设备身份

使用这些请求来创建和管理设备身份。有关设备身份的定义及使用时机,请参阅设备身份.

创建设备身份

请求必须包含一个X-Connect-Identity-Signature header. To generate it, construct a newline-separated payload containing, in this order:

  • HTTP 请求方法(例如,POST)

  • 完整的请求 URL

  • Authorization: <value>

  • Content-Type: <value>

  • Accept: <value> (if your HTTP client sends one)

  • HTTP 请求正文的 SHA256 十六进制摘要(POST shown below)

使用 ECDSA 和 SHA256 算法通过设备的私钥对此有效负载进行签名,然后对结果进行 Base64 编码。

例如,注册设备身份的请求会生成以下有效负载:

POST
https://api.connect.raspberrypi.com/organisation/device-identities
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json
Accept: */*
<SHA256 hex digest of the HTTP request body>

在设备上,使用rpi-fw-crypto对有效负载进行签名。例如,将有效负载写入payload.txt:

$ rpi-fw-crypto sign --in payload.txt --key-id 1 --alg ec | base64 -w 0

输出结果为X-Connect-Identity-Signature header value.

要为您的组织创建设备身份,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • signaturehere: the X-Connect-Identity-Signature value for this request.

  • -----BEGIN PUBLIC KEY-----...: the device’s PEM-encoded public key.

  • my-device-identity: a description for the device identity, visible in the organisation’s audit log.

  • pi5-001: the name assigned to the device when the identity is exchanged (optional, defaults to the device’s hostname).

  • production, kiosk: (optional) tags applied to the device when the identity is exchanged. Each tag must contain only lowercase letters, numbers, hyphens, and underscores, with a maximum length of 30 characters. You can apply up to ten tags per device identity.

JSON
POST /organisation/device-identities HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json
X-Connect-Identity-Signature: signaturehere

{
    "public_key": "-----BEGIN PUBLIC KEY-----...",
    "description": "my-device-identity",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"]
}
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' --header 'X-Connect-Identity-Signature: signaturehere' --header 'Content-Type: application/json' --data '{"public_key":"-----BEGIN PUBLIC KEY-----...","description":"my-device-identity","device_name":"pi5-001","tags":["production","kiosk"]}' https://api.connect.raspberrypi.com/organisation/device-identities

如果成功,您将收到一个201 已创建响应,其中包含 JSON 格式的设备标识。例如:

HTTP/2 201
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-device-identity",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"],
    "created_at": "2026-02-25T16:09:52Z",
    "public_key": "-----BEGIN PUBLIC KEY-----..."
}

响应包含以下字段:

id

设备标识的唯一标识符。

描述

用于创建设备标识的描述。

device_name

交换标识时分配给设备的名称。

tags

交换标识时应用于设备的标签。

created_at

创建设备标识的日期和时间(采用 ISO 8601 格式)。

public_key

设备标识的 PEM 编码公钥。

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

422 无法处理的实体

无法创建设备标识。

{"message":"Validation failed: Public key is invalid"}

列出设备标识

要列出您组织中的所有设备标识,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

HTTP
GET /organisation/device-identities HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/device-identities

如果成功,您将收到一个200 OK响应,包含该组织最多 100 个设备身份,按描述字母顺序排序,采用 JSON 格式。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "device_identities": [
        {
            "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
            "description": "my-device-identity",
            "device_name": "pi5-001",
            "tags": [],
            "created_at": "2026-02-25T16:09:52Z",
            "public_key": "-----BEGIN PUBLIC KEY-----..."
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 100,
        "total_count": 1,
        "total_pages": 1
    }
}

响应包含以下字段:

device_identities

组织中的设备身份列表(每页最多 100 个)。

meta

分页详情。

中的每一项device_identities list contains the following fields:

id

设备标识的唯一标识符。

描述

用于创建设备标识的描述。

device_name

交换标识时分配给设备的名称。

tags

交换标识时应用于设备的标签。

created_at

创建设备标识的日期和时间(采用 ISO 8601 格式)。

public_key

设备标识的 PEM 编码公钥。

该meta object contains the following fields:

主页

响应的当前页码。

per_page

每页的设备身份数量(最多 100 个)。

总计数

组织中的设备身份总数。

总页数

组织的设备身份总页数。

如果管理 API 访问令牌无效,您将收到一个401 未授权响应。

该page and per_page query parameters work the same way as for 列出设备.

显示设备身份

要显示组织中的单个设备身份,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-identity-id: the unique identifier for the device identity.

HTTP
GET /organisation/device-identities/device-identity-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/device-identities/device-identity-id

如果成功,您将收到一个200 OK响应,其中包含 JSON 格式的设备身份详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-device-identity",
    "device_name": "pi5-001",
    "tags": [],
    "created_at": "2026-02-25T16:09:52Z",
    "public_key": "-----BEGIN PUBLIC KEY-----..."
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该设备身份。

更新设备身份

要更新组织中的现有设备身份,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-identity-id: the unique identifier for the device identity.

  • my-renamed-device-identity: the new description for the device identity.

  • pi5-001: the new name that is assigned to the device when the identity is exchanged (optional).

  • production, kiosk: tags applied to the device when the identity is exchanged (optional).

JSON
PATCH /organisation/device-identities/device-identity-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json

{
    "description": "my-renamed-device-identity",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"]
}
curl
$ curl --request PATCH --header 'Authorization: Bearer rporg_accesstokenhere' --header 'Content-Type: application/json' --data '{"description":"my-renamed-device-identity","device_name":"pi5-001","tags":["production","kiosk"]}' https://api.connect.raspberrypi.com/organisation/device-identities/device-identity-id

如果成功,您将收到一个200 OK以 JSON 格式返回更新后的设备身份:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-renamed-device-identity",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"],
    "created_at": "2026-02-25T16:09:52Z",
    "public_key": "-----BEGIN PUBLIC KEY-----..."
}
一旦设备身份已兑换为设备,只有description can be updated. Any device_name or tags values in the request body are ignored, because those fields are only applied when the identity is first exchanged.

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该设备身份。

422 无法处理的实体

设备身份无法更新。

{"message":"Validation failed: Description can't be blank"}

删除设备身份

要删除组织中的设备身份,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-identity-id: the unique identifier for the device identity.

HTTP
DELETE /organisation/device-identities/device-identity-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --request DELETE --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/device-identities/device-identity-id

如果该设备身份已兑换为设备,关联的设备也将被删除并从 Raspberry Pi Connect 中注销。

如果成功,您将收到一个200 OK以 JSON 格式返回包含已删除设备身份详细信息的响应。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-device-identity",
    "device_name": "pi5-001",
    "tags": [],
    "created_at": "2026-02-25T16:09:52Z",
    "public_key": "-----BEGIN PUBLIC KEY-----..."
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该设备身份。

授权密钥

使用这些请求来创建和管理授权密钥,这些密钥可将单个设备链接到您的组织。若要在 Connect 网站上创建授权密钥,请参阅创建授权密钥.

创建授权密钥

要创建授权密钥以将设备与 Connect 关联,请使用管理 API 访问令牌发出以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • my-auth-key: a description for your auth key.

  • 1: how many days until the auth key expires, between 1 and 90 (optional, defaults to 1 day).

  • pi5-001: name used when adding devices with this key (optional, defaults to the device’s hostname).

  • production, kiosk: tags applied to the device when the auth key is exchanged (optional). Each tag must contain only lowercase letters, numbers, hyphens, and underscores, with a maximum length of 30 characters. You can apply up to 10 tags per auth key.

JSON
POST /organisation/auth-keys HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json

{
    "description": "my-auth-key",
    "ttl_days": 1,
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"]
}
HTTP
POST /organisation/auth-keys HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/x-www-form-urlencoded

description=my-auth-key&ttl_days=1&device_name=pi5-001&tags[]=production&tags[]=kiosk
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' --data-urlencode 'description=my-auth-key' --data-urlencode 'ttl_days=1' --data-urlencode 'device_name=pi5-001' --data-urlencode 'tags[]=production' --data-urlencode 'tags[]=kiosk' https://api.connect.raspberrypi.com/organisation/auth-keys

如果成功,您将收到一个201 已创建以 JSON 格式返回包含您的授权密钥的响应。例如:

HTTP/2 201
Content-Type: application/json; charset=utf-8

{
    "id": "12345",
    "description": "my-auth-key",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"],
    "secret": "rpoak_123456",
    "expires_at": "2025-01-01T00:00:30Z",
    "exchanged_at": null,
    "created_at": "2024-12-31T00:00:30Z"
}

响应包含以下字段:

id

授权密钥的唯一标识符。

描述

创建授权密钥时使用的描述。

device_name

兑换授权密钥时分配给设备的名称。

tags

兑换授权密钥时应用于设备的标签。

密钥

一个随机令牌,前缀为rpoak_.

过期时间

密钥过期的日期和时间(采用 ISO 8601 格式)。

兑换时间

兑换授权密钥以关联设备的日期和时间(采用 ISO 8601 格式),或null if it hasn’t been exchanged yet.

created_at

创建身份验证密钥的日期和时间(采用 ISO 8601 格式)。

该secret can then be used to 将设备与 Connect 关联在其过期前。

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

422 无法处理的实体

无法创建身份验证密钥。

{"message":"Validation failed: Description can't be blank"}

列出身份验证密钥

要列出组织中的所有身份验证密钥,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

HTTP
GET /organisation/auth-keys HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/auth-keys

如果成功,您将收到一个200 OK响应,其中包含采用 JSON 格式的最多 100 个组织身份验证密钥,排序方式为:首先显示可用的身份验证密钥,其次是已过期的,最后是已交换的身份验证密钥,每组内按时间从近到远排序。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "auth_keys": [
        {
            "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
            "description": "my-auth-key",
            "device_name": "pi5-001",
            "tags": ["production", "kiosk"],
            "expires_at": "2026-02-26T16:09:52Z",
            "exchanged_at": null,
            "created_at": "2026-02-25T16:09:52Z"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 100,
        "total_count": 1,
        "total_pages": 1
    }
}

响应包含以下字段:

认证密钥

组织中的身份验证密钥列表(每页最多 100 个)。

meta

分页详情。

中的每一项auth_keys list contains the following fields:

id

授权密钥的唯一标识符。

描述

创建授权密钥时使用的描述。

device_name

兑换授权密钥时分配给设备的名称。

tags

兑换授权密钥时应用于设备的标签。

过期时间

密钥过期的日期和时间(采用 ISO 8601 格式)。

兑换时间

兑换授权密钥以关联设备的日期和时间(采用 ISO 8601 格式),或null if it hasn’t been exchanged yet.

created_at

创建身份验证密钥的日期和时间(采用 ISO 8601 格式)。

[8] MiRo-Esecret is only included in the response when an auth key is first created and can’t be viewed again later.

该meta object contains the following fields:

主页

响应的当前页码。

per_page

每页的身份验证密钥数量(最多 100 个)。

总计数

组织中的身份验证密钥总数。

总页数

组织身份验证密钥的总页数。

如果管理 API 访问令牌无效,您将收到一个401 未授权响应。

该page and per_page query parameters work the same way as for 列出设备.

显示身份验证密钥

要显示组织中的单个身份验证密钥,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • auth-key-id: the unique identifier for the auth key.

HTTP
GET /organisation/auth-keys/auth-key-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/auth-keys/auth-key-id

如果成功,您将收到一个200 OK响应,其中包含采用 JSON 格式的身份验证密钥详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-auth-key",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"],
    "expires_at": "2026-02-26T16:09:52Z",
    "exchanged_at": null,
    "created_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该身份验证密钥。

更新身份验证密钥

要更新组织中的现有身份验证密钥,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • auth-key-id: the unique identifier for the auth key.

  • my-renamed-auth-key: the new description for the auth key.

  • pi5-001: the new name that is assigned to the device when the auth key is exchanged (optional).

  • production, kiosk: tags applied to the device when the auth key is exchanged (optional).

JSON
PATCH /organisation/auth-keys/auth-key-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json

{
    "description": "my-renamed-auth-key",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"]
}
curl
$ curl --request PATCH --header 'Authorization: Bearer rporg_accesstokenhere' --header 'Content-Type: application/json' --data '{"description":"my-renamed-auth-key","device_name":"pi5-001","tags":["production","kiosk"]}' https://api.connect.raspberrypi.com/organisation/auth-keys/auth-key-id

如果成功,您将收到一个200 OK响应,其中包含采用 JSON 格式的更新后的身份验证密钥:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-renamed-auth-key",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"],
    "expires_at": "2026-02-26T16:09:52Z",
    "exchanged_at": null,
    "created_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该身份验证密钥。

422 无法处理的实体

该身份验证密钥已过期或已被交换。

{"message":"This auth key can no longer be edited."}

422 无法处理的实体

由于任何其他原因无法更新该身份验证密钥。

{"message":"Validation failed: Description can't be blank"}

删除身份验证密钥

要删除组织中的身份验证密钥,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • auth-key-id: the unique identifier for the auth key.

HTTP
DELETE /organisation/auth-keys/auth-key-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --request DELETE --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/auth-keys/auth-key-id

您可以删除任何身份验证密钥,包括已过期或已被交换的密钥。删除已交换的身份验证密钥不会影响关联的设备。

如果成功,您将收到一个200 OK响应,其中包含采用 JSON 格式的已删除身份验证密钥的详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "096ce472-2cbd-412a-8295-6c03a1a07ba4",
    "description": "my-auth-key",
    "device_name": "pi5-001",
    "tags": ["production", "kiosk"],
    "expires_at": "2026-02-26T16:09:52Z",
    "exchanged_at": null,
    "created_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该身份验证密钥。

设备

使用这些请求来列出、查看、更新和删除组织中的设备。

列出设备

要列出组织中的所有设备,请使用管理 API 访问令牌发出以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

HTTP
GET /organisation/devices HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/devices

如果成功,您将收到一个200 OK响应以 JSON 格式返回组织中按名称字母顺序排序的最多 100 台设备。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "devices": [
        {
            "id": "69739b44-ebb2-468e-9e24-08126dec4925",
            "name": "raspberrypi5",
            "serial_number": "ea636879c4d47a37",
            "tags": ["production", "kiosk"],
            "board": {
                "model": "Raspberry Pi 5",
                "revision": "1.0",
                "memory": "8 GB"
            },
            "os": {
                "name": "Raspberry Pi OS",
                "version": "13 (Trixie)"
            },
            "kernel_architecture": "aarch64",
            "filters": {
                "model": "5",
                "memory": "8gb",
                "os": "raspios-13"
            }
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 100,
        "total_count": 1,
        "total_pages": 1
    }
}

响应包含以下字段:

设备

组织中的设备列表(每页最多 100 台)。

meta

分页详情。

中的每一项devices list contains the following fields:

id

设备的唯一标识符。

名称

设备名称。

序列号

设备的序列号。

tags

应用于设备的标签。

板

设备的板卡型号、修订版和内存。null if unknown.

操作系统

设备上运行的操作系统名称和版本。null if unknown.

内核架构

设备报告的内核架构(例如,aarch64). null if unknown.

过滤器

与此设备匹配的限定符,用于配合query parameter (see below). Only includes attributes that are known for the device, so this object might be empty.

该board, os, kernel_architecture, and filters fields are only populated for devices running Connect client version 2.9.0 or later.

该meta object contains the following fields:

主页

响应的当前页码。

per_page

每页的设备数量(最多 100)。

总计数

组织中的设备总数。

总页数

组织设备的总页数。

如果管理 API 访问令牌无效,您将收到一个401 未授权响应。

要获取后续页面的设备,请使用page parameter in the query string:

HTTP
GET /organisation/devices?page=2 HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' 'https://api.connect.raspberrypi.com/organisation/devices?page=2'

要更改每页返回的设备数量,请使用per_page parameter in the query string (with a maximum of 100):

HTTP
GET /organisation/devices?per_page=10 HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' 'https://api.connect.raspberrypi.com/organisation/devices?per_page=10'

要过滤返回的设备,请使用query parameter in the query string. This accepts the same syntax as the Web 界面中的搜索栏,结合自由文本搜索与结构化过滤条件:

  • 自由文本匹配设备名称和序列号。

  • 该model:, memory:, os:, and tag: qualifiers filter by a specific attribute (for example, model:5 or tag:production).

您可以在单个查询中组合多个过滤器和自由文本。该值必须进行 URL 编码,包括词项之间的空格。

例如,要查找带有以下标签的 Raspberry Pi 5 设备:production:

HTTP
GET /organisation/devices?query=model%3A5%20tag%3Aproduction HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' --get --data-urlencode 'query=model:5 tag:production' https://api.connect.raspberrypi.com/organisation/devices

该query parameter composes with the page and per_page parameters, so you can paginate through a filtered list.

该filters object returned for each device lists the exact qualifier values that match it, so you can use those values to build a query. For example, a device with "os": "raspios-13" in its filters matches the query os:raspios-13.

该model: qualifier accepts the following values:

价值感 模型

a

树莓派A型

b

树莓派B型

a+

树莓派 A+

b+

、每个单元配备一个摄像头模块(一个是

2b

树莓派2B

cm1

树莓派 CM1

3b

树莓派3B

zero

树莓派 Zero

cm3

树莓派 CM3

zerow

树莓派 Zero W

3b+

树莓派 3B+

3a+

树莓派 3A+

cm3+

树莓派 CM3+

4b

树莓派4B

zero2w

树莓派 Zero 2 W

400

树莓派400

cm4

树莓派 CM4

cm4s

树莓派 CM4S

5

树莓派 5

cm5

树莓派 CM5

500

树莓派500

cm5lite

树莓派 CM5 Lite

cm0

树莓派 CM0

该memory: qualifier accepts the following values:

价值感 内存

256mb

total RAM

512mb

256 MB

1gb

1 GB

2gb

2 GB

4gb

4 GB

8gb

8 GB

16gb

16 GB

与 Web 界面一样,model:, memory:, and os: qualifiers only match devices running Connect client version 2.9.0 or later.

显示设备

要显示您组织中的单个设备,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-id: the unique identifier for your device.

HTTP
GET /organisation/devices/device-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/devices/device-id

如果成功,您将收到一个200 OK响应将以 JSON 格式返回设备的详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "69739b44-ebb2-468e-9e24-08126dec4925",
    "name": "raspberrypi5",
    "serial_number": "ea636879c4d47a37",
    "tags": ["production", "kiosk"],
    "board": {
        "model": "Raspberry Pi 5",
        "revision": "1.0",
        "memory": "8 GB"
    },
    "os": {
        "name": "Raspberry Pi OS",
        "version": "13 (Trixie)"
    },
    "kernel_architecture": "aarch64",
    "filters": {
        "model": "5",
        "memory": "8gb",
        "os": "raspios-13"
    }
}

该响应包含与列表中每个项目相同的字段:devices list returned when you list devices. The board, os, kernel_architecture, and filters fields are only populated for devices running Connect client version 2.9.0 or later.

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到给定的设备 ID。

更新设备

要更新组织中设备的名称或标签,请使用管理 API 访问令牌发起以下 HTTP 请求。

这两个字段均为可选:请求正文中省略的任何字段均保持不变。

该tags field replaces the device’s existing tags, so include any tags you want to keep. Tag names must be 30 characters or fewer and can only contain lowercase letters, numbers, hyphens, and underscores. Each device supports up to ten tags.

要移除所有标签,请传递一个空列表("tags": []).

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-id: the unique identifier for your device.

  • raspberrypi5: the new name for the device (optional).

  • production, kiosk: the new tags for the device (optional).

JSON
PATCH /organisation/devices/device-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json

{
    "name": "raspberrypi5",
    "tags": ["production", "kiosk"]
}
curl
$ curl --request PATCH --header 'Authorization: Bearer rporg_accesstokenhere' --header 'Content-Type: application/json' --data '{"name":"raspberrypi5","tags":["production","kiosk"]}' https://api.connect.raspberrypi.com/organisation/devices/device-id

如果成功,您将收到一个200 OK响应,其中包含 JSON 格式的更新后的设备信息:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "69739b44-ebb2-468e-9e24-08126dec4925",
    "name": "raspberrypi5",
    "serial_number": "ea636879c4d47a37",
    "tags": ["production", "kiosk"],
    "board": {
        "model": "Raspberry Pi 5",
        "revision": "1.0",
        "memory": "8 GB"
    },
    "os": {
        "name": "Raspberry Pi OS",
        "version": "13 (Trixie)"
    },
    "kernel_architecture": "aarch64",
    "filters": {
        "model": "5",
        "memory": "8gb",
        "os": "raspios-13"
    }
}

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到给定的设备 ID。

422 无法处理的实体

无法更新该设备。

{"message":"Validation failed: Name can't be blank"}

删除设备

要删除组织中的设备并使其退出 Raspberry Pi Connect,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-id: the unique identifier for your device.

HTTP
DELETE /organisation/devices/device-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --request DELETE --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/devices/device-id

如果成功,您将收到一个200 OK响应,其中包含 JSON 格式的已删除设备详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "69739b44-ebb2-468e-9e24-08126dec4925",
    "name": "raspberrypi5",
    "serial_number": "ea636879c4d47a37",
    "tags": ["production", "kiosk"],
    "board": {
        "model": "Raspberry Pi 5",
        "revision": "1.0",
        "memory": "8 GB"
    },
    "os": {
        "name": "Raspberry Pi OS",
        "version": "13 (Trixie)"
    },
    "kernel_architecture": "aarch64",
    "filters": {
        "model": "5",
        "memory": "8gb",
        "os": "raspios-13"
    }
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到给定的设备 ID。

物品

使用这些请求来管理组织的工件库.

列出工件

要列出组织中所有远程更新工件,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

HTTP
GET /organisation/artefacts HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/artefacts

如果成功,您将收到一个200 OK响应,其中包含 JSON 格式的最多 100 个组织工件,按名称字母顺序排序,然后按创建时间排序,最旧的排在最前。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "artefacts": [
        {
            "id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
            "name": "kiosk-v1.0",
            "type": "uri",
            "uri": "https://example.com/kiosk-v1.0.tar.zst",
            "checksum": "d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6",
            "expires_at": null,
            "created_at": "2026-02-25T16:09:52Z"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 100,
        "total_count": 1,
        "total_pages": 1
    }
}

每个工件包含以下字段:

id

工件的唯一标识符。

名称

工件的名称。名称在组织内无需唯一。

类型

工件的提供方式:uri for an artefact you 自行托管,或file for an artefact uploaded to Connect.

统一资源标识符

设备下载工件的位置。对于上传的工件,这是指向已上传文件的链接,或null once Connect has deleted the file.

校验和

工件的十六进制编码 SHA-256 校验和。

过期时间

上传的工件过期且无法再部署的日期和时间(采用 ISO 8601 格式),或null for an artefact you host yourself.

created_at

创建制品的日期和时间(采用 ISO 8601 格式)。

若要筛选返回的制品,请使用name parameter in the query string. This performs a case-insensitive prefix match against the artefact name:

HTTP
GET /organisation/artefacts?name=kiosk HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' --get --data-urlencode 'name=kiosk' https://api.connect.raspberrypi.com/organisation/artefacts

该page and per_page query parameters work the same way as for 列出设备,并与name parameter so you can paginate through a filtered list.

如果管理 API 访问令牌无效,您将收到一个401 未授权响应。

显示制品

若要显示您组织中的单个远程更新制品,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • artefact-id: the unique identifier for the artefact.

HTTP
GET /organisation/artefacts/artefact-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/artefacts/artefact-id

如果成功,您将收到一个200 OK响应,其中包含制品的details。,采用 JSON 格式。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
    "name": "kiosk-v1.0",
    "type": "uri",
    "uri": "https://example.com/kiosk-v1.0.tar.zst",
    "checksum": "d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6",
    "expires_at": null,
    "created_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中找不到给定的制品 ID。

创建制品

若要为您的组织创建远程更新制品,请使用管理 API 访问令牌发起以下 HTTP 请求。

管理 API 只能创建您自行托管。若要上传制品,请使用远程更新选项卡.

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • kiosk-v1.0: a name for the artefact. Names don’t have to be unique within the organisation.

  • https://example.com/kiosk-v1.0.tar.zst: the URI from which devices download the artefact.

  • d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6: the hex-encoded SHA-256 checksum of the artefact.

JSON
POST /organisation/artefacts HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json

{
    "name": "kiosk-v1.0",
    "uri": "https://example.com/kiosk-v1.0.tar.zst",
    "checksum": "d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6"
}
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' --data-urlencode 'name=kiosk-v1.0' --data-urlencode 'uri=https://example.com/kiosk-v1.0.tar.zst' --data-urlencode 'checksum=d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6' https://api.connect.raspberrypi.com/organisation/artefacts

如果成功,您将收到一个201 已创建响应,其中包含 JSON 格式的制品详细信息。例如:

HTTP/2 201
Content-Type: application/json; charset=utf-8

{
    "id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
    "name": "kiosk-v1.0",
    "type": "uri",
    "uri": "https://example.com/kiosk-v1.0.tar.zst",
    "checksum": "d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6",
    "expires_at": null,
    "created_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

422 无法处理的实体

无法创建该制品。

{"message":"Validation failed: Name can't be blank"}

删除制品

若要删除您组织中的制品,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • artefact-id: the artefact’s id (as returned by 创建制品)。

HTTP
DELETE /organisation/artefacts/artefact-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --request DELETE --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/artefacts/artefact-id

如果成功,您将收到一个200 OK响应,其中包含 JSON 格式的已删除制品详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
    "name": "kiosk-v1.0",
    "type": "uri",
    "uri": "https://example.com/kiosk-v1.0.tar.zst",
    "checksum": "d39fc02ad7878db7f6803f54dfce89346a763a603cb8e62221ba893fee9c5cc6",
    "expires_at": null,
    "created_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中找不到给定的制品 ID。

422 无法处理的实体

该制品已部署到设备。

{"message":"Cannot delete artefacts that have been deployed"}

部署

使用这些请求将更新制品部署到设备,并监控和取消部署。

列出部署

若要列出您组织中某台设备的远程更新部署,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-id: the unique identifier for the device.

HTTP
GET /organisation/devices/device-id/deployments HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/devices/device-id/deployments

如果成功,您将收到一个200 OK响应,其中包含最多 100 个该设备的部署,采用 JSON 格式,按时间由近到远排序。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "deployments": [
        {
            "id": "fdf45c44-2c0e-4f12-9b04-3a6a1c0d3b8d",
            "state": "failed",
            "state_reason": "Checksum mismatch",
            "device_id": "69739b44-ebb2-468e-9e24-08126dec4925",
            "artefact_id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
            "created_at": "2026-02-25T16:09:52Z",
            "updated_at": "2026-02-25T16:10:30Z"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 100,
        "total_count": 1,
        "total_pages": 1
    }
}

该state of each deployment is one of queued, in_progress, succeeded, failed, cancelled, or invalidated. For failed deployments, state_reason contains a human-readable explanation of why the deployment failed (for example, when a checksum mismatch occurs or the deployment is superseded by a newer one); for other states it is null.

若要筛选返回的部署,请使用state parameter in the query string with one of the states listed above. For backwards compatibility, state=pending returns queued deployments:

HTTP
GET /organisation/devices/device-id/deployments?state=queued HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' 'https://api.connect.raspberrypi.com/organisation/devices/device-id/deployments?state=queued'

该page and per_page query parameters work the same way as for 列出设备.

否则,您将收到以下响应之一:

响应 说明 示例

400 错误请求

该state parameter isn’t one of the recognised states.

{"message":"Unknown state \"exploded\""}

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到给定的设备 ID。

查看部署

要查看组织中的单个部署,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • deployment-id: the unique identifier for the deployment.

HTTP
GET /organisation/deployments/deployment-id HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/deployments/deployment-id

如果成功,您将收到一个200 OK响应,并以 JSON 格式返回部署的详细信息。例如:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "fdf45c44-2c0e-4f12-9b04-3a6a1c0d3b8d",
    "state": "succeeded",
    "state_reason": null,
    "device_id": "69739b44-ebb2-468e-9e24-08126dec4925",
    "artefact_id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
    "created_at": "2026-02-25T16:09:52Z",
    "updated_at": "2026-02-25T16:10:30Z"
}

否则,您将收到以下响应之一:

响应 说明

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该部署。

创建部署

要将构件部署到设备,请使用管理 API 访问令牌发起以下 HTTP 请求。新部署将取代该设备队列中已有的任何部署。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • device-id: the unique identifier for the recipient device.

  • artefact-id: the artefact’s id (as returned by 创建制品)。

JSON
POST /organisation/devices/device-id/deployments HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
Content-Type: application/json

{
    "artefact_id": "artefact-id"
}
curl
$ curl --header 'Authorization: Bearer rporg_accesstokenhere' --data-urlencode 'artefact_id=artefact-id' https://api.connect.raspberrypi.com/organisation/devices/device-id/deployments

如果成功,您将收到一个201 已创建响应,并以 JSON 格式返回部署的详细信息。例如:

HTTP/2 201
Content-Type: application/json; charset=utf-8

{
    "id": "fdf45c44-2c0e-4f12-9b04-3a6a1c0d3b8d",
    "state": "queued",
    "state_reason": null,
    "device_id": "69739b44-ebb2-468e-9e24-08126dec4925",
    "artefact_id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
    "created_at": "2026-02-25T16:09:52Z",
    "updated_at": "2026-02-25T16:09:52Z"
}

否则,您将收到以下响应之一:

响应 说明 示例

400 错误请求

artefact_id is missing.

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该设备或构件,或者构件已过期。

403 禁止访问

您组织的免费试用已结束,且尚未设置计费。

{"message":"Deployments are blocked until billing has been set up"}

取消部署

要取消排队中的部署,请使用管理 API 访问令牌发起以下 HTTP 请求。

替换以下代码中的这些值:

  • rporg_accesstokenhere: your management API access token.

  • deployment-id: the unique identifier for the deployment.

HTTP
PUT /organisation/deployments/deployment-id/cancel HTTP/1.1
Host: api.connect.raspberrypi.com
Authorization: Bearer rporg_accesstokenhere
curl
$ curl --request PUT --header 'Authorization: Bearer rporg_accesstokenhere' https://api.connect.raspberrypi.com/organisation/deployments/deployment-id/cancel

如果成功,您将收到一个200 OK响应,并以 JSON 格式返回更新后的部署详情:

HTTP/2 200
Content-Type: application/json; charset=utf-8

{
    "id": "fdf45c44-2c0e-4f12-9b04-3a6a1c0d3b8d",
    "state": "cancelled",
    "state_reason": null,
    "device_id": "69739b44-ebb2-468e-9e24-08126dec4925",
    "artefact_id": "ee92e7e6-2c2c-4e7d-9d80-2cce8a6c7e8a",
    "created_at": "2026-02-25T16:09:52Z",
    "updated_at": "2026-02-25T16:10:30Z"
}

否则,您将收到以下响应之一:

响应 说明 示例

401 未授权

管理 API 访问令牌无效。

404 未找到

在组织中未找到该部署。

422 无法处理的实体

无法取消该部署,因为它不在队列中。只有排队中的部署才能被取消。

{"message":"Cannot cancel deployment in state \"succeeded\""}