{ "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "swagger": "2.0", "info": { "title": "Reimbursements API", "version": "1.0" }, "basePath": "/v1", "paths": { "/api-docs": { "get": { "security": [], "produces": [ "text/html" ], "tags": [ "docs" ], "summary": "Get swagger documentation", "operationId": "getDoc", "responses": { "200": { "$ref": "#/responses/ok" } } } }, "/expense/{action}/{reportId}": { "post": { "description": "approves or rejects expense report", "summary": "Expense Action", "operationId": "expenseAction", "parameters": [ { "type": "string", "name": "action", "in": "path", "required": true }, { "type": "string", "name": "reportId", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/ok" }, "400": { "$ref": "#/responses/invalid-request" }, "401": { "$ref": "#/responses/unauthorized" }, "500": { "$ref": "#/responses/error" } } } }, "/health": { "get": { "security": [], "summary": "Get API Health Status", "operationId": "healthCheck", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/health" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/health" } } } } }, "/reimbursement/{projectId}": { "post": { "description": "Create a new Reimbursement policy", "tags": [ "reimbursement" ], "summary": "Create Reimbursement", "operationId": "createReimbursement", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "allOf": [ { "$ref": "#/definitions/policy-create-input" }, { "$ref": "#/definitions/policy-update-input" } ] } } ], "responses": { "200": { "$ref": "#/responses/ok" }, "400": { "$ref": "#/responses/invalid-request" }, "401": { "$ref": "#/responses/unauthorized" }, "500": { "$ref": "#/responses/error" } } }, "patch": { "description": "Update an existing Reimbursement policy", "tags": [ "reimbursement" ], "summary": "Update Reimbursement", "operationId": "updateReimbursement", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/policy-update-input" } } ], "responses": { "200": { "$ref": "#/responses/ok" }, "400": { "$ref": "#/responses/invalid-request" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/not-found" }, "500": { "$ref": "#/responses/error" } } }, "parameters": [ { "type": "string", "name": "projectId", "in": "path", "required": true } ] }, "/reset": { "post": { "description": "Reset an existing policy to match with templatePolicy", "summary": "Reset Policy", "operationId": "resetPolicy", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/policy-reset-input" } } ], "responses": { "200": { "$ref": "#/responses/ok" }, "400": { "$ref": "#/responses/invalid-request" }, "401": { "$ref": "#/responses/unauthorized" }, "500": { "$ref": "#/responses/error" } } } }, "/tag": { "post": { "description": "Tag adds a tag to the policy", "summary": "Tag Policy", "operationId": "tagPolicy", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/policy-tag-input" } } ], "responses": { "200": { "$ref": "#/responses/ok" }, "400": { "$ref": "#/responses/invalid-request" }, "401": { "$ref": "#/responses/unauthorized" }, "500": { "$ref": "#/responses/error" } } } } }, "definitions": { "contact": { "description": "Contact information", "type": "object", "title": "Contact", "properties": { "EmailAddress": { "type": "string", "example": "BugsBunny@example.org" }, "Name": { "type": "string", "example": "Bugs Bunny" } } }, "error-response": { "description": "Standard error format", "type": "object", "title": "Error Response", "properties": { "Code": { "description": "Error Code", "type": "number", "format": "int64", "example": 401 }, "Message": { "description": "Error Message", "type": "string", "example": "Unauthorized" } } }, "health": { "type": "object", "title": "Health", "properties": { "BuildTimeStamp": { "description": "Time the service was built and deployed", "type": "string", "example": "2019-06-06_02:59:49PM" }, "Githash": { "description": "hash of the latest Git commit of the service at time of building", "type": "string", "example": "62009963c9e1cedaf7a24649208983163f8c439e" }, "Healths": { "type": "array", "items": { "$ref": "#/definitions/health-status" } }, "Status": { "description": "Confirmation that the service is doing well", "type": "string", "example": "healthy" }, "TimeStamp": { "description": "Current server time", "type": "string", "example": "2019-06-07 15:37:43.131125775 +0000 UTC m=+0.257970409" } } }, "health-status": { "type": "object", "title": "Health Status", "properties": { "Duration": { "description": "Service response time", "type": "string" }, "Error": { "description": "Service Name", "type": "string" }, "Healthy": { "description": "Service is healthy?", "type": "boolean" }, "Name": { "description": "Service Name", "type": "string" }, "TimeStamp": { "description": "Service's server time", "type": "string", "example": "2019-06-07 15:37:43.131120884 +0000 UTC m=+0.257965506" } } }, "policy-create-input": { "description": "Reimbursement creation information", "type": "object", "title": "Policy Create", "required": [ "ProjectName" ], "properties": { "ProjectName": { "type": "string", "example": "The Looney Tunes Show" } } }, "policy-reset-input": { "description": "Expensify policy reset information", "type": "object", "title": "Policy Reset", "required": [ "PolicyID" ], "properties": { "PolicyID": { "description": "Unique ID of the policy to reset", "type": "string", "example": "F11B6C1D67DC6A3D" }, "TemplatePolicyID": { "description": "Unique ID of the template policy to copy from", "type": "string", "example": "F11B6C1D67DC6A3D" } } }, "policy-tag-input": { "description": "Expensify policy tag information", "type": "object", "title": "Policy Tag", "properties": { "Email": { "description": "email of the individual or beneficiary", "type": "string", "example": "john-doe@email.com" }, "EventName": { "description": "Unique name of the event", "type": "string", "example": "KubeCon 2023" }, "TicketID": { "description": "Unique ID of the ticket - required for travel funds", "type": "string", "example": "F11B6C1D67DC6A3D" }, "TxnType": { "description": "Type of transaction", "type": "string", "example": "Travel Fund" }, "Username": { "description": "Unique username or lfId of the individual", "type": "string", "example": "john_doe" } } }, "policy-update-input": { "description": "Reimbursement update information", "type": "object", "title": "Policy Update", "required": [ "Categories", "Owner", "ProjectURL" ], "properties": { "Beneficiaries": { "type": "array", "items": { "$ref": "#/definitions/contact" }, "example": [ { "EmailAddress": "DaffyDuck@example.org", "Name": "Daffy Duck" }, { "EmailAddress": "PorkyPig@example.org", "Name": "Porky Pik" } ] }, "Categories": { "type": "array", "items": { "type": "string" }, "example": [ "Anvils", "Carrots", "Travel" ] }, "EntityType": { "type": "string", "example": "other" }, "Owner": { "$ref": "#/definitions/contact" }, "ProjectURL": { "type": "string", "example": "https://funding.dev.platform.linuxfoundation.org/projects/asp-net" } } } }, "responses": { "error": { "description": "Server Error", "schema": { "$ref": "#/definitions/error-response" } }, "invalid-request": { "description": "Invalid Request", "schema": { "$ref": "#/definitions/error-response" } }, "not-found": { "description": "Not Found", "schema": { "$ref": "#/definitions/error-response" } }, "ok": { "description": "OK" }, "unauthorized": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/error-response" } } }, "securityDefinitions": { "ApiKeyAuth": { "description": "For accessing the API a valid API Key must be passed in all the queries in the 'X-API-KEY' header.\n", "type": "apiKey", "name": "X-API-Key", "in": "header" } }, "security": [ { "ApiKeyAuth": [] } ], "tags": [ { "name": "reimbursement" } ] }