Impreza Host
Tutorials/REST API in 5 minutes
๐Ÿ”Œ Tutorial 3

The REST API in 5 minutes

Prefer to script it yourself? Every Impreza operation is a plain HTTP endpoint. This is the shortest path from curl to a live app: how to authenticate, what comes back, and the three calls that cover most of what you will do.

The basics #

Get your key first. Portal โ†’ Impreza API โ†’ Generate New Key (copy the secret, it shows once). Pick an IP mode โ€” leave it on whitelist and add your IP under the IP Whitelist tab (curl https://api.ipify.org), or choose tofu / keyonly to skip that step. Full walk-through in Tutorial 1 โ†’ API key.

Step 0 โ€” Confirm auth works #

The cheapest call. If this returns your account, your key + IP are good:

curl https://api.imprezahost.com/v1/account \
  -H "X-API-Key: imp_..." -H "X-API-Secret: ..."

A 403 IP_NOT_WHITELISTED here means the key is in whitelist mode and this IP isn’t listed (add it, or switch the key to tofu/keyonly); a 401 means the key/secret is wrong.

Step 1 โ€” Find your server (the agent_id) #

Every deploy targets an agent. List your servers to get the agt_โ€ฆ id:

curl https://api.imprezahost.com/v1/platform/servers \
  -H "X-API-Key: imp_..." -H "X-API-Secret: ..."
# โ†’ data.servers[].agent_id   ("status": "online" is the one you want)
Empty list or "no servers on your account"? You have a VPS but no agent installed. See Tutorial 2 โ†’ the agent.

Step 2 โ€” Deploy a catalog app #

One POST. Leave domain out to auto-allocate a free *.imprezaapps.com subdomain:

curl -X POST https://api.imprezahost.com/v1/platform/deployments \
  -H "X-API-Key: imp_..." -H "X-API-Secret: ..." \
  -H "Content-Type: application/json" \
  -d '{
    "app_name": "vaultwarden",
    "agent_id": "agt_xxxxxxxxxxxx",
    "domain": "vault.example.com",
    "onion": true
  }'
# โ†’ data.deployment_id (dpl_โ€ฆ), data.url, data.onion_address

Step 3 โ€” Deploy your own code #

The same endpoint family, under /custom. Easiest source is a public git URL โ€” the agent clones and builds it:

curl -X POST https://api.imprezahost.com/v1/platform/deployments/custom \
  -H "X-API-Key: imp_..." -H "X-API-Secret: ..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-app",
    "agent_id": "agt_xxxxxxxxxxxx",
    "git_url": "https://github.com/your-user/your-repo",
    "git_ref": "main",
    "dockerfile_path": "Dockerfile",
    "target_port": 8080,
    "cpus": 1.0,
    "memory_mb": 512
  }'

Other source modes: a public image, a local context_id (upload a gzip tarball to /v1/platform/deployments/custom/contexts first), or a full docker-compose manifest. Private git repos add git_auth_method (deploy_key or pat). The full request shapes are in Tutorial 2.

Managing what is running #

ActionEndpoint
List deploymentsGET /v1/platform/deployments
Show oneGET /v1/platform/deployments/{id}
Logs (tail N)GET /v1/platform/deployments/{id}/logs
RestartPOST /v1/platform/deployments/{id}/restart
Change domainPOST /v1/platform/deployments/{id}/domain
Add a .onionPOST /v1/platform/deployments/{id}/onion
Redeploy in place (custom)POST /v1/platform/deployments/custom/{id}/redeploy
UninstallDELETE /v1/platform/deployments/{id}

Full reference #

Not into raw HTTP? The impreza CLI packages and ships a project in one command, and an AI tool via MCP does it from chat โ€” both ride this same API.