---
updatedAt: 2026-06-16T00:00:16.000Z
agentTools:
  projectIndex: https://docs.api.getrotor.com/llms.txt
---

# Test authentication

Simple endpoint to test if authentication credentials are valid.
Returns authentication status, company/user info, and the scopes granted to the token.
Useful for debugging during development.


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Rotor OpenAPI",
    "description": "Public-facing API for Rotor — a CRM and field service platform built for home service businesses.\n\nCurrent version: `1.1.0`\n\n## Authentication\n\nAll requests must be authenticated with a company API key.\n\n- Header: `x-api-key: rotor_{keyId}_{keySecret}`\n- Version header: `rotor-api-version: 1.1.0`\n\nAPI keys are scoped to a specific company and can be managed by company administrators in **Settings → Integrations → API Keys**.\n\n## Rate Limits\n\nEach API key is limited to **1000 requests per UTC day** across all OpenAPI endpoints.\n\n## Scopes\n\nEach API key is granted specific scopes that control what actions it can perform:\n\n| Scope | Description |\n|---|---|\n| `leads:create` | Create and update leads |\n| `leads:read` | Read lead records |\n| `customers:create` | Create and update customers |\n| `customers:read` | Read customer records |\n| `service_plans:read` | Read service plan records |\n| `jobs:read` | Read serviced job records |\n| `pins:read` | Read pin records and pin types |\n| `timesheets:read` | Read timesheet records and visit timer records |\n| `tasks:read` | Read task records |\n| `tasks:create` | Create tasks |\n| `tasks:update` | Update tasks |\n| `configuration:read` | Read company configuration (service types, line item templates) |\n\n## Getting Started\n\n1. **Set the required version header**: Send `rotor-api-version: 1.1.0` with every request\n2. **Create an API key**: Go to Settings → Integrations → API Keys, create a key with the scopes you need\n3. **For testing**: Use `GET /auth/test` to verify your credentials\n",
    "version": "1.1.0",
    "contact": {
      "name": "Rotor API Support",
      "url": "https://getrotor.com"
    }
  },
  "servers": [
    {
      "url": "https://api.getrotor.com/open-api",
      "description": "Production server"
    },
    {
      "url": "http://localhost:3000/open-api",
      "description": "Development server"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/auth/test": {
      "get": {
        "summary": "Test authentication",
        "description": "Simple endpoint to test if authentication credentials are valid.\nReturns authentication status, company/user info, and the scopes granted to the token.\nUseful for debugging during development.\n",
        "operationId": "testAuth",
        "tags": [
          "Authentication"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RotorApiVersionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Authentication successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthTestResponse"
                },
                "example": {
                  "status": "success",
                  "message": "Authentication successful",
                  "authenticated": true,
                  "company_id": "550e8400-e29b-41d4-a716-446655440000",
                  "user_id": null,
                  "auth_method": "api_key",
                  "scopes": [
                    "leads:read",
                    "customers:read"
                  ],
                  "timestamp": "2026-01-15T14:30:00Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "RotorApiVersionHeader": {
        "name": "rotor-api-version",
        "in": "header",
        "description": "Required OpenAPI version header.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "1.1.0"
          ],
          "default": "1.1.0"
        },
        "example": "1.1.0"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Authentication required",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "status": "error",
              "message": "Authentication required. Provide x-api-key header.",
              "error_code": "AUTHENTICATION_REQUIRED"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Daily API key rate limit exceeded",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "status": "error",
              "message": "Daily API key request limit of 1000 exceeded",
              "error_code": "RATE_LIMIT_EXCEEDED"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "error"
          },
          "message": {
            "type": "string",
            "example": "Validation failed"
          },
          "error_code": {
            "type": "string",
            "description": "Machine-readable error code",
            "example": "INSUFFICIENT_SCOPE"
          },
          "limit": {
            "type": "integer",
            "description": "Daily request limit for the API key when rate limited",
            "example": 1000
          },
          "requests_today": {
            "type": "integer",
            "description": "Number of requests already consumed today by the API key",
            "example": 1000
          },
          "reset_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp when the daily request counter resets",
            "example": "2026-03-31T00:00:00Z"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "example": "email"
                },
                "message": {
                  "type": "string",
                  "example": "Invalid email format"
                }
              }
            }
          }
        }
      },
      "AuthTestResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "success"
          },
          "message": {
            "type": "string",
            "example": "Authentication successful"
          },
          "authenticated": {
            "type": "boolean",
            "example": true
          },
          "company_id": {
            "type": "string",
            "format": "uuid",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "rotor_api_version": {
            "type": "string",
            "example": "1.1.0"
          },
          "user_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Null for API key authentication",
            "example": null
          },
          "auth_method": {
            "type": "string",
            "enum": [
              "api_key",
              "unknown"
            ],
            "example": "api_key"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Scopes granted to this token",
            "example": [
              "leads:read",
              "customers:read"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T14:30:00Z"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Company API key in the format: `rotor_{keyId}_{keySecret}`\n\nTo obtain an API key:\n1. Log into your Rotor dashboard\n2. Go to Settings → Integrations → API Keys\n3. Create a new key and select the scopes you need\n4. Copy the key — it's only shown once!\n"
      }
    }
  },
  "tags": [
    {
      "name": "Authentication",
      "description": "Test and validate API credentials"
    }
  ]
}
```