Shako API
The REST API of Shako for programs: VMs, ports, backups, secrets, devices, credit and tenants, with an API key.
Rules
- Base URL
- https://api.shako.dev. JSON in the body of a request, JSON in each answer.
- Key
- Authorization: Bearer <API key> on each request.
- Tenant
- The path of a VM, a secret, a device or the credit names its tenant: /v1/tenants/{tenant}/...
- Create
- 201 with the new object.
- List
- 200 with {"data": [...]}.
- Delete
- 200 with the names of the path and "deleted": true.
- Error
- The HTTP status and {"error": {"code": "...", "message": "..."}}. Branch on the code.
- Time
- A time is a Unix time in seconds. Money is US dollars.
API key
A key for the tenant acme, for 90 days. Shako shows the key only once.
shako api-key create ci --role contributor --tenant acme --days 90A key for each tenant that you own, with the credit and the invoices.
shako api-key create ops --role owner --accountYour keys.
shako api-key lsThe key stops at once.
shako api-key rm <id>
In the workspace: Account settings › API keys. The roles: Access control.
SDK
Python
pip install shako-sdkJavaScript
npm install shako-sdk
A method for each endpoint: SDK.
Example
The VMs of the tenant acme.
curl "https://api.shako.dev/v1/tenants/acme/vms" -H "Authorization: Bearer $SHAKO_API_KEY"