> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tofunmiadewuyi.com/custos/llms.txt
> Use this file to discover all available pages before exploring further.

# Enroll a host

> Called by `custosd enroll`, not by a user. Unauthenticated but rate-limited: the enrollment token is the credential. Custos enforces one active host per machine, keyed on a hash of /etc/machine-id, with prior_host_id as the fallback when that is unavailable.




## OpenAPI

````yaml /custos/openapi.yaml post /enroll
openapi: 3.1.0
info:
  title: Custos control-plane API
  version: 0.1.0
  description: >
    Seed specification. The auth, identity, key, host-list, and grant endpoints
    below are

    complete; the remaining control-plane endpoints are still being transcribed.
servers:
  - url: https://custos.example.com
    description: Your control plane
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Login, token refresh, and logout.
  - name: Identity
    description: The authenticated user.
  - name: Keys
    description: A user's SSH public keys.
  - name: Credentials
    description: Stored secrets, sealed at rest and audited on every read.
  - name: Permission requests
    description: Time-boxed access requests for gated credentials.
  - name: Sets
    description: >-
      Secret sets — an app's .env, either deployable (private) or team-shared
      (public).
  - name: Hosts
    description: Enrolled machines.
  - name: Health
    description: Liveness and readiness probes.
  - name: Notifications
    description: In-app notifications for the signed-in user.
  - name: Rotation reviews
    description: Credential rotation checklists raised when a user is suspended or removed.
  - name: Audit
    description: Install-wide trails.
  - name: Users
    description: Accounts and their lifecycle.
  - name: Invitations
    description: Onboarding new accounts.
  - name: Groups
    description: Resource groups — a grant on a group cascades to everything in it.
  - name: Grants
    description: Permission grants.
  - name: Enrollment
    description: Admitting a machine to the fleet. Daemon-facing.
  - name: Upgrades
    description: Rolling the daemon fleet forward.
paths:
  /enroll:
    post:
      tags:
        - Enrollment
      summary: Enroll a host
      description: >
        Called by `custosd enroll`, not by a user. Unauthenticated but
        rate-limited: the enrollment token is the credential. Custos enforces
        one active host per machine, keyed on a hash of /etc/machine-id, with
        prior_host_id as the fallback when that is unavailable.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
                - public_key
              properties:
                token:
                  type: string
                hostname:
                  type: string
                public_key:
                  type: string
                  description: The daemon's Ed25519 identity public key, base64.
                encryption_key:
                  type: string
                  description: The daemon's X25519 public key for sealed sets, base64.
                machine_id:
                  type: string
                  description: >-
                    Hash of /etc/machine-id; empty when unavailable, e.g. in
                    containers.
                prior_host_id:
                  type: string
                  description: The daemon's previous host id when re-enrolling.
                ssh_address:
                  type: string
      responses:
        '200':
          description: The host identity and the control plane's signing key
          content:
            application/json:
              schema:
                type: object
                properties:
                  host_id:
                    type: string
                    format: uuid
                  signing_public_key:
                    type: string
                    description: >-
                      The control plane's Ed25519 snapshot-signing key, pinned
                      by the daemon.
        '400':
          description: Missing token or public_key
        '401':
          description: Invalid or expired token
        '409':
          description: That machine already has an active host; revoke it first
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        An opaque access token from /login or /refresh. Tokens are checked
        against the database on every request, so revocation is immediate.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.