First Project & API Token¶
This guide walks you through creating a project and generating a long-lived API token — the two things you need before provisioning any resource.
Prerequisites¶
- You have an account and are logged in. If not, complete the Quick Start first.
- Your organization is active. A new organization starts
pendinguntil b'nerd approves it, and creating a project is refused with403until then — see Organization standing. - To create priced resources later (servers, clusters, buckets, …) your organization may need a payment method — see Billing: Payment method required.
1. Identify your organization¶
Note the id field — you'll use it throughout this guide as $ORG_ID.
Multi-organization accounts
If your account belongs to more than one organization, append ?organization_id=$ORG_ID to every request so the server knows which organization to act in. Requests from multi-org accounts without this parameter are rejected with 403 Forbidden. Select the active organization in the dashboard via the org-switcher in the top navigation, or with bnerd org switch in the CLI — both inject the parameter automatically on every subsequent request.
2. Create a project¶
Projects are the namespace resources live in. Create one for each environment or workload you want to separate.
curl -X POST "https://api.bnerd.cloud/projects?organization_id=$ORG_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"project": {"name": "production"}}'
The response includes the project id — save it as $PROJECT_ID.
3. Get a static API token¶
JWTs expire. For CI/CD pipelines and scripts you want a long-lived static token that doesn't require re-authentication.
Create a token in the dashboard¶
- Go to Account (top-right menu) → Settings → API Tokens (
/account/tokens). - Enter a Token name (e.g.
ci-deployornightly-backup) and the Scopes your automation needs, comma-separated (e.g.dns:read, rgw_users:*). At least one scope is required. - Click Create token.
- A dialog shows the raw token value — copy it immediately. It is shown only once and cannot be retrieved after you close the dialog.
One-time reveal
The token value is never stored in plaintext. If you close the dialog without copying it you must revoke and create a new token.
Create a token via the API¶
curl -X POST https://api.bnerd.cloud/tokens \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"token": {"name": "ci-deploy", "scopes": ["dns:read", "projects:read"]}}'
The response includes data.token — copy this value immediately. It is shown only once.
Create a token via the CLI¶
The CLI does not have a tokens create subcommand in v0.4.0 — use the dashboard or the API. After you create the token, you can store it with bnerd config set:
Then use it in subsequent API calls with Authorization: Bearer $TOKEN_VALUE.
Test your token once you have it:
4. List projects to confirm¶
Using the dashboard¶
All the steps above are also available without leaving app.bnerd.cloud:
- Create a project: Organizations → your org → Projects → New Project
- Static API token: Account → Settings → API Tokens → Create token
Using the CLI¶
# Authenticate (writes ~/.bnerd.yaml)
bnerd login
# List organizations
bnerd organizations list
# Create a project
bnerd projects create my-first-project
# Confirm it exists
bnerd projects list
Troubleshooting¶
| Symptom | Likely cause | Fix |
|---|---|---|
401 on API calls | Token revoked, expired or malformed | Re-authenticate: bnerd login with a new static token, created in Account → Settings → API Tokens |
403 on project create (organization_pending_approval) | Organization not yet approved | Wait for the approval mail — see Organization standing |
403 on project create (organization_rejected or organization_suspended) | b'nerd rejected or suspended the organization | See Support |
422 (payment_required) when you create a priced resource in the project | No usable payment method on file | Add one — see Billing: Payment method required |
403 on project create (other codes) | Missing projects:create permission | Check your membership permissions in Dashboard → Organization → Members & Roles |
| Token shown only once | Expected behavior for static tokens | Store the token value immediately — it is not retrievable afterwards |
What's next¶
| Task | Guide |
|---|---|
| Launch your first server | Quick Start |
| Provision object storage | Provision S3 Storage |
| Set up DNS | Manage DNS |
| Deploy a cluster | Deploy a Kubernetes Cluster |
| Script and automate | CLI |