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.

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. Generate 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.

Generate one via the Dashboard under Settings → API Tokens → New Token, or via the API:

curl -X POST https://api.bnerd.cloud/organizations/$ORG_ID/api_tokens \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"api_token": {"name": "terraform-ci"}}'

The response contains the token value — copy it now, it is shown only once:

{
  "id": "...",
  "name": "terraform-ci",
  "token": "bnerd_tok_..."
}

Store it in your secret manager or CI/CD variable store. Test 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"

What's next

Task Guide
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