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

# Control server state (start/stop)



## OpenAPI

````yaml /api-reference/ai-navigator-api.json patch /api/servers/{serverId}
openapi: 3.0.0
info:
  title: AI Navigator API
  version: 1.0.0
  description: API documentation for AI Navigator
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /api/servers/{serverId}:
    patch:
      tags:
        - Servers
      summary: Control server state (start/stop)
      parameters:
        - in: path
          name: serverId
          required: true
          schema:
            type: string
          description: ID of the server to control
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServerAction'
      responses:
        '200':
          description: Server state changed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                        enum:
                          - running
                          - stopped
                      startedAt:
                        type: string
                        format: date-time
                      stoppedAt:
                        type: string
                        format: date-time
        '202':
          description: Server already in requested state
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
        '400':
          description: Invalid request or server not running
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Server not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ServerAction:
      type: object
      required:
        - action
      properties:
        action:
          type: string
          enum:
            - start
            - stop
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INVALID_REQUEST
                - DATABASE_NOT_RUNNING
                - INTERNAL_SERVER_ERROR
                - INVALID_SERVER_ID
                - SERVER_NOT_RUNNING
                - SERVER_RUNNING
                - INTERNAL_SERVER_ERROR
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: Enter your API key here

````