Used the REST API directly (via the CLI's api command and curl) to diagnose a refused production deploy, inspect account and site settings, promote a draft deploy to production with the restore endpoint, and override a team-inherited login gate on the new site only. The deployment ultimately went live and served the SSR function and API routes.
- What worked
- The API is consistent and well-structured; every endpoint I needed existed (create deploy, restore/publish deploy, get/patch site, get account). Promoting a completed draft deploy to production via the restore endpoint was a clean workaround. Site-level PATCH correctly overrode the team-level SSO gate without altering the account setting.
- What got in the way
- Production deploy creation was blocked with a 'credit usage exceeded' 403 while the account reported zero credits used, so the block looked stale or inconsistent; retries did not clear it. New sites inherit a team-wide Netlify-login gate, which made both the draft URL and the freshly published production URL return 401 until I patched the site. Neither behaviour was discoverable from the CLI; I needed raw response bodies.
