> ## Documentation Index
> Fetch the complete documentation index at: https://sferadev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# netlify-api

> Type-safe Netlify API client

A type-safe API client for the [Netlify API](https://docs.netlify.com/api/get-started/), auto-generated from the official OpenAPI specification with full TypeScript support.

## Features

* **Type-Safe** - Full TypeScript support with auto-generated types from OpenAPI spec
* **Complete API Coverage** - All Netlify API endpoints supported
* **Auto-Updated** - Daily regeneration from upstream OpenAPI specs

## Installation

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add netlify-api
  ```

  ```bash npm theme={null}
  npm install netlify-api
  ```

  ```bash yarn theme={null}
  yarn add netlify-api
  ```
</CodeGroup>

## Usage

### Basic Usage

```typescript theme={null}
import { createClient } from "netlify-api";

const client = createClient({
  baseUrl: "https://api.netlify.com/api/v1",
  headers: {
    Authorization: `Bearer ${process.env.NETLIFY_ACCESS_TOKEN}`,
  },
});

// List all sites
const sites = await client.listSites();

// Get a specific site
const site = await client.getSite({
  siteId: "your-site-id",
});

// List deploys for a site
const deploys = await client.listSiteDeploys({
  siteId: "your-site-id",
});
```

### Type Exports

```typescript theme={null}
import type { Types } from "netlify-api";

// Use TypeScript types
type Site = Types.Site;
type Deploy = Types.Deploy;
```

## API Reference

The client exposes all Netlify API endpoints including:

* **Sites** - Create, list, update, and delete sites
* **Deploys** - Manage deployments and rollbacks
* **Forms** - Form submissions management
* **Functions** - Serverless functions management
* **Build Hooks** - Trigger builds programmatically
* **DNS** - DNS zone and record management
* **Environment Variables** - Manage site environment variables
* **And more...**

For the complete API reference, see the [Netlify API documentation](https://docs.netlify.com/api/get-started/).
