# Capture a desktop screenshot region.

`GET /v1/desktop/screenshot/region`

Performs a health-gated screenshot crop against the managed desktop and
returns the requested region image bytes.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `x` | query | Yes | integer |  |
| `y` | query | Yes | integer |  |
| `width` | query | Yes | integer |  |
| `height` | query | Yes | integer |  |
| `format` | query | No |  |  |
| `quality` | query | No | integer |  |
| `scale` | query | No | number |  |
| `showCursor` | query | No | boolean |  |

### Parameter schemas

```json
[
  {
    "name": "x",
    "in": "query",
    "required": true,
    "schema": {
      "type": "integer",
      "format": "int32"
    }
  },
  {
    "name": "y",
    "in": "query",
    "required": true,
    "schema": {
      "type": "integer",
      "format": "int32"
    }
  },
  {
    "name": "width",
    "in": "query",
    "required": true,
    "schema": {
      "type": "integer",
      "format": "int32",
      "minimum": 0
    }
  },
  {
    "name": "height",
    "in": "query",
    "required": true,
    "schema": {
      "type": "integer",
      "format": "int32",
      "minimum": 0
    }
  },
  {
    "name": "format",
    "in": "query",
    "required": false,
    "schema": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DesktopScreenshotFormat"
        }
      ],
      "nullable": true
    }
  },
  {
    "name": "quality",
    "in": "query",
    "required": false,
    "schema": {
      "type": "integer",
      "format": "int32",
      "nullable": true,
      "minimum": 0
    }
  },
  {
    "name": "scale",
    "in": "query",
    "required": false,
    "schema": {
      "type": "number",
      "format": "float",
      "nullable": true
    }
  },
  {
    "name": "showCursor",
    "in": "query",
    "required": false,
    "schema": {
      "type": "boolean",
      "nullable": true
    }
  }
]
```

Related schemas: [DesktopScreenshotFormat](/sandbox-agent/docs/api-reference/schemas/desktopscreenshotformat/).

## Responses

### 200

Desktop screenshot region as image bytes

### 400

Invalid screenshot region

Content type: `application/json`

```json
{
  "schema": {
    "$ref": "#/components/schemas/ProblemDetails"
  }
}
```

Related schemas: [ProblemDetails](/sandbox-agent/docs/api-reference/schemas/problemdetails/).

### 409

Desktop runtime is not ready

Content type: `application/json`

```json
{
  "schema": {
    "$ref": "#/components/schemas/ProblemDetails"
  }
}
```

Related schemas: [ProblemDetails](/sandbox-agent/docs/api-reference/schemas/problemdetails/).

### 502

Desktop runtime health or screenshot capture failed

Content type: `application/json`

```json
{
  "schema": {
    "$ref": "#/components/schemas/ProblemDetails"
  }
}
```

Related schemas: [ProblemDetails](/sandbox-agent/docs/api-reference/schemas/problemdetails/).
