[ { "title": "Authentication", "path": "/auth", "entrypoint": "auth", "authentication": [], "apis": [ { "name": "settings", "method": "GET", "title": "Returns auth settings", "path": "/", "parameters": {} }, { "name": "check", "method": "GET", "title": "Check JWT token", "path": "/check", "parameters": {} }, { "name": "exchangeAuthToken", "method": "POST", "title": "Exchange auth token for JWT", "path": "/exchange", "parameters": { "post": [ { "name": "token", "type": "string", "required": true, "title": "Token to be exchanged for JWT" } ] } }, { "name": "logout", "method": "GET", "title": "Logout", "path": "/logout", "parameters": {} } ] }, { "title": "Internal authentication", "path": "/auth/internal", "entrypoint": "auth_internal", "authentication": [], "apis": [ { "name": "login", "method": "POST", "title": "Login user", "path": "/login", "parameters": { "post": [ { "name": "email", "type": "string", "required": true, "title": "Email" }, { "name": "password", "type": "string", "required": true, "sensitive": true, "title": "Password" } ] } }, { "name": "signup", "method": "POST", "title": "User signup/registration", "path": "/signup", "parameters": { "post": [ { "name": "email", "type": "string", "required": true, "title": "Email" }, { "name": "username", "type": "string", "required": false, "title": "Username" }, { "name": "password", "type": "string", "required": true, "sensitive": true, "title": "Password" }, { "name": "handle", "type": "string", "required": false, "title": "User handle" }, { "name": "name", "type": "string", "required": false, "title": "Display name" } ] } }, { "name": "requestPasswordReset", "method": "POST", "title": "Request password reset token (via email)", "path": "/request-password-reset", "parameters": { "post": [ { "name": "email", "type": "string", "required": true, "title": "Email" } ] } }, { "name": "exchangePasswordResetToken", "method": "POST", "title": "Exchange password reset token for new token and user info", "path": "/exchange-password-reset-token", "parameters": { "post": [ { "name": "token", "type": "string", "required": true, "title": "Token" } ] } }, { "name": "resetPassword", "method": "POST", "title": "Reset password with exchanged password reset token", "path": "/reset-password", "parameters": { "post": [ { "name": "token", "type": "string", "required": true, "title": "Token" }, { "name": "password", "type": "string", "required": true, "sensitive": true, "title": "Password" } ] } }, { "name": "confirmEmail", "method": "POST", "title": "Confirm email with token", "path": "/confirm-email", "parameters": { "post": [ { "name": "token", "type": "string", "required": true, "title": "Token" } ] } }, { "name": "changePassword", "method": "POST", "title": "Changes password for current user, requires current password", "path": "/change-password", "parameters": { "post": [ { "name": "oldPassword", "type": "string", "required": true, "sensitive": true, "title": "Old password" }, { "name": "newPassword", "type": "string", "required": true, "sensitive": true, "title": "New password" } ] } } ] }, { "title": "Settings", "path": "/settings", "entrypoint": "settings", "authentication": [], "struct": [ { "imports": [ "sqlxTypes github.com/jmoiron/sqlx/types" ] } ], "apis": [ { "name": "list", "method": "GET", "title": "List settings", "path": "/", "parameters": { "get": [ { "name": "prefix", "type": "string", "title": "Key prefix" } ] } }, { "name": "update", "method": "PATCH", "title": "Update settings", "path": "/", "parameters": { "post": [ { "name": "values", "type": "sqlxTypes.JSONText", "title": "Array of new settings: `[{ name: ..., value: ... }]`. Omit value to remove setting", "required": true } ] } }, { "name": "get", "method": "GET", "title": "Check JWT token", "path": "/{key}", "parameters": { "path": [ { "name": "key", "type": "string", "title": "Setting key", "required": true } ], "get": [ { "name": "ownerID", "type": "uint64", "title": "Owner ID" } ] } }, { "name": "set", "method": "PUT", "title": "Set a value for a key", "path": "/{key}", "parameters": { "path": [ { "name": "key", "type": "string", "title": "Setting key", "required": true } ], "post": [ { "name": "ownerID", "type": "uint64", "title": "Owner" }, { "name": "value", "type": "sqlxTypes.JSONText", "required": true, "title": "Setting value" } ] } } ] }, { "title": "Organisations", "description": "Organisations represent a top-level grouping entity. There may be many organisations defined in a single deployment.", "path": "/organisations", "entrypoint": "organisation", "authentication": [ "Client ID", "Session ID" ], "apis": [ { "name": "list", "method": "GET", "title": "List organisations", "path": "/", "parameters": { "get": [ { "type": "string", "name": "query", "required": false, "title": "Search query" } ] } }, { "name": "create", "method": "POST", "title": "Create organisation", "path": "/", "parameters": { "post": [ { "type": "string", "name": "name", "required": true, "title": "Organisation Name" } ] } }, { "name": "update", "method": "PUT", "title": "Update organisation details", "path": "/{id}", "parameters": { "path": [ { "type": "uint64", "name": "id", "required": false, "title": "Organisation ID" } ], "post": [ { "type": "string", "name": "name", "required": true, "title": "Organisation Name" } ] } }, { "name": "delete", "method": "DELETE", "title": "Remove organisation", "path": "/{id}", "parameters": { "path": [ { "type": "uint64", "name": "id", "required": true, "title": "Organisation ID" } ] } }, { "name": "read", "method": "GET", "title": "Read organisation details", "path": "/{id}", "parameters": { "get": [ { "type": "uint64", "name": "id", "required": true, "title": "Organisation ID" } ] } }, { "name": "archive", "method": "POST", "title": "Archive organisation", "path": "/{id}/archive", "parameters": { "path": [ { "type": "uint64", "name": "id", "required": true, "title": "Organisation ID" } ] } } ] }, { "title": "Roles", "description": "An organisation may have many roles. Roles may have many channels available. Access to channels may be shared between roles.", "path": "/roles", "entrypoint": "role", "authentication": [ "Client ID", "Session ID" ], "apis": [ { "name": "list", "method": "GET", "title": "List roles", "path": "/", "parameters": { "get": [ { "type": "string", "name": "query", "required": false, "title": "Search query" } ] } }, { "name": "create", "method": "POST", "title": "Update role details", "path": "/", "parameters": { "post": [ { "type": "string", "name": "name", "required": true, "title": "Name of Role" }, { "type": "string", "name": "handle", "required": true, "title": "Handle for Role" }, { "type": "[]string", "name": "members", "required": false, "title": "Role member IDs" } ] } }, { "name": "update", "method": "PUT", "title": "Update role details", "path": "/{roleID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" } ], "post": [ { "type": "string", "name": "name", "required": false, "title": "Name of Role" }, { "type": "string", "name": "handle", "required": false, "title": "Handle for Role" }, { "type": "[]string", "name": "members", "required": false, "title": "Role member IDs" } ] } }, { "name": "read", "method": "GET", "title": "Read role details and memberships", "path": "/{roleID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" } ] } }, { "name": "delete", "method": "DELETE", "title": "Remove role", "path": "/{roleID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" } ] } }, { "name": "archive", "method": "POST", "title": "Archive role", "path": "/{roleID}/archive", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" } ] } }, { "name": "move", "method": "POST", "title": "Move role to different organisation", "path": "/{roleID}/move", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" } ], "post": [ { "type": "uint64", "name": "organisationID", "required": true, "title": "Role ID" } ] } }, { "name": "merge", "method": "POST", "title": "Merge one role into another", "path": "/{roleID}/merge", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Source Role ID" } ], "post": [ { "type": "uint64", "name": "destination", "required": true, "title": "Destination Role ID" } ] } }, { "name": "memberList", "method": "GET", "title": "Returns all role members", "path": "/{roleID}/members", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Source Role ID" } ] } }, { "name": "memberAdd", "method": "POST", "title": "Add member to a role", "path": "/{roleID}/member/{userID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Source Role ID" }, { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "memberRemove", "method": "DELETE", "title": "Remove member from a role", "path": "/{roleID}/member/{userID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Source Role ID" }, { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } } ] }, { "title": "Users", "path": "/users", "entrypoint": "user", "authentication": [ "Client ID", "Session ID" ], "struct": [ { "imports": [ "github.com/cortezaproject/corteza-server/system/types" ] } ], "apis": [ { "name": "list", "method": "GET", "title": "Search users (Directory)", "path": "/", "parameters": { "get": [ { "type": "string", "name": "query", "required": false, "title": "Search query to match against users" }, { "type": "string", "name": "username", "required": false, "title": "Search username to match against users" }, { "type": "string", "name": "email", "required": false, "title": "Search email to match against users" }, { "type": "string", "name": "handle", "required": false, "title": "Search handle to match against users" }, { "name": "kind", "type": "types.UserKind", "required": false, "title": "Kind (normal, bot)" }, { "type": "bool", "name": "incDeleted", "required": false, "title": "Include deleted users (requires 'access' permission)" }, { "type": "bool", "name": "incSuspended", "required": false, "title": "Include suspended users (requires 'access' permission)" }, { "name": "sort", "type": "string", "required": false, "title": "Sort by (createdAt, updatedAt, deletedAt, suspendedAt, email, username, userID)" }, { "name": "page", "type": "uint", "required": false, "title": "Page number (0 based)" }, { "name": "perPage", "type": "uint", "required": false, "title": "Returned items per page" } ] } }, { "name": "create", "method": "POST", "title": "Create user", "path": "/", "parameters": { "post": [ { "name": "email", "type": "string", "required": true, "title": "Email" }, { "name": "name", "type": "string", "required": false, "title": "Name" }, { "name": "handle", "type": "string", "required": false, "title": "Handle" }, { "name": "kind", "type": "types.UserKind", "required": false, "title": "Kind (normal, bot)" } ] } }, { "name": "update", "method": "PUT", "title": "Update user details", "path": "/{userID}", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ], "post": [ { "name": "email", "type": "string", "required": true, "title": "Email" }, { "name": "name", "type": "string", "required": true, "title": "Name" }, { "name": "handle", "type": "string", "required": false, "title": "Handle" }, { "name": "kind", "type": "types.UserKind", "required": false, "title": "Kind (normal, bot)" } ] } }, { "name": "read", "method": "GET", "title": "Read user details", "path": "/{userID}", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "delete", "method": "DELETE", "title": "Remove user", "path": "/{userID}", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "suspend", "method": "POST", "title": "Suspend user", "path": "/{userID}/suspend", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "unsuspend", "method": "POST", "title": "Unsuspend user", "path": "/{userID}/unsuspend", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "setPassword", "method": "POST", "title": "Set's or changes user's password", "path": "/{userID}/password", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ], "post": [ { "name": "password", "type": "string", "required": true, "sensitive": true, "title": "New password" } ] } }, { "name": "membershipList", "method": "GET", "title": "Add member to a role", "path": "/{userID}/membership", "parameters": { "path": [ { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "membershipAdd", "method": "POST", "title": "Add role to a user", "path": "/{userID}/membership/{roleID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" }, { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } }, { "name": "membershipRemove", "method": "DELETE", "title": "Remove role from a user", "path": "/{userID}/membership/{roleID}", "parameters": { "path": [ { "type": "uint64", "name": "roleID", "required": true, "title": "Role ID" }, { "type": "uint64", "name": "userID", "required": true, "title": "User ID" } ] } } ] }, { "title": "Applications", "path": "/application", "entrypoint": "application", "authentication": [], "struct": [ { "imports": [ "sqlxTypes github.com/jmoiron/sqlx/types" ] } ], "apis": [ { "name": "list", "method": "GET", "title": "List applications", "path": "/" }, { "name": "create", "method": "POST", "title": "Create application", "path": "/", "parameters": { "post": [ { "name": "name", "type": "string", "required": true, "title": "Application name" }, { "name": "enabled", "type": "bool", "required": false, "title": "Enabled" }, { "name": "unify", "type": "sqlxTypes.JSONText", "required": false, "title": "Unify properties" }, { "name": "config", "type": "sqlxTypes.JSONText", "required": false, "title": "Arbitrary JSON holding application configuration" } ] } }, { "name": "update", "method": "PUT", "title": "Update user details", "path": "/{applicationID}", "parameters": { "path": [ { "type": "uint64", "name": "applicationID", "required": true, "title": "Application ID" } ], "post": [ { "name": "name", "type": "string", "required": true, "title": "Email" }, { "name": "enabled", "type": "bool", "required": false, "title": "Enabled" }, { "name": "unify", "type": "sqlxTypes.JSONText", "required": false, "title": "Unify properties" }, { "name": "config", "type": "sqlxTypes.JSONText", "required": false, "title": "Arbitrary JSON holding application configuration" } ] } }, { "name": "read", "method": "GET", "title": "Read application details", "path": "/{applicationID}", "parameters": { "path": [ { "type": "uint64", "name": "applicationID", "required": true, "title": "Application ID" } ] } }, { "name": "delete", "method": "DELETE", "title": "Remove application", "path": "/{applicationID}", "parameters": { "path": [ { "type": "uint64", "name": "applicationID", "required": true, "title": "Application ID" } ] } } ] }, { "title": "Permissions", "parameters": {}, "entrypoint": "permissions", "path": "/permissions", "authentication": [ "Client ID", "Session ID" ], "struct": [ { "imports": [ "github.com/cortezaproject/corteza-server/internal/permissions" ] } ], "apis": [ { "name": "list", "path": "/", "method": "GET", "title": "Retrieve defined permissions", "parameters": {} }, { "name": "effective", "path": "/effective", "method": "GET", "title": "Effective rules for current user", "parameters": { "get": [ { "name": "resource", "type": "string", "required": false, "title": "Show only rules for a specific resource" } ] } }, { "name": "read", "path": "/{roleID}/rules", "method": "GET", "title": "Retrieve role permissions", "parameters": { "path": [ { "name": "roleID", "type": "uint64", "required": true, "title": "Role ID" } ] } }, { "name": "delete", "path": "/{roleID}/rules", "method": "DELETE", "title": "Remove all defined role permissions", "parameters": { "path": [ { "name": "roleID", "type": "uint64", "required": true, "title": "Role ID" } ] } }, { "name": "update", "path": "/{roleID}/rules", "method": "PATCH", "title": "Update permission settings", "parameters": { "path": [ { "name": "roleID", "type": "uint64", "required": true, "title": "Role ID" } ], "post": [ { "name": "rules", "type": "permissions.RuleSet", "required": true, "title": "List of permission rules to set" } ] } } ] }, { "title": "Automation scripts", "entrypoint": "automation_script", "path": "/automation/script", "authentication": [ "Client ID", "Session ID" ], "struct": [ { "imports": [ "github.com/cortezaproject/corteza-server/pkg/automation" ] } ], "apis": [ { "name": "list", "method": "GET", "title": "List/read automation script", "path": "/", "parameters": { "get": [ { "name": "query", "required": false, "title": "Search query to match against automation script", "type": "string" }, { "name": "resource", "required": false, "title": "Limit by resource (via trigger)", "type": "string" }, { "name": "incDeleted", "required": false, "title": "Include deleted scripts", "type": "bool" }, { "name": "page", "type": "uint", "required": false, "title": "Page number (0 based)" }, { "name": "perPage", "type": "uint", "required": false, "title": "Returned items per page (default 50)" } ] } }, { "name": "create", "method": "POST", "title": "Add new automation script", "path": "/", "parameters": { "post": [ { "name": "name", "title": "automation name", "type": "string" }, { "name": "sourceRef", "title": "Source URL", "type": "string" }, { "name": "source", "title": "Source code", "type": "string" }, { "name": "runAs", "title": "Run as specific user", "type": "uint64" }, { "name": "timeout", "title": "Script timeout (in milliseconds)", "type": "uint" }, { "name": "critical", "title": "Is it critical to run this script successfully", "type": "bool" }, { "name": "async", "title": "Will this script be ran asynchronously", "type": "bool" }, { "name": "enabled", "type": "bool" }, { "name": "triggers", "type": "automation.TriggerSet" } ] } }, { "name": "read", "method": "GET", "title": "Read automation script by ID", "path": "/{scriptID}", "parameters": { "path": [ { "type": "uint64", "name": "scriptID", "required": true, "title": "automation script ID" } ] } }, { "name": "update", "method": "POST", "title": "Update automation script", "path": "/{scriptID}", "parameters": { "path": [ { "type": "uint64", "name": "scriptID", "required": true, "title": "Automation script ID" } ], "post": [ { "name": "name", "title": "Script name", "type": "string" }, { "name": "sourceRef", "title": "Source URL", "type": "string" }, { "name": "source", "title": "Source code", "type": "string" }, { "name": "runAs", "title": "Run script as specific user", "type": "uint64" }, { "name": "timeout", "title": "Run script in user-agent (browser)", "type": "uint" }, { "name": "critical", "title": "Is it critical to run this script successfully", "type": "bool" }, { "name": "async", "title": "Will this script be ran asynchronously", "type": "bool" }, { "name": "enabled", "type": "bool" }, { "name": "triggers", "type": "automation.TriggerSet" } ] } }, { "name": "delete", "method": "DELETE", "title": "Delete script", "path": "/{scriptID}", "parameters": { "path": [ { "type": "uint64", "name": "scriptID", "required": true, "title": "Script ID" } ] } }, { "name": "test", "method": "POST", "title": "Run source code in corredor. Used for testing", "path": "/test", "parameters": { "post": [ {"name": "source", "type": "string", "title": "Script's source code"}, {"name": "payload", "type": "json.RawMessage", "title": "Payload to be used"} ] } } ] }, { "title": "Automation script triggers", "entrypoint": "automation_trigger", "path": "/automation/script/{scriptID}/trigger", "authentication": [ "Client ID", "Session ID" ], "parameters": { "path": [ { "type": "uint64", "name": "scriptID", "required": true, "title": "Script ID" } ] }, "apis": [ { "name": "list", "method": "GET", "title": "List/read automation script triggers", "path": "/", "parameters": { "get": [ { "name": "resource", "required": false, "title": "Only triggers of a specific resource", "type": "string" }, { "name": "event", "required": false, "title": "Only triggers of a specific event", "type": "string" }, { "name": "incDeleted", "required": false, "title": "Include deleted scripts", "type": "bool" }, { "name": "page", "type": "uint", "required": false, "title": "Page number (0 based)" }, { "name": "perPage", "type": "uint", "required": false, "title": "Returned items per page (default 50)" } ] } }, { "name": "create", "method": "POST", "title": "Add new automation script trigger", "path": "/", "parameters": { "post": [ { "name": "resource", "title": "Resource", "type": "string", "required": true }, { "name": "event", "title": "Event", "type": "string", "required": true }, { "name": "condition", "title": "Event", "type": "string" }, { "name": "enabled", "type": "bool" } ] } }, { "name": "read", "method": "GET", "title": "Read automation script trigger by ID", "path": "/{triggerID}", "parameters": { "path": [ { "type": "uint64", "name": "triggerID", "required": true, "title": "Automation script trigger ID" } ] } }, { "name": "update", "method": "POST", "title": "Update automation script trigger", "path": "/{triggerID}", "parameters": { "path": [ { "type": "uint64", "name": "triggerID", "required": true, "title": "Automation script trigger ID" } ], "post": [ { "name": "resource", "title": "Resource", "type": "string", "required": true }, { "name": "event", "title": "Event", "type": "string", "required": true }, { "name": "condition", "title": "Event", "type": "string" }, { "name": "enabled", "type": "bool" } ] } }, { "name": "delete", "method": "DELETE", "title": "Delete script", "path": "/{triggerID}", "parameters": { "path": [ { "type": "uint64", "name": "triggerID", "required": true, "title": "Automation script trigger ID" } ] } } ] } ]