---
type: api
title: Set AppSearch read-only status
description: Enable/Disable read-only mode on the given App Search resource.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud/operation/operation-set-appsearch-read-only-mode
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud/operation/operation-set-appsearch-read-only-mode
products:
  - Elastic Cloud Hosted
---

# Set AppSearch read-only status

- Server: `https://api.elastic-cloud.com/api/v1`

## Paths

- `PUT` `/deployments/{deployment_id}/appsearch/{ref_id}/read_only_mode`

#### Path Parameters

- `deployment_id` (string)
  Identifier for the Deployment.
- `ref_id` (string)
  User-specified RefId for the Resource (or '_main' if there is only one).

## Description

Enable/Disable read-only mode on the given App Search resource.

## Request Body

`application/json`

read-only request body

- `enabled` (boolean) — required
  Enabled or disabled read-only mode

## Responses

#### `200`

Standard response

`application/json`

- `enabled` (boolean)
  Whether read-only mode is enabled or disabled
#### `404`

The Resource specified by ref_id cannot be found. (code: `deployments.deployment_resource_not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `500`

We have failed you. (code: `deployments.deployment_resource_no_longer_exists`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
PUT /deployments/{deployment_id}/appsearch/{ref_id}/read_only_mode
```

#### curl

```curl
curl -X PUT "https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/appsearch/{ref_id}/read_only_mode"
```

