Skip to content

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.

1. Identify your organization

curl https://api.bnerd.cloud/organizations \
  -H "Authorization: Bearer $TOKEN"

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/organizations/$ORG_ID/projects \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"project": {"name": "production"}}'

The response includes the project id — save it as $PROJECT_ID.

{
  "id": "a1b2c3d4-...",
  "name": "production",
  "organization_id": "..."
}

3. Get a static API token

JWTs expire. For Terraform, CI/CD pipelines, and scripts you want a long-lived static token that doesn't require re-authentication.

Create a token in the dashboard

  1. Go to Account (top-right menu) → SettingsAPI Tokens (/account/tokens).
  2. Enter a Token name (e.g. ci-deploy or terraform-prod) and the Scopes your automation needs, comma-separated (e.g. dns:read, rgw_users:*). At least one scope is required.
  3. Click Create token.
  4. 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.

Test your token once you have it:

curl https://api.bnerd.cloud/accounts/me \
  -H "Authorization: Bearer bnerd_tok_..."

4. List projects to confirm

curl https://api.bnerd.cloud/organizations/$ORG_ID/projects \
  -H "Authorization: Bearer $TOKEN"

Using the dashboard

All the steps above are also available without leaving app.bnerd.cloud:

  • Create a project: Organizations → your org → ProjectsNew Project
  • Static API token: AccountSettingsAPI TokensCreate 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

Using Terraform

resource "bnerd_project" "main" {
  name            = "my-first-project"
  organization_id = var.org_id
}

See Infrastructure as Code with Terraform for the full setup.


Troubleshooting

Symptom Likely cause Fix
401 on API calls Token expired or malformed Re-authenticate: bnerd login (for JWT) or create a new static token in Account → Settings → API Tokens
403 on project create Missing projects:create permission Check your membership role in Dashboard → Settings → Members
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
Manage everything as code Infrastructure as Code with Terraform