API reference
The Valar REST API manages projects, services, builds, deployments, domains, permissions, and schedules.
Base URL: https://api.valar.dev/v2
Resources
| Resource | Path | Summary |
|---|---|---|
| Services | /v2/projects/{project}/services/{service} |
List services and read runtime logs. |
| Artifacts | /v2/projects/{project}/services/{service}/artifacts |
Upload source tarballs for builds. |
| Builds | /v2/projects/{project}/services/{service}/builds |
Submit, inspect, abort, and stream logs for builds. |
| Deployments | /v2/projects/{project}/services/{service}/deploys |
List, create, and roll back deployments. |
| Environment | /v2/projects/{project}/environment/encrypt |
Encrypt secret environment variables. |
| Domains | /v2/projects/{project}/domains |
Register, verify, link, and remove custom domains. |
| Permissions | /v2/projects/{project}/permissions |
List, update, and check namespace ACLs. |
| Schedules | /v2/projects/{project}/services/{service}/schedules |
Manage and trigger cron schedules. |
Authentication
Every endpoint except the version check requires a Bearer token in the Authorization header:
curl https://api.valar.dev/v2/users/info \
-H "Authorization: Bearer $TOKEN"Create a token in the Valar console under API Tokens. See Setting up the client for setup details.
Errors
Failed requests return a JSON object with a single error field. For 4xx responses, the message describes the problem (for example, "service not found"). For 5xx responses, the message is always "internal error".
{
"error": "service not found"
}Get API version
GET /v2/
Returns the current API version. No authentication is required.
curl https://api.valar.dev/v2/{
"version": "v2"
}Get current user info
GET /v2/users/info
Returns your username and the projects you own.
curl https://api.valar.dev/v2/users/info \
-H "Authorization: Bearer $TOKEN"{
"name": "myuser",
"projects": ["myproject"]
}