{ "openapi": "3.0.3", "info": { "title": "Admina API", "version": "1.0.0", "description": "Admina (by Money Forward) public API for managing organizations, users, identities, devices, services, spend tracking, and alerts for SaaS management.", "x-jentic-source-url": "https://docs.itmc.i.moneyforward.com/reference/introduction" }, "servers": [ { "url": "https://api.itmc.i.moneyforward.com/api/v1", "description": "Production" } ], "paths": { "/organization": { "get": { "operationId": "getOrganization", "summary": "Get an organization", "description": "Retrieve organization details.", "tags": [ "Organizations" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Organization retrieved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Organization" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/users": { "get": { "operationId": "listUsers", "summary": "List organization users", "description": "Retrieve a list of users in the organization.", "tags": [ "Users" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Users retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/User" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/admin-count": { "get": { "operationId": "getAdminCount", "summary": "Get admin user count", "description": "Get the number of users with admin role.", "tags": [ "Users" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Admin count retrieved", "content": { "application/json": { "schema": { "type": "object", "properties": { "count": { "type": "integer" } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/user": { "patch": { "operationId": "updateUser", "summary": "Update a user", "description": "Update an organization user.", "tags": [ "Users" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserUpdate" } } } }, "responses": { "200": { "description": "User updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/identity": { "post": { "operationId": "createIdentity", "summary": "Create an identity", "description": "Create a new identity.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdentityCreate" } } } }, "responses": { "201": { "description": "Identity created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Identity" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/identities": { "get": { "operationId": "listIdentities", "summary": "List identities", "description": "Retrieve a list of identities.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Identities retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Identity" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identity-management-type": { "get": { "operationId": "getIdentityManagementType", "summary": "Check identity management type", "description": "Check the identity management type configuration.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Management type retrieved", "content": { "application/json": { "schema": { "type": "object", "properties": { "management_type": { "type": "string" } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identities-stats": { "get": { "operationId": "getIdentitiesStats", "summary": "Get identities statistics", "description": "Retrieve identity statistics.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Stats retrieved", "content": { "application/json": { "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "active": { "type": "integer" }, "archived": { "type": "integer" } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identity/{id}": { "get": { "operationId": "getIdentity", "summary": "Get an identity", "description": "Retrieve an identity by ID.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Identity retrieved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Identity" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" } } }, "put": { "operationId": "updateIdentity", "summary": "Update an identity", "description": "Update an identity by ID.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdentityUpdate" } } } }, "responses": { "200": { "description": "Identity updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Identity" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } }, "delete": { "operationId": "deleteIdentity", "summary": "Delete an identity", "description": "Delete an identity by ID.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Identity deleted" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" } } } }, "/identity/{id}/history": { "get": { "operationId": "getIdentityHistory", "summary": "Get identity history", "description": "Retrieve the history of an identity.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "History retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "details": { "type": "object" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identity/{id}/archive": { "put": { "operationId": "toggleIdentityArchive", "summary": "Toggle identity archive flag", "description": "Toggle the archive flag on an identity.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Archive flag toggled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Identity" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identity/{id}/unregister": { "put": { "operationId": "toggleIdentityUnregister", "summary": "Toggle identity unregistered management", "description": "Toggle the unregistered management flag on an identity.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Unregister flag toggled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Identity" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identities/bulk": { "patch": { "operationId": "bulkUpdateIdentities", "summary": "Bulk update identities", "description": "Bulk update multiple identities.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/IdentityUpdate" } } } } }, "responses": { "200": { "description": "Identities updated" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/identities/merge": { "post": { "operationId": "mergeIdentities", "summary": "Merge identities", "description": "Merge an identity with another in batch.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "source_id": { "type": "string" }, "target_id": { "type": "string" } }, "required": [ "source_id", "target_id" ] } } } }, "responses": { "200": { "description": "Identities merged" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/identities/unmerge": { "post": { "operationId": "unmergeIdentities", "summary": "Unmerge identities", "description": "Unmerge previously merged identity entities.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "identity_id": { "type": "string" } }, "required": [ "identity_id" ] } } } }, "responses": { "200": { "description": "Identities unmerged" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identity/{id}/field-config": { "get": { "operationId": "getIdentityFieldConfig", "summary": "Get identity field configuration", "description": "Retrieve the field configuration for an identity.", "tags": [ "Identities" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Field config retrieved", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/identity-custom-fields": { "get": { "operationId": "listCustomFields", "summary": "List custom fields", "description": "Get all custom fields for identities.", "tags": [ "Custom Fields" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Custom fields retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CustomField" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } }, "post": { "operationId": "createCustomField", "summary": "Create custom field", "description": "Create a new custom field.", "tags": [ "Custom Fields" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomFieldCreate" } } } }, "responses": { "201": { "description": "Custom field created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomField" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/identity-custom-fields/{id}": { "patch": { "operationId": "updateCustomField", "summary": "Update custom field", "description": "Update an existing custom field.", "tags": [ "Custom Fields" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomFieldCreate" } } } }, "responses": { "200": { "description": "Custom field updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomField" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } }, "delete": { "operationId": "deleteCustomField", "summary": "Delete custom field", "description": "Delete a custom field.", "tags": [ "Custom Fields" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Custom field deleted" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/departments": { "get": { "operationId": "listDepartments", "summary": "List departments", "description": "List all departments in the organization.", "tags": [ "Directory" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Departments retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/locations": { "get": { "operationId": "listLocations", "summary": "List locations", "description": "List all locations in the organization.", "tags": [ "Directory" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Locations retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/companies": { "get": { "operationId": "listCompanies", "summary": "List companies", "description": "List all companies in the organization.", "tags": [ "Directory" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Companies retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/provisioning-meta": { "get": { "operationId": "getProvisioningMeta", "summary": "Get provisioning metadata", "description": "Get provisioning metadata for workspace accounts.", "tags": [ "Workspace Accounts" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Metadata retrieved", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/saas-account": { "post": { "operationId": "createSaasAccount", "summary": "Create a SaaS account", "description": "Create a new SaaS account.", "tags": [ "Workspace Accounts" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "service_id": { "type": "string" }, "identity_id": { "type": "string" }, "email": { "type": "string" }, "account_name": { "type": "string" } }, "required": [ "service_id" ] } } } }, "responses": { "201": { "description": "SaaS account created" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/accounts": { "delete": { "operationId": "deactivateAccounts", "summary": "Deactivate or delete accounts", "description": "Deactivate or delete workspace accounts.", "tags": [ "Workspace Accounts" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "account_ids": { "type": "array", "items": { "type": "string" } } }, "required": [ "account_ids" ] } } } }, "responses": { "200": { "description": "Accounts deactivated" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/people": { "get": { "operationId": "listPeople", "summary": "List organization people", "description": "List all people in the organization.", "tags": [ "People" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "People retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Person" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/person/{id}": { "get": { "operationId": "getPerson", "summary": "Get a person", "description": "Get a person by ID.", "tags": [ "People" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Person retrieved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Person" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" } } } }, "/person/{id}/accounts": { "get": { "operationId": "listPersonAccounts", "summary": "List SaaS accounts for a person", "description": "List SaaS accounts associated with a person.", "tags": [ "People" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Accounts retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "service_name": { "type": "string" }, "email": { "type": "string" }, "status": { "type": "string" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/device": { "post": { "operationId": "createDevice", "summary": "Create a device", "description": "Create a new device record.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceCreate" } } } }, "responses": { "201": { "description": "Device created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Device" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/devices": { "get": { "operationId": "listDevices", "summary": "List devices", "description": "Return a list of devices with optional filtering.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Devices retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Device" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } }, "delete": { "operationId": "deleteDevices", "summary": "Delete multiple devices", "description": "Delete multiple devices.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "device_ids": { "type": "array", "items": { "type": "string" } } }, "required": [ "device_ids" ] } } } }, "responses": { "200": { "description": "Devices deleted" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/devices/bulk": { "post": { "operationId": "bulkCreateDevices", "summary": "Bulk create devices", "description": "Create multiple devices in bulk.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DeviceCreate" } } } } }, "responses": { "201": { "description": "Devices created" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/device/{id}": { "patch": { "operationId": "updateDevice", "summary": "Update a device", "description": "Update a device by ID.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceUpdate" } } } }, "responses": { "200": { "description": "Device updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Device" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/device/{id}/meta": { "patch": { "operationId": "updateDeviceMetadata", "summary": "Update device metadata", "description": "Update metadata for a device.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "responses": { "200": { "description": "Device metadata updated" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/device/{id}/history": { "post": { "operationId": "createDeviceHistory", "summary": "Create device history entry", "description": "Create a new history entry for a device.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "action": { "type": "string" }, "details": { "type": "string" } }, "required": [ "action" ] } } } }, "responses": { "201": { "description": "History entry created" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/device/{id}/histories": { "get": { "operationId": "getDeviceHistories", "summary": "Get device history entries", "description": "Get all history entries for a device.", "tags": [ "Devices" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Histories retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string" }, "details": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/alerts": { "get": { "operationId": "listAlerts", "summary": "List organization alerts", "description": "List all alerts for the organization.", "tags": [ "Alerts" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Alerts retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Alert" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/alert-mutes": { "get": { "operationId": "listAlertMutes", "summary": "List alert type mutes", "description": "List muted alert types.", "tags": [ "Alerts" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Alert mutes retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "alert_type": { "type": "string" }, "service_id": { "type": "string" }, "muted": { "type": "boolean" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/alerts/mute-services": { "post": { "operationId": "muteServiceAlerts", "summary": "Mute service alerts", "description": "Mute alerts for specified services.", "tags": [ "Alerts" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "service_ids": { "type": "array", "items": { "type": "string" } } }, "required": [ "service_ids" ] } } } }, "responses": { "200": { "description": "Services muted" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/alerts/unmute-services": { "delete": { "operationId": "unmuteServiceAlerts", "summary": "Unmute service alerts", "description": "Unmute alerts for specified services.", "tags": [ "Alerts" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "service_ids": { "type": "array", "items": { "type": "string" } } }, "required": [ "service_ids" ] } } } }, "responses": { "200": { "description": "Services unmuted" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/spends/services": { "get": { "operationId": "getSpendsByServices", "summary": "Get spends by services", "description": "Get spend data grouped by services.", "tags": [ "Spends" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Spends retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "service_id": { "type": "string" }, "service_name": { "type": "string" }, "total_spend": { "type": "number" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/spends/monthly": { "get": { "operationId": "getMonthlySpends", "summary": "Get spends by month", "description": "Get spend data grouped by month.", "tags": [ "Spends" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Monthly spends retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "month": { "type": "string" }, "total_spend": { "type": "number" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/spends/import": { "post": { "operationId": "importSpends", "summary": "Import spends", "description": "Import spend data.", "tags": [ "Spends" ], "security": [ { "BearerAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "service_id": { "type": "string" }, "amount": { "type": "number" }, "currency": { "type": "string" }, "date": { "type": "string", "format": "date" } }, "required": [ "service_id", "amount", "date" ] } } } } }, "responses": { "200": { "description": "Spends imported" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Unprocessable entity" } } } }, "/spends/export": { "get": { "operationId": "exportSpends", "summary": "Export spends as CSV", "description": "Export spending data as CSV.", "tags": [ "Spends" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "CSV export", "content": { "text/csv": { "schema": { "type": "string" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/services": { "get": { "operationId": "listServices", "summary": "List organization services", "description": "List all services in the organization.", "tags": [ "Services" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Services retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Service" } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/services/engagement-scores": { "get": { "operationId": "getEngagementScores", "summary": "Get engagement scores", "description": "Get engagement scores for services.", "tags": [ "Services" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Scores retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "service_id": { "type": "string" }, "score": { "type": "number" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/services/unused-resources": { "get": { "operationId": "getUnusedResources", "summary": "Get unused resources", "description": "Get unused resources across services.", "tags": [ "Services" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Unused resources retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "service_id": { "type": "string" }, "resource_type": { "type": "string" }, "count": { "type": "integer" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/service/{id}/accounts": { "get": { "operationId": "listServiceAccounts", "summary": "List service SaaS accounts", "description": "List SaaS accounts for a service.", "tags": [ "Services" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Accounts retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "status": { "type": "string" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/service/{id}/files": { "get": { "operationId": "getServiceFiles", "summary": "Get files for a service", "description": "Get files associated with a service.", "tags": [ "Services" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Files retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" } } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/event-logs/service-summary": { "get": { "operationId": "getEventLogsByService", "summary": "List event logs by service", "description": "List event log entries grouped by service.", "tags": [ "Logs" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Event logs retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/event-logs/user-summary": { "get": { "operationId": "getEventLogsByUser", "summary": "List event logs by user", "description": "List event log entries grouped by user.", "tags": [ "Logs" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Event logs retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/event-logs": { "get": { "operationId": "listEventLogs", "summary": "List event logs", "description": "List all event logs.", "tags": [ "Logs" ], "security": [ { "BearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "schema": { "type": "integer" } }, { "name": "per_page", "in": "query", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Event logs retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/audit-logs/export": { "get": { "operationId": "exportAuditLogs", "summary": "Export audit logs as CSV", "description": "Export audit logs as CSV.", "tags": [ "Logs" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "CSV export", "content": { "text/csv": { "schema": { "type": "string" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } }, "/audit-logs/count": { "get": { "operationId": "countAuditLogs", "summary": "Count audit logs", "description": "Get the count of audit log entries.", "tags": [ "Logs" ], "security": [ { "BearerAuth": [] } ], "responses": { "200": { "description": "Count retrieved", "content": { "application/json": { "schema": { "type": "object", "properties": { "count": { "type": "integer" } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "API key passed as Bearer token" } }, "schemas": { "Organization": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "plan": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" } } }, "User": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "role": { "type": "string" }, "status": { "type": "string" } } }, "UserUpdate": { "type": "object", "properties": { "id": { "type": "string" }, "role": { "type": "string" }, "name": { "type": "string" } } }, "Identity": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "department": { "type": "string" }, "location": { "type": "string" }, "status": { "type": "string" }, "archived": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "IdentityCreate": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "type": "string" }, "department": { "type": "string" }, "location": { "type": "string" } }, "required": [ "email", "name" ] }, "IdentityUpdate": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "department": { "type": "string" }, "location": { "type": "string" } } }, "CustomField": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "field_type": { "type": "string" }, "required": { "type": "boolean" } } }, "CustomFieldCreate": { "type": "object", "properties": { "name": { "type": "string" }, "field_type": { "type": "string" }, "required": { "type": "boolean" } }, "required": [ "name", "field_type" ] }, "Person": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "department": { "type": "string" }, "status": { "type": "string" } } }, "Device": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" }, "serial_number": { "type": "string" }, "os": { "type": "string" }, "status": { "type": "string" }, "assigned_to": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "DeviceCreate": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "serial_number": { "type": "string" }, "os": { "type": "string" }, "assigned_to": { "type": "string" } }, "required": [ "name" ] }, "DeviceUpdate": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "serial_number": { "type": "string" }, "os": { "type": "string" }, "status": { "type": "string" }, "assigned_to": { "type": "string" } } }, "Alert": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "message": { "type": "string" }, "service_id": { "type": "string" }, "severity": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" } } }, "Service": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "category": { "type": "string" }, "account_count": { "type": "integer" }, "status": { "type": "string" } } } } }, "security": [ { "BearerAuth": [] } ] }