API quickstart

Make one authenticated request to list the sites in your account.

1. Create an API key

Open API Keys in the Interfold dashboard and create a Read-only key. Choose Read/write only when the integration needs to change resources.

Store the key in a server-side environment variable. Never put it in browser code, commit it to a repository, or paste it into chat.

export INTERFOLD_API_KEY='<your-key>'
export INTERFOLD_ACCOUNT_ID='<your-account-id>'

2. List sites

curl "https://api.interfold.dev/v0/sites?accountId=$INTERFOLD_ACCOUNT_ID" \
  -H "Authorization: Bearer $INTERFOLD_API_KEY"

The response contains a page of sites:

{
  "sites": [],
  "pagination": {
    "hasMore": false,
    "nextOffset": null
  }
}

3. Create a site

Use a Read/write key for mutations:

curl -X POST "https://api.interfold.dev/v0/sites" \
  -H "Authorization: Bearer $INTERFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
    "accountId": "<account-id>",
    "name": "My Site",
    "access": "PRIVATE"
  }'

The response includes the Site ID, generated subdomain, attached bucket, and access state. Use Get a site before deriving a hosted URL; do not guess the subdomain from the name.

Next steps

On this page