API

Use the OnePloy REST API at app.oneploy.dev/api/v1 to manage servers, projects, applications, databases, services and deployments with bearer tokens.

OnePloy has a REST API at https://app.oneploy.dev/api/v1 that covers almost everything the dashboard does: servers, projects, environments, applications, databases, services, deployments, variables, storage, backups, notifications and more. Authenticate with a team API token, created in the dashboard and sent as a bearer token.

Do I need a particular plan?

Yes. Your team’s plan must include API access. If it does not, API requests return 403. Compare plans on the Billing page.

How do I create an API token?

  1. Open Keys & Tokens, then API tokens.
  2. Enter a Description and choose when it Expires in (7, 30, 60 or 90 days, or 1 year).
  3. Choose the Permissions (see below).
  4. Create the token and copy it immediately. It is shown only once.

Tokens belong to the team that was active when you created them, and only see that team’s resources.

Which permissions can a token have?

PermissionAllows
ReadRead resources and settings, with secrets hidden.
Read sensitive dataRead values that are hidden by default, such as environment variable values and connection strings. Implies Read.
WriteCreate, change and delete resources.
DeployDeploy, start, stop, restart and roll back resources, and cancel deployments. Deploy-only tokens are ideal for CI.
RootFull access to your team.

Any team member can create a Read token. Only team owners and admins can grant Read sensitive data, Write, Deploy or Root.

How do I call the API?

curl https://app.oneploy.dev/api/v1/projects \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Accept: application/json"

Keep the token in a secret store or an environment variable such as API_TOKEN, never in your source code.

What does the API cover?

AreaExample endpoints
TeamsGET /api/v1/teams/current, GET /api/v1/teams/current/members
Projects and environmentsGET /api/v1/projects, POST /api/v1/projects/{uuid}/environments
ServersGET /api/v1/servers, POST /api/v1/servers, POST /api/v1/servers/{uuid}/validate
ProxyPATCH /api/v1/servers/{uuid}/proxy, POST /api/v1/servers/{uuid}/proxy/restart
ApplicationsPOST /api/v1/applications/public, PATCH /api/v1/applications/{uuid}, GET /api/v1/applications/{uuid}/logs
DatabasesPOST /api/v1/databases/postgresql, POST /api/v1/databases/{uuid}/backups
ServicesPOST /api/v1/services, POST /api/v1/services/{uuid}/restart
DeploymentsPOST /api/v1/deploy, GET /api/v1/deployments, POST /api/v1/deployments/{uuid}/cancel
VariablesGET /api/v1/applications/{uuid}/envs, GET /api/v1/team/envs
Keys and storage/api/v1/security/keys, /api/v1/s3-storages, /api/v1/cloud-tokens
NotificationsGET /api/v1/notifications/slack, PATCH /api/v1/notifications/email
Cloud providers/api/v1/hetzner/..., /api/v1/digitalocean/..., /api/v1/vultr/...
AIPOST /api/v1/ai/chat/completions (see AI Gateway)

Actions that change state, such as start, stop, restart and deploy, must use POST. Calling them with GET returns 405. To deploy from a CI pipeline, see Webhooks and CI/CD.

Why does the API return 401 or 403?

  • 401: the token is missing, mistyped, expired or revoked. Create a new one under Keys & Tokens.
  • 403, plan: your team’s plan does not include API access.
  • 403, permission: the token lacks the permission the endpoint requires, for example Deploy.

If none of these apply, contact support with the endpoint, the time of the request and the response body.

Last updated