openapi: 3.0.3 info: title: Moonlogs description: Moonlogs API termsOfService: 'https://moonlogs.pages.dev' contact: email: shalpack@gmail.com name: Pijng license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.13.8 externalDocs: description: Find out more about spec url: 'https://moonlogs.pages.dev' servers: [] tags: - name: Default description: '' paths: /api/schemas: get: summary: '' description: '' operationId: getSchemas tags: [] parameters: [] responses: '200': description: '' headers: {} content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/SchemaResponse' meta: $ref: '#/components/schemas/Meta' required: - success - meta - code - error - data security: - http1: [] post: summary: '' description: '' operationId: createSchema tags: &ref_0 [] parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/SchemaRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/SchemaResponse' meta: $ref: '#/components/schemas/Meta' required: - success - error - meta - code - data security: - http1: [] /api/schemas/{id}: get: description: '' operationId: getSchemaByID tags: [] parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/SchemaResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] put: summary: '' description: '' operationId: updateSchemaByID tags: *ref_0 parameters: - in: path name: id description: '' schema: type: integer required: true requestBody: content: application/json: schema: $ref: '#/components/schemas/SchemaRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/SchemaResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] delete: summary: '' description: '' operationId: deleteSchemaByID tags: [] parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: integer meta: $ref: '#/components/schemas/Meta' required: - success - data - meta - error - code security: - http1: [] /api/logs: post: description: '' operationId: createLog tags: &ref_1 [] parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/RecordRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/Meta' required: - success - data - error - code - meta security: - http1: [] get: description: '' operationId: getLog tags: *ref_1 parameters: - in: query name: page description: '' schema: type: integer - in: query name: limit description: '' schema: type: integer responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] /api/logs/{id}: get: description: '' operationId: getLogByID tags: &ref_10 [] parameters: &ref_11 - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/Meta' required: - success - data - meta - error - code security: &ref_12 - http1: [] /api/logs/group/{schema_name}/{hash}: get: description: '' operationId: getLogsBySchemaAndHash tags: [] parameters: - in: path name: schema_name description: '' schema: type: string required: true - in: path name: hash description: '' schema: type: string required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/Meta' required: - success - data - meta - code - error security: - http1: [] /api/logs/search: post: description: '' operationId: searchLogs tags: [] parameters: - in: query name: page description: '' schema: type: integer - in: query name: limit description: '' schema: type: integer - in: query name: from description: Time in format "YYYY-DD-MMTHH:SS" schema: type: string - in: query name: to description: Time in format "YYYY-DD-MMTHH:SS" schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/RecordRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/Meta' required: - success - meta - error - data - code security: - http1: [] /api/users: get: description: '' operationId: getUsers tags: &ref_2 [] parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/UserResponse' meta: $ref: '#/components/schemas/Meta' required: - success - error - meta - code - data security: - http1: [] post: description: '' operationId: createUser tags: *ref_2 parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/UserRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/UserResponse' meta: $ref: '#/components/schemas/Meta' required: - success - meta - data - error - code security: - http1: [] /api/users/{id}: get: description: '' operationId: getUserByID tags: &ref_3 [] parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/UserResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - meta - data - error security: - http1: [] delete: description: '' operationId: deleteUserByID tags: *ref_3 parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: integer description: Deleted User's ID meta: $ref: '#/components/schemas/Meta' required: - success - data - meta - code - error security: - http1: [] put: description: '' operationId: updateUserByID tags: *ref_3 parameters: - in: path name: id description: '' schema: type: integer required: true requestBody: content: application/json: schema: $ref: '#/components/schemas/UserRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/UserResponse' meta: $ref: '#/components/schemas/Meta' required: - success - meta - data - error - code security: - http1: [] /api/session: get: description: '' operationId: getSession tags: &ref_4 [] parameters: &ref_5 [] responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/Session' meta: $ref: '#/components/schemas/Meta' required: - success - meta - data - error - code security: [] post: description: '' operationId: createSession tags: *ref_4 parameters: *ref_5 requestBody: content: application/json: schema: $ref: '#/components/schemas/Credentials' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/Session' meta: $ref: '#/components/schemas/Meta' required: - success - meta - data - error - code /api/setup/register_admin: post: description: '' operationId: registerAdmin tags: [] parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/UserRequest' responses: '200': description: '' headers: {} content: application/json: schema: $ref: '#/components/schemas/UserResponse' security: [] /api/api_tokens: get: description: '' operationId: getTokens tags: &ref_6 [] parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/ApiTokenResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] post: description: '' operationId: createToken tags: *ref_6 parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/ApiTokenRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/ApiTokenResponse' meta: $ref: '#/components/schemas/Meta' required: - success - data - meta - code - error security: - http1: [] /api/api_tokens/{id}: get: description: '' operationId: getTokenByID tags: &ref_7 [] parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/ApiTokenResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] put: description: '' operationId: updateTokenByID tags: *ref_7 parameters: - in: path name: id description: '' schema: type: integer required: true requestBody: content: application/json: schema: $ref: '#/components/schemas/ApiTokenRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/ApiTokenResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] delete: description: '' operationId: deleteTokenByID tags: *ref_7 parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: number meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] /api/tags: get: description: '' operationId: getTags tags: &ref_8 [] parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/TagResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] post: description: '' operationId: createTag tags: *ref_8 parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/TagRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/TagResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] /api/tags/{id}: get: description: '' operationId: getTagByID tags: &ref_9 [] parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/TagResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] put: description: '' operationId: updateTagByID tags: *ref_9 parameters: - in: path name: id description: '' schema: type: integer required: true requestBody: content: application/json: schema: $ref: '#/components/schemas/TagRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/TagResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] delete: description: '' operationId: deleteTagByID tags: *ref_9 parameters: - in: path name: id description: '' schema: type: integer required: true responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: number meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] /api/logs/async: post: description: '' operationId: createLogAsync tags: [] parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/RecordRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: string meta: $ref: '#/components/schemas/Meta' required: - success - meta - data - error - code security: - http1: [] /api/logs/{id}/request: get: description: '' operationId: getLogRequestByID tags: *ref_10 parameters: *ref_11 responses: '200': description: '' content: application/json: schema: type: object properties: {} security: *ref_12 /api/logs/{id}/response: get: description: '' operationId: getLogResponseByID tags: *ref_10 parameters: *ref_11 responses: '200': description: '' content: application/json: schema: type: object properties: {} security: *ref_12 /api/logs/{id}/expose: put: description: '' operationId: exposeRecordByID tags: [] parameters: - in: path name: id description: '' schema: &ref_13 type: integer required: true responses: '200': description: '' headers: {} content: application/json: schema: type: object properties: success: type: string code: type: integer error: type: string data: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] /api/logs/{id}/cover: put: description: '' operationId: coverRecordByID tags: [] parameters: - in: path name: id description: '' schema: *ref_13 required: true responses: '200': description: '' headers: {} content: application/json: schema: type: object properties: success: type: string code: type: integer error: type: string data: $ref: '#/components/schemas/RecordResponse' meta: $ref: '#/components/schemas/RecordResponse' required: - success - code - error - data - meta security: - http1: [] /api/actions: get: description: '' operationId: getActions tags: &ref_14 [] parameters: &ref_15 [] responses: '200': description: '' headers: {} content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: array items: $ref: '#/components/schemas/ActionResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] post: description: '' operationId: createAction tags: *ref_14 parameters: *ref_15 requestBody: content: application/json: schema: $ref: '#/components/schemas/ActionRequest' responses: '200': description: '' headers: {} content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/ActionResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - error - data - meta security: - http1: [] /api/actions/{id}: get: description: '' operationId: getActionByID tags: *ref_3 parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/ActionResponse' meta: $ref: '#/components/schemas/Meta' required: - success - code - meta - data - error security: - http1: [] delete: description: '' operationId: deleteActionByID tags: *ref_3 parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: type: integer description: Deleted Actions's ID meta: $ref: '#/components/schemas/Meta' required: - success - data - meta - code - error security: - http1: [] put: description: '' operationId: updateActionByID tags: *ref_3 parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/ActionRequest' responses: '200': description: '' content: application/json: schema: type: object properties: success: type: boolean code: type: integer error: type: string data: $ref: '#/components/schemas/ActionResponse' meta: $ref: '#/components/schemas/Meta' required: - success - meta - data - error - code security: - http1: [] components: schemas: SchemaResponse: type: object properties: id: type: integer title: type: string description: type: string name: type: string fields: type: array items: $ref: '#/components/schemas/SchemaField' kinds: type: array items: $ref: '#/components/schemas/SchemaKind' tag_id: type: integer retention_days: type: integer required: - id - title - name - fields - kinds SchemaField: type: object properties: title: type: string name: type: string required: - title - name RecordResponse: type: object properties: id: type: integer text: type: string schema_name: type: string schema_id: type: integer query: type: object properties: {} request: type: object properties: {} response: type: object properties: {} kind: type: string created_at: type: string description: ISO8601 date-time group_hash: type: string level: oneOf: - $ref: '#/components/schemas/Level' is_exposed: type: boolean old_value: type: string new_value: type: string required: - id - text - schema_name - query - kind - created_at - group_hash - level - schema_id - request - response - is_exposed Level: type: string enum: - Trace - Debug - Info - Warn - Error - Fatal UserResponse: type: object properties: id: type: integer name: type: string email: type: string password: type: string password_digest: type: string role: oneOf: - $ref: '#/components/schemas/Role' tags: type: array items: type: number token: type: string is_revoked: type: boolean required: - id - name - email - password - role - tags - is_revoked Role: type: string enum: - Member - Admin Meta: type: object properties: page: type: integer count: type: integer pages: type: integer required: - page - count - pages Credentials: type: object properties: email: type: string password: type: string required: - email - password Session: type: object properties: token: type: string required: - token ApiTokenResponse: type: object properties: id: type: number token: type: string name: type: string is_revoked: type: boolean required: - id - token - name - is_revoked SchemaKind: type: object properties: title: type: string name: type: string required: - title - name TagResponse: type: object properties: id: type: integer name: type: string view_order: type: integer required: - id - name - view_order RecordRequest: type: object properties: text: type: string schema_name: type: string created_at: type: string description: ISO8601 date-time schema_id: type: integer query: type: object properties: {} request: type: object properties: {} response: type: object properties: {} kind: type: string level: oneOf: - $ref: '#/components/schemas/Level' is_exposed: type: boolean old_value: type: string new_value: type: string required: - text - schema_name - query SchemaRequest: type: object properties: title: type: string description: type: string name: type: string fields: type: array items: $ref: '#/components/schemas/SchemaField' kinds: type: array items: $ref: '#/components/schemas/SchemaKind' tag_id: type: integer tag_name: type: string retention_days: type: integer required: - title - name - fields - description UserRequest: type: object properties: name: type: string email: type: string password: type: string password_digest: type: string role: oneOf: - $ref: '#/components/schemas/Role' tags: type: array items: type: number token: type: string is_revoked: type: boolean required: - name - email - password - role TagRequest: type: object properties: name: type: string view_order: type: integer required: - name - view_order ApiTokenRequest: type: object properties: name: type: string required: - name Condition: type: object properties: attribute: type: string operation: type: string value: type: string required: - attribute - value - operation ActionResponse: type: object properties: id: type: integer name: type: string pattern: type: string method: type: string conditions: type: array items: $ref: '#/components/schemas/Condition' schema_name: type: string schema_ids: type: array items: type: integer disabled: type: boolean required: - id - name - pattern - method - conditions - schema_name - schema_ids - disabled ActionRequest: type: object properties: name: type: string pattern: type: string method: type: string conditions: type: array items: $ref: '#/components/schemas/Condition' schema_name: type: string schema_ids: type: array items: type: integer disabled: type: boolean required: - id - name - pattern - method - schema_name securitySchemes: http1: type: http scheme: bearer