Skip to main content

DigitalOcean API Token

NightOps requires a DigitalOcean Personal Access Token to manage your resources.

Create an API Token

Step 1: Generate Token

  1. Log in to your DigitalOcean Control Panel
  2. Go to API → Tokens/Keys
  3. Click Generate New Token
  4. Configure the token:
    • Token name: NightOps Integration
    • Expiration: Choose based on your security policy (or "No expiry")
    • Scopes: Select Read and Write
  5. Click Generate Token
  6. Copy the token immediately — it won't be shown again

Step 2: Add to NightOps

  1. Log in to your NightOps dashboard
  2. Go to Providers → Add Provider → DigitalOcean
  3. Paste your API token
  4. Click Test Connection
  5. Click Save Provider

Required Scopes

NightOps requires both Read and Write scopes to:

ScopePurpose
ReadList Droplets, databases, Kubernetes clusters
WritePower off/on Droplets, resize databases, scale node pools

Token Security

Best Practices

  1. Create a dedicated token — Don't reuse tokens from other integrations
  2. Set expiration — Use a reasonable expiration and rotate regularly
  3. Audit usage — Review API access in DigitalOcean's Activity Log

Token Rotation

To rotate your token:

  1. Generate a new token in DigitalOcean
  2. Update the token in NightOps (Settings → Providers → Edit)
  3. Test the connection
  4. Delete the old token in DigitalOcean

Troubleshooting

"Invalid Token"

  1. Verify the token was copied completely
  2. Check the token hasn't expired
  3. Confirm both Read and Write scopes are enabled

"Forbidden" Errors

  1. Ensure Write scope is enabled
  2. Verify the token owner has access to the resources

Rate Limiting

DigitalOcean rate limits API requests to 5,000/hour. NightOps operations are well within this limit for normal usage.


Next Steps