/api/setupSetup Instance
Creates the initial admin user for the instance. This endpoint does not require authentication but only works when setup is required (no accounts exist and embedded IDP is enabled).
When the management server is started with NB_SETUP_PAT_ENABLED=true and the request includes create_pat: true, the endpoint also provisions the NetBird account for the new owner user and returns the plain text Personal Access Token in personal_access_token. The optional pat_expire_in value applies only when create_pat is true and defaults to 1 day when omitted. If a post-user step fails, setup-created resources are rolled back when safe; if account cleanup fails, the owner user is left in place to avoid leaving an account without its admin user.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Initial admin user details
A 400 is returned: Bad Request. A 412 is returned: Setup already completed. A 500 is returned: Internal Server Error.