---
title: Response object
summary: >-
  Allows you to create synthetic responses that exist entirely on the varnish
  machine. Useful for creating error or maintenance pages that exists outside
  the scope of your backend architecture. Best when used with <a
  href="https://www.fastly.com/documentation/reference/api/vcl-services/condition/">Condition</a>
  objects.
url: >-
  https://www.fastly.com/documentation/reference/api/vcl-services/response-object
---

Allows you to create synthetic responses that exist entirely on the varnish machine. Useful for creating error or maintenance pages that exists outside the scope of your backend architecture. Best when used with <a href="https://www.fastly.com/documentation/reference/api/vcl-services/condition/">Condition</a> objects.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `cache_condition` | string | Name of the cache condition controlling when this configuration applies. |
| `content` | string | The content the response will deliver. |
| `content_type` | string | The MIME type of your response content. |
| `name` | string | The name of the response object to create. |
| `request_condition` | string | Condition which, if met, will select this configuration during a request. Optional. |
| `response` | string | The status text the response will have. Defaults to 'OK'. |
| `status` | string | The status code the response will have. Defaults to 200. |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `version` | string | String identifying a service version. (Read-only) |

## API endpoints

### List Response objects

**GET** `/service/{service_id}/version/{version_id}/response_object`

Returns all Response Objects for the specified service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Create a Response object

**POST** `/service/{service_id}/version/{version_id}/response_object`

Creates a new Response Object.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Get a Response object

**GET** `/service/{service_id}/version/{version_id}/response_object/{response_object_name}`

Gets the specified Response Object.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `response_object_name` | string | path | Yes | Name for the request settings. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Update a Response object

**PUT** `/service/{service_id}/version/{version_id}/response_object/{response_object_name}`

Updates the specified Response Object.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `response_object_name` | string | path | Yes | Name for the request settings. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Delete a Response Object

**DELETE** `/service/{service_id}/version/{version_id}/response_object/{response_object_name}`

Deletes the specified Response Object.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `response_object_name` | string | path | Yes | Name for the request settings. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |
