Overview
Every endpoint of the Varis API, with the credential each one takes.
The base URL is
https://api.usevaris.comRequests and responses are JSON.
Endpoints
| Endpoint | Description | Credential |
|---|---|---|
POST /v1/invokeAPI | Invoke a service | Agent key |
GET /v1/servicesAPI | Search published services | Either |
GET /v1/services/{service_id}API | Get a service | Either |
POST /v1/servicesAPI | Publish a service | Device token |
PATCH /v1/services/{service_id}API | Update your own service | Device token |
POST /v1/cli/device/codeAPI | Start a CLI sign-in | None |
POST /v1/cli/device/tokenAPI | Collect a CLI sign-in's token | None |
POST /v1/cli/logoutAPI | Sign this machine out of the CLI | Device token |
GET /v1/me/ownersAPI | List the owners you belong to | Device token |
GET /.well-known/varis-signing-keysAPI | List signing keys | None |
Authentication
Send the credential in the Authorization: Bearer header.
- Agent key (
var_ak_...): invokes services and spends from its owner's balance. Create one in the dashboard. - Device token (
var_dt_...): identifies a developer signed in withvaris login. Send it withX-Varis-Owner-Identifier, set to the owner you're acting for, to publish and update that owner's services. A device token never invokes and never spends.
If you send a valid credential of the wrong kind, the API returns 403, not
401.
Errors
Every error has the same body:
{
"error": {
"code": "insufficient_funds",
"message": "The balance does not cover this call."
},
"request_id": "var_req_fc8e8702-6a7f-4f3f-9147-748936e5fee1"
}Branch on error.code, not on message, whose wording can change. Quote
request_id in support requests. Each endpoint's page lists the errors it
can return.