Back to APIs
Netlify
The Netlify API lets you manage sites, trigger builds, set environment variables, manage forms, and configure deploy contexts.
Base URL
https://api.netlify.com/api/v1deploymentssitesbuildsformsedge functions
Endpoints
GET
/sitesList all sites in your Netlify account.
const response = await fetch("https://api.netlify.com/api/v1/sites", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});
const data = await response.json();
console.log(data);Response Preview
[
{
"id": "abc123def456",
"name": "my-site",
"url": "https://my-site.netlify.app",
"state": "current",
"published_deploy": {
"id": "deploy_abc",
"state": "ready",
"created_at": "2024-05-01T10:00:00Z"
}
}
]