List Sites
GET /sites/
Responses
- 200 list[SiteOut]
- 401 no key, or a key that was revoked
- 403 the key lacks the permission
Example request
curl -X GET "$API/sites/" \
-H "Authorization: Bearer $LH_API_KEY"
Containers that run on your account: create, deploy an image, start, stop, read logs.
Every call needs Authorization: Bearer lh_… unless marked No key needed; the example uses $API for https://api.localhost.co.zw and $LH_API_KEY for your key. A * marks a required field.
GET /sites/
curl -X GET "$API/sites/" \
-H "Authorization: Bearer $LH_API_KEY"
POST /sites/
| Name | Type | Notes |
|---|---|---|
| slug * | string | |
| image * | string | |
| name | string | default "" |
| port | integer | default 80 |
| size | string | default S |
| env | object of string | default {} |
curl -X POST "$API/sites/" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"slug": "<slug>",
"image": "<image>"
}'
GET /sites/{slug}
| Name | Type | Notes |
|---|---|---|
| slug * in path | string |
curl -X GET "$API/sites/<slug>" \
-H "Authorization: Bearer $LH_API_KEY"
POST /sites/{slug}/deploy
| Name | Type | Notes |
|---|---|---|
| slug * in path | string | |
| image * query | string |
curl -X POST "$API/sites/<slug>/deploy?image=<image>" \
-H "Authorization: Bearer $LH_API_KEY"
GET /sites/{slug}/logs
| Name | Type | Notes |
|---|---|---|
| slug * in path | string | |
| tail query | integer | default 100 |
curl -X GET "$API/sites/<slug>/logs" \
-H "Authorization: Bearer $LH_API_KEY"
POST /sites/{slug}/{action}
| Name | Type | Notes |
|---|---|---|
| slug * in path | string | |
| action * in path | string |
curl -X POST "$API/sites/<slug>/<action>" \
-H "Authorization: Bearer $LH_API_KEY"
The objects these endpoints send and receive.
| Name | Type | Notes |
|---|---|---|
| slug * | string | |
| lines * | list[string] |
| Name | Type | Notes |
|---|---|---|
| slug * | string | |
| image * | string | |
| name | string | default "" |
| port | integer | default 80 |
| size | string | default S |
| env | object of string | default {} |
| Name | Type | Notes |
|---|---|---|
| id * | string | |
| slug * | string | |
| name * | string | |
| image * | string | |
| port * | integer | |
| size * | string | |
| desired_state * | string | |
| observed_state * | string | |
| url * | string | |
| hostnames * | list[string] | |
| last_error * | string |