{ "openapi": "3.0.0", "info": { "title": "goLance API", "version": "1.0.0" }, "servers": [ { "url": "https://golance.com" } ], "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": {}, "parameters": {} }, "paths": { "/auth/oauth/token": { "post": { "description": "Retrieve an access token using OAuth2 client credentials grant", "summary": "Create Access Token", "tags": [ "Authentication" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "clientId": { "type": "string", "minLength": 2, "maxLength": 100 }, "clientSecret": { "type": "string", "minLength": 2, "maxLength": 100 }, "grantType": { "type": "string", "enum": [ "client_credentials" ] } }, "required": [ "clientId", "clientSecret", "grantType" ] } } } }, "responses": { "200": { "description": "Access token response", "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string", "enum": [ "Bearer" ] }, "expires_in": { "type": "number", "minimum": 0, "description": "Expiration time in seconds" } }, "required": [ "access_token", "token_type", "expires_in" ] } } } } } } }, "/api/v1/external/reports/client/timesheets/list": { "get": { "description": "List hourly contract timesheets of the authenticated client", "summary": "List Hourly Contract Timesheets", "security": [ { "bearerAuth": [] } ], "tags": [ "Reports" ], "parameters": [ { "schema": { "type": "array", "items": { "type": "string" }, "example": [ "6137109712adad9757ab0e35" ] }, "required": false, "name": "teamIds", "in": "query" }, { "schema": { "type": "string", "description": "Start date in YYYY-MM-DD format", "example": "2023-01-01" }, "required": true, "name": "fromDate", "in": "query" }, { "schema": { "type": "string", "description": "End date in YYYY-MM-DD format", "example": "2023-01-31" }, "required": true, "name": "toDate", "in": "query" }, { "schema": { "type": "array", "items": { "type": "string" }, "example": [ "6137109712adad9757ab0e35" ] }, "required": false, "name": "contractorIds", "in": "query" }, { "schema": { "type": "string", "enum": [ "asc", "desc" ], "default": "asc" }, "required": false, "name": "sortOrder", "in": "query" }, { "schema": { "type": "string", "enum": [ "contract", "contractor", "trackedTime", "activity", "goMeter", "manual", "overtime", "billableTime", "billableAmount" ], "default": "contract" }, "required": false, "name": "sortField", "in": "query" }, { "schema": { "type": "number", "minimum": 1, "default": 1 }, "required": false, "name": "page", "in": "query" }, { "schema": { "type": "number", "minimum": 1, "maximum": 100, "default": 10 }, "required": false, "name": "itemsPerPage", "in": "query" } ], "responses": { "200": { "description": "Timesheet list response.", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "contract": { "type": "object", "properties": { "_id": { "type": "string" }, "rate": { "type": "number", "description": "Hourly pay rate" }, "title": { "type": "string" }, "contractor": { "type": "object", "properties": { "_id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" } }, "required": [ "_id", "firstName", "lastName" ] }, "employer": { "type": "object", "properties": { "_id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" } }, "required": [ "_id", "firstName", "lastName" ] }, "team": { "type": "object", "properties": { "_id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "_id", "name" ] } }, "required": [ "_id", "rate", "title", "contractor", "employer" ] }, "statistics": { "type": "object", "properties": { "billableMinutes": { "type": "number" }, "billedMinutes": { "type": "number" }, "manualMinutes": { "type": "number" }, "overtimeMinutes": { "type": "number" }, "trackedMinutes": { "type": "number" }, "activity": { "type": "number" }, "billableAmount": { "type": "number" } }, "required": [ "billableMinutes", "billedMinutes", "manualMinutes", "overtimeMinutes", "trackedMinutes", "activity", "billableAmount" ] } }, "required": [ "contract", "statistics" ] } }, "pagination": { "type": "object", "properties": { "currentPage": { "type": "number" }, "itemsPerPage": { "type": "number" }, "pagesCount": { "type": "number" }, "totalCount": { "type": "number" } }, "required": [ "currentPage", "itemsPerPage", "pagesCount", "totalCount" ] }, "statistics": { "type": "object", "properties": { "billableMinutes": { "type": "number" }, "billedMinutes": { "type": "number" }, "manualMinutes": { "type": "number" }, "overtimeMinutes": { "type": "number" }, "trackedMinutes": { "type": "number" }, "activity": { "type": "number" }, "billableAmount": { "type": "number" } }, "required": [ "billableMinutes", "billedMinutes", "manualMinutes", "overtimeMinutes", "trackedMinutes", "activity", "billableAmount" ] } }, "required": [ "results", "pagination", "statistics" ] } } } } } } } } }