---
title: "Complete device enrollment by exchanging a one-shot enrollment_token for a registered device row with the device's age public key."
method: POST
path: "/api/mcp/tools/env_sync.device_enroll"
tags: ["misc"]
---

# Complete device enrollment by exchanging a one-shot enrollment_token for a registered device row with the device's age public key.

`POST /api/mcp/tools/env_sync.device_enroll`

## Request

- Base URL: `https://api.ainote.dev`
- URL: `https://api.ainote.dev/api/mcp/tools/env_sync.device_enroll`
- Auth: API key in header `Authorization`

Complete device enrollment by exchanging a one-shot enrollment_token for a registered device row with the device's age public key.

## Request body

- object
  - `alias` string, required
  - `age_pubkey` string, required
  - `enrollment_token` string, required
  - `capabilities` object
    - `os` string
    - `claude_code_version` string
    - `transports` string[]
  - `device_id` string: Optional calling device id for audit attribution. The X-Ainote-Device-Id header is the canonical source; this argument is the backwards-compatible fallback for clients that predate the header. If both are sent and disagree, the request is rejected (DEVICE_MISMATCH).

## Response `200`

Tool executed successfully

- ToolSuccessResponse: Successful tool invocation. `content` mirrors the MCP `tools/call` result shape: an array of content blocks (text and optionally a structured resource payload).
  - `content` object[]
    - `type` 'text' | 'resource'
    - `text` string

## Other responses

- `400`: Invalid arguments or business-rule violation
- `401`: Missing or invalid McpKey

---

[API](https://skmtc.dev/ainote/apis/ainote-mcp-openapi-mirror.md) · [All operations](https://skmtc.dev/ainote/apis/ainote-mcp-openapi-mirror/llms.txt) · [OpenAPI document](https://skmtc.dev/ainote/apis/ainote-mcp-openapi-mirror/revisions/f6c91d85e027?raw)
