## Import

```mdx
import { APIRequest } from "~/components";
```

## Usage

## `<APIRequest>` Props

### `path`

**required**

**type:** `string`

The path for the API endpoint.

This can be found in our [API documentation](https://api.cloudflare.com), under the name of the endpoint.

### `method`

**required**

**type:** `"GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD"`

The HTTP method to use.

### `parameters`

**type:** `Record<string, any>`

The path parameters to substitute.

If not provided, the component will default to an environment variable. For example, `{setting_id}` will be replaced with `$SETTING_ID`.

### `json`

**type:** `Record<string, any> | Record<string, any>[]`

The JSON payload to send.

If required properties are missing, the component will throw an error.

### `form`

**type:** `Record<string, any>`

The FormData payload to send.

This field is not currently validated against the schema.
