# DirectResponse

> API reference for Direct Responses (extensions.apoxy.dev/v1alpha2)

**API Group:** `extensions.apoxy.dev/v1alpha2`

## Operations

### List Direct Responses

<APIEndpoint method="GET" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses" />

List DirectResponse

**Response**

- `200`: OK

---

### Create Direct Response

<APIEndpoint method="POST" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses" />

Create a DirectResponse

**Request Body**

Spec fields (`DirectResponseSpec`):

| Field | Type | Description |
| --- | --- | --- |
| `body` | [CustomResponseBody](#customresponsebody) | Body is the response body configuration. |
| `contentType` | string | ContentType is the Content-Type header value. Defaults to "text/plain" if not specified. |
| `headers` | [Header](#header)[] | Headers are additional HTTP headers to include in the response. |
| `statusCode` | integer (int32) | StatusCode is the HTTP status code to return. Defaults to 200 if not specified. |

**Response**

- `200`: OK
- `201`: Created
- `202`: Accepted

---

### Delete All Direct Responses

<APIEndpoint method="DELETE" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses" />

Delete collection of DirectResponse

**Response**

- `200`: OK

---

### Get Direct Response

<APIEndpoint method="GET" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses/{name}" />

Get the specified DirectResponse

**Response**

- `200`: OK

---

### Replace Direct Response

<APIEndpoint method="PUT" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses/{name}" />

Replace the specified DirectResponse

**Request Body**

Spec fields (`DirectResponseSpec`):

| Field | Type | Description |
| --- | --- | --- |
| `body` | [CustomResponseBody](#customresponsebody) | Body is the response body configuration. |
| `contentType` | string | ContentType is the Content-Type header value. Defaults to "text/plain" if not specified. |
| `headers` | [Header](#header)[] | Headers are additional HTTP headers to include in the response. |
| `statusCode` | integer (int32) | StatusCode is the HTTP status code to return. Defaults to 200 if not specified. |

**Response**

- `200`: OK
- `201`: Created

---

### Update Direct Response

<APIEndpoint method="PATCH" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses/{name}" />

Partially update the specified DirectResponse

**Response**

- `200`: OK
- `201`: Created

---

### Delete Direct Response

<APIEndpoint method="DELETE" path="/apis/extensions.apoxy.dev/v1alpha2/directresponses/{name}" />

Delete a DirectResponse

**Response**

- `200`: OK
- `202`: Accepted

---

## Schema Reference

### CustomResponseBody

| Field | Type | Description |
| --- | --- | --- |
| `inline` | string | Inline is the literal body content when Type is "Inline". |
| `type` | string | Type specifies how the body is provided. Currently only "Inline" is supported. **(required)** |
