---
title: "Preauthorize a recorder device with Mender"
method: POST
path: "/v1/edge/mender/device-preauthorizations"
tags: ["Edge Mender"]
---

# Preauthorize a recorder device with Mender

`POST /v1/edge/mender/device-preauthorizations`

## Request

- Base URL: `https://api.hify.club`
- URL: `https://api.hify.club/v1/edge/mender/device-preauthorizations`
- Auth: API key in header `X-Access-Key-Id` and API key in header `X-Signature`

Called by recorder/scripts/preauthorize-mender-device.sh during bench provisioning, before the Mender client is started. Registers the device's MAC and public key with Mender so it is accepted on first contact instead of waiting in "pending". Also records the device on the backend as "preauthorized". Authenticated as a recorder_provisioning partner integration; no user session.

## Request body

- object
  - `mac` string, required: Device MAC, exactly as the Mender identity script reports it
  - `pubkey` string, required: PEM-encoded RSA public key derived from /var/lib/mender/mender-agent.pem

## Response `201`

Device preauthorized with Mender

- object
  - `status` string

## Other responses

- `401`: Missing, unknown, inactive or incorrectly signed credential
- `403`: Valid credential, but not a recorder_provisioning integration
- `409`: The MAC or Mender device id is already registered to a different device
- `422`: Malformed MAC address, or a public key that is unreadable or actually private
- `502`: Mender management API rejected the preauthorization

---

[API](https://skmtc.dev/hify/apis/hify-apis.md) - [All operations](https://skmtc.dev/hify/apis/hify-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/hify/apis/hify-apis/revisions/b5920403538d?raw)
