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

# Resize PTY Session

> Resize the terminal dimensions for a PTY session.

Resize a PTY session.

## Endpoint

```http theme={null}
POST /api/v1/pty/{session_id}/resize
```

## Example Request

```bash theme={null}
curl -X POST https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/pty/<session-id>/resize \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows": 40, "cols": 120}'
```

## Request Body

```json theme={null}
{
  "rows": 40,
  "cols": 120
}
```

Tensorlake clamps `rows` to `1..500` and `cols` to `1..1000`.

## Response

Tensorlake returns `204 No Content` when the resize is applied.

If the session does not exist, Tensorlake returns `404 Not Found`.


## OpenAPI

````yaml post /api/v1/pty/{session_id}/resize
openapi: 3.1.0
info:
  title: Tensorlake API
  description: >-
    Tensorlake Cloud APIs for Sandboxes, Document Ingestion, and Serverless
    Workflows
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.tensorlake.ai/
security:
  - bearerAuth: []
tags:
  - name: Tensorlake Cloud API
    description: >-
      Tensorlake Cloud APIs for Sandboxes, Document Ingestion, and Serverless
      Workflows
paths:
  /api/v1/pty/{session_id}/resize:
    servers:
      - url: https://{identifier}.sandbox.tensorlake.ai
        description: >-
          Example sandbox proxy host for a specific running sandbox. For
          programmatic access, use the sandbox's `ingress_endpoint`.
        variables:
          identifier:
            default: example-sandbox
            description: The sandbox ID or sandbox name.
    parameters:
      - name: session_id
        in: path
        description: The PTY session identifier.
        required: true
        schema:
          type: string
    post:
      tags:
        - sandbox-pty
      summary: Resize a PTY session
      description: Resize the terminal dimensions for a PTY session.
      operationId: sandbox_pty_resize
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxPtyResizeRequest'
      responses:
        '204':
          description: PTY session resized
        '404':
          description: PTY session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxProxyError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SandboxProxyError'
components:
  schemas:
    SandboxPtyResizeRequest:
      type: object
      required:
        - rows
        - cols
      properties:
        rows:
          type: integer
          format: int32
        cols:
          type: integer
          format: int32
    SandboxProxyError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````