> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Drag mouse

> Drag the mouse from one screen coordinate to another.

Performs a mouse drag from start to end coordinates.

## Path parameters

<ParamField path="id" type="string" required>
  Computer ID (UUID).
</ParamField>

## Body parameters

<ParamField body="start_x" type="integer" required>
  Starting X coordinate.
</ParamField>

<ParamField body="start_y" type="integer" required>
  Starting Y coordinate.
</ParamField>

<ParamField body="end_x" type="integer" required>
  Ending X coordinate.
</ParamField>

<ParamField body="end_y" type="integer" required>
  Ending Y coordinate.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` if the drag was performed.
</ResponseField>

<ResponseField name="action" type="string">
  Always `drag`.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://www.orgo.ai/api/computers/a3bb189e-8bf9-3888-9912-ace4e6543002/drag \
    -H "Authorization: Bearer $ORGO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "start_x": 100,
      "start_y": 100,
      "end_x": 300,
      "end_y": 200
    }'
  ```

  ```python Python theme={null}
  import requests

  requests.post(
      f"https://www.orgo.ai/api/computers/{computer_id}/drag",
      headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"},
      json={
          "start_x": 100,
          "start_y": 100,
          "end_x": 300,
          "end_y": 200
      }
  )
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://www.orgo.ai/api/computers/${computerId}/drag`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      start_x: 100,
      start_y: 100,
      end_x: 300,
      end_y: 200
    })
  });
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "success": true,
  "action": "drag",
  "details": { "start_x": 100, "start_y": 100, "end_x": 300, "end_y": 200 }
}
```

## Errors

| Status | Meaning                                                          |
| ------ | ---------------------------------------------------------------- |
| `400`  | Missing required coordinate, or computer instance not available. |
| `401`  | Missing or invalid API key.                                      |
| `403`  | You do not have access to this computer.                         |
| `404`  | Computer not found.                                              |
| `500`  | Upstream desktop agent failure.                                  |


## OpenAPI

````yaml POST /computers/{id}/drag
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: spencer@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Streaming
    description: Stream computer display via RTMP
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
paths:
  /computers/{id}/drag:
    post:
      tags:
        - Computer Actions
      summary: Drag mouse
      description: Performs a mouse drag from start to end coordinates.
      operationId: mouseDrag
      parameters:
        - name: id
          in: path
          required: true
          description: Computer ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DragRequest'
            example:
              start_x: 100
              start_y: 100
              end_x: 300
              end_y: 200
              duration: 0.5
      responses:
        '200':
          description: Drag performed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    DragRequest:
      type: object
      required:
        - start_x
        - start_y
        - end_x
        - end_y
      properties:
        start_x:
          type: integer
          description: Start X coordinate
        start_y:
          type: integer
          description: Start Y coordinate
        end_x:
          type: integer
          description: End X coordinate
        end_y:
          type: integer
          description: End Y coordinate
        button:
          type: string
          enum:
            - left
            - right
          default: left
          description: Mouse button
        duration:
          type: number
          default: 0.5
          description: Drag duration in seconds
    ActionResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid API key
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Resource not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````