{ "openapi": "3.0.0", "paths": { "/api/v1/oauth/authorize": { "get": { "description": "Authorizes a user via OAuth to connect an application.\n\nOAuth authorization URL construction:\n`{GLOBAL_SETTINGS_DOMAIN}/api/v1/oauth/authorize?client_id={CLIENT_ID}&response_type=code&redirect_uri={REDIRECT_URI}&state={STATE}`\n\nAfter authorization, you will receive the authorization code and the provided state as query parameters in the redirect URL:\n`{REDIRECT_URI}?code={AUTHORIZATION_CODE}&state={PROVIDED_STATE}`\n\nFor `{GLOBAL_SETTINGS_DOMAIN}`, use the domain of your Flosum Global Settings instance (for example, `global-us.flosum.app`).\n\nYou can find the `{CLIENT_ID}` in your connected app under Global Settings > Security > Connected Apps.", "operationId": "OAuthController_authorize_v1", "parameters": [], "responses": { "302": { "description": "Redirects to the redirect URI with the authorization code and state as query parameters in the URL.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthorizeResponseDto" } } } }, "400": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationExceptionDto" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExceptionDto" } } } } }, "summary": "Authorize", "tags": [ "OAuth" ], "x-public": true } }, "/api/v1/oauth/token": { "post": { "description": "Exchanges an authorization code or refresh token for an access token.\n\nFirst, obtain an authorization code via the OAuth `/authorize` endpoint, then pass it to the `/token` endpoint:\n`{GLOBAL_SETTINGS_DOMAIN}/api/v1/oauth/token?grant_type=authorization_code&code={CODE}&redirect_uri={REDIRECT_URI}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}`\n\nAfter a successful request, you will get a response containing a `refresh_token`. You can use it to get a new access token by passing it to the token endpoint:\n`{GLOBAL_SETTINGS_DOMAIN}/api/v1/oauth/token?grant_type=refresh_token&refresh_token={REFRESH_TOKEN}&redirect_uri={REDIRECT_URI}&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}`\n\nYou can get `{CLIENT_ID}` and `{CLIENT_SECRET}` in your connected app under Global Settings > Security > Connected Apps.", "operationId": "OAuthController_token_v1", "parameters": [], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/OAuthTokenBodyDto" } } } }, "responses": { "200": { "description": "Returns access_token, refresh_token, and expires_in (in seconds).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponseDto" } } } }, "400": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationExceptionDto" } } } }, "500": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExceptionDto" } } } } }, "summary": "Generate access token", "tags": [ "OAuth" ], "x-public": true } } }, "info": { "title": "Flosum Global Settings", "description": "REST Api documentation.", "version": "1.6.19-dev.1", "contact": {} }, "tags": [], "servers": [], "components": { "schemas": { "ValidationExceptionDto": { "type": "object", "properties": { "message": { "type": "array", "items": { "type": "string" } }, "error": { "type": "string", "nullable": true }, "statusCode": { "type": "number", "enum": [ 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 210, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 428, 429, 456, 500, 501, 502, 503, 504, 505, 507, 508 ] } }, "required": [ "message", "error", "statusCode" ] }, "ExceptionDto": { "type": "object", "properties": { "message": { "type": "string" }, "error": { "type": "string", "nullable": true }, "statusCode": { "type": "number", "enum": [ 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 210, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 428, 429, 456, 500, 501, 502, 503, 504, 505, 507, 508 ] } }, "required": [ "message", "error", "statusCode" ] }, "AuthorizeResponseDto": { "type": "object", "properties": { "url": { "type": "string" }, "status": { "type": "number" } }, "required": [ "url", "status" ] }, "GrantType": { "type": "string", "enum": [ "authorization_code", "refresh_token" ], "description": "OAuth grant type" }, "OAuthTokenBodyDto": { "type": "object", "properties": { "grant_type": { "description": "OAuth grant type", "example": "authorization_code", "allOf": [ { "$ref": "#/components/schemas/GrantType" } ] }, "code": { "type": "string", "description": "Authorization code extracted from the OAuth `/authorize` response parameters (used when `grant_type=authorization_code`).", "example": "abc123def456ghi789" }, "refresh_token": { "type": "string", "description": "Refresh token extracted from the OAuth `/token` response parameters (used when `grant_type=refresh_token`).", "example": "abcd0123efgh4567ijkl8901mnop2345qrst6789uvwx0123yzab4567cdef8901ghij2345" }, "redirect_uri": { "type": "string", "description": "Allowed redirect URI", "example": "https://yourapp.com/oauth/callback" }, "client_id": { "type": "string", "description": "Client identifier (from connected app)", "example": "fci_abC12_dEfGhijkLMnopQrs" }, "client_secret": { "type": "string", "description": "Client secret (from connected app)", "example": "abCdEF1gHiJKl_mn-op234qrst56789uvWXyzAbcDEf" } }, "required": [ "grant_type", "redirect_uri", "client_id", "client_secret" ] }, "TokenResponseDto": { "type": "object", "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string" }, "refresh_token": { "type": "string", "nullable": true }, "expires_in": { "type": "number" } }, "required": [ "access_token", "token_type", "refresh_token", "expires_in" ] } } } }