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

# Execute SQL query (synchronous)

> Execute a SQL query and return the results immediately



## OpenAPI

````yaml post /api/query
openapi: 3.0.0
info:
  title: SQL Query API
  description: API for executing SQL queries
  version: 1.0.0
servers:
  - url: https://pos-integration.robotpos.com/realtimeapi
    description: Production API server
security: []
paths:
  /api/query:
    post:
      summary: Execute SQL query (synchronous)
      description: Execute a SQL query and return the results immediately
      operationId: executeQuery
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Query'
            example:
              query: SELECT * FROM efr_users
      responses:
        '200':
          description: Query executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    Query:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          description: SQL query to execute
          example: SELECT * FROM efr_users
    QueryResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Query results
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````