Reference
A small, predictable REST API. JSON in, JSON out, keys in the header.
https://api.foundry.app/v2/deploymentsReturns your deployments, newest first, in a paginated list.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | How many to return (1–100, default 20). |
| status | string | Filter by live, building or failed. |
Request
$ curl https://api.foundry.app/v2/deployments \ -H "Authorization: Bearer $FOUNDRY_KEY"
Response
{ "data": [{ "id": "dpl_a91f", "status": "live" }], "has_more": false }
/v2/deploymentsUploads an entrypoint and rolls it out to the edge network.
| Parameter | Type | Description |
|---|---|---|
| entrypointrequired | string | Path to the handler file. |
| env | object | Environment variables for the function. |
Request
$ curl -X POST https://api.foundry.app/v2/deployments \ -H "Authorization: Bearer $FOUNDRY_KEY" \ -d '{ "entrypoint": "api/time.ts" }'
Response
{ "id": "dpl_b204", "status": "building" }
/v2/deployments/{id}Tears down a deployment. The URL stops serving immediately.
| Parameter | Type | Description |
|---|---|---|
| idrequired | string | The deployment id, in the path. |
Request
$ curl -X DELETE https://api.foundry.app/v2/deployments/dpl_a91f \ -H "Authorization: Bearer $FOUNDRY_KEY"
Response
{ "id": "dpl_a91f", "deleted": true }
/v2/keysIssues a new scoped key. The secret is returned once and never again.
| Parameter | Type | Description |
|---|---|---|
| namerequired | string | A label to recognise the key by. |
Request
$ curl -X POST https://api.foundry.app/v2/keys \ -H "Authorization: Bearer $FOUNDRY_KEY" \ -d '{ "name": "ci" }'
Response
{ "id": "key_77c1", "secret": "fdry_live_a91f…4c02" }