{ "openapi": "3.1.0", "info": { "title": "Profile API", "version": "3.0.0" }, "servers": [ { "url": "https://api.fenergox.com/tm/profile" } ], "paths": { "/api/v1/profiles/{profile_id}": { "get": { "summary": "Get Profile By Id Api", "description": "Receives GET api/v1/profiles/{profile_id} request.\n\nArgs:\n request (Request): The incoming request object.\n profile_id (str): The ID of the profile to retrieve.\n auth (TokenAuthDetails): The authentication details-specific role authorization\n\nRaises:\n GenericRequestError: In case of any error during the processing.\n HTTPException: If the profile is not found.\n\nReturns:\n Profile: The profile object that corresponds to the profile_id.", "operationId": "get_profile_by_id_api_api_v1_profiles__profile_id__get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "Profile Id" }, "name": "profile_id", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProfileDTO" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/profiles": { "get": { "summary": "Get Profiles List Api", "description": "Receives GET api/v1/profiles request.\n\nArgs:\n request (Request): The incoming request object.\n auth (AuthDetails): General FE auth.\n profile_types: Comma-separated list of profile types to include\n\nRaises:\n GenericRequestError: In case of any error during the processing.\n\nReturns:\n list[dict]: A list of summarized profile dictionaries for the tenant.", "operationId": "get_profiles_list_api_api_v1_profiles_get", "parameters": [ { "required": false, "schema": { "type": "string", "title": "Profile Types" }, "name": "profile_types", "in": "query" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ProfileSummaryDTO" }, "type": "array", "title": "Response Get Profiles List Api Api V1 Profiles Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/state/profile/v3": { "get": { "summary": "Get Profiles Api", "description": "Receives GET /state/profile/v3 request.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n GetProfilesResponse: Response object to be returned to user", "operationId": "get_profiles_api_state_profile_v3_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Get Profiles Api State Profile V3 Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/state/profile/v3/calculation/logs": { "get": { "summary": "Download Profile Calculation Logs Api", "description": "Receives GET /state/profile/v3/calculation/logs request.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n FileResponse: Response object to be returned to user", "operationId": "download_profile_calculation_logs_api_state_profile_v3_calculation_logs_get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "Log Stream Id" }, "name": "log_stream_id", "in": "query" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Download Profile Calculation Logs Api State Profile V3 Calculation Logs Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/state/profile/v3/custom": { "post": { "summary": "Custom Profiles Api", "description": "An API to add a custom profile value.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n Response200: Response object to be returned to user", "operationId": "custom_profiles_api_state_profile_v3_custom_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomProfileValueRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response200" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "delete": { "summary": "Delete Custom Profiles Api", "description": "An API to delete a custom profile value.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n Response200: Response object to be returned to user", "operationId": "delete_custom_profiles_api_state_profile_v3_custom_delete", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomProfileValueRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response200" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/api/v1/peer-group": { "get": { "summary": "Test Get Peer Group", "description": "Tests the API.", "operationId": "test_get_peer_group_api_v1_peer_group_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/state/peer-group/v3/{peergroup_id}/entity": { "get": { "summary": "Get Peergroup Entities Api", "description": "An API to get all the entities that belong to a specific peergroup.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n GetPeergroupEntitiesResponse: Response object to be returned to user", "operationId": "get_peergroup_entities_api_state_peer_group_v3__peergroup_id__entity_get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "Peergroup Id" }, "name": "peergroup_id", "in": "path" }, { "required": false, "schema": { "type": "integer", "maximum": 250.0, "exclusiveMinimum": 0.0, "title": "Limit", "default": 50 }, "name": "limit", "in": "query" }, { "required": false, "schema": { "type": "string", "title": "Next" }, "name": "next", "in": "query" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPeergroupEntitiesResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "post": { "summary": "Change Peergroups Entities Api", "description": "An API to change peergroup entities.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n Response200: Response object to be returned to user", "operationId": "change_peergroups_entities_api_state_peer_group_v3__peergroup_id__entity_post", "parameters": [ { "required": true, "schema": { "type": "string", "title": "Peergroup Id" }, "name": "peergroup_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PostPeergroupEntitiesChangeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response200" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/state/peer-group/v3": { "get": { "summary": "List Peergroups Api", "description": "An API to fetch metadata of the peergroups and paginate them.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n ListPeergroupResponse: Resposne object to be returned to user", "operationId": "list_peergroups_api_state_peer_group_v3_get", "parameters": [ { "required": false, "schema": { "type": "integer", "maximum": 250.0, "exclusiveMinimum": 0.0, "title": "Limit", "default": 50 }, "name": "limit", "in": "query" }, { "required": false, "schema": { "type": "string", "title": "Next" }, "name": "next", "in": "query" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPeergroupResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "post": { "summary": "Create Peergroups Api", "description": "An API to create a new peergroup record.\n\nRaises:\n GenericRequestError: in case of any error during the processing\n\nReturns:\n Response200: Response object to be returned to user", "operationId": "create_peergroups_api_state_peer_group_v3_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Peergroup" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response200" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/state/peer-group/v3/{peergroup_id}": { "get": { "summary": "Get Peergroups Api", "description": "An API to fetch metadata of the peergroup given the uuid.\n\nReturns:\n Peergroup: Response object to be returned to user", "operationId": "get_peergroups_api_state_peer_group_v3__peergroup_id__get", "parameters": [ { "required": true, "schema": { "type": "string", "title": "Peergroup Id" }, "name": "peergroup_id", "in": "path" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Peergroup" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } } }, "components": { "schemas": { "AggregationMeta": { "properties": { "field_name": { "type": "string", "title": "Field Name" }, "type": { "$ref": "#/components/schemas/AggregationType" }, "group_by": { "type": "string", "title": "Group By" } }, "additionalProperties": false, "type": "object", "required": [ "field_name", "type" ], "title": "AggregationMeta", "description": "Aggregation Meta definition." }, "AggregationType": { "type": "string", "enum": [ "avg", "value_count", "sum", "std_deviation", "cardinality" ], "title": "AggregationType", "description": "Allowed aggregation types definition." }, "CustomProfileValueRequest": { "properties": { "key": { "type": "object", "title": "Key" }, "value": { "title": "Value" } }, "additionalProperties": false, "type": "object", "required": [ "key" ], "title": "CustomProfileValueRequest", "description": "Defines a PostCustomProfileValueRequest structure and types." }, "EntityIdObject": { "properties": { "entity_id": { "type": "string", "title": "Entity Id" } }, "additionalProperties": false, "type": "object", "required": [ "entity_id" ], "title": "EntityIdObject", "description": "Defines a EntityIdObject structure and types." }, "Filter": { "properties": { "field_name": { "type": "string", "title": "Field Name" }, "type": { "$ref": "#/components/schemas/FilterType" }, "source_type": { "$ref": "#/components/schemas/FilterSourceType" }, "value_type": { "$ref": "#/components/schemas/ValueType" }, "value": { "anyOf": [ { "type": "boolean" }, { "type": "string" }, { "type": "integer" } ], "title": "Value" }, "from_range": { "type": "string", "title": "From Range" }, "to_range": { "type": "string", "title": "To Range" } }, "additionalProperties": false, "type": "object", "required": [ "field_name", "type", "source_type" ], "title": "Filter", "description": "Filter definition." }, "FilterSourceType": { "type": "string", "enum": [ "extracted_fields", "transaction", "peergroup", "scan" ], "title": "FilterSourceType", "description": "Allowed filter source types." }, "FilterType": { "type": "string", "enum": [ "exact_match", "range", "exist" ], "title": "FilterType", "description": "Allowed filter types." }, "GetPeergroupEntitiesResponse": { "properties": { "msg": { "type": "string", "title": "Msg" }, "entities": { "items": { "type": "string" }, "type": "array", "title": "Entities" }, "next": { "type": "string", "title": "Next" } }, "additionalProperties": false, "type": "object", "required": [ "msg", "entities" ], "title": "GetPeergroupEntitiesResponse", "description": "Defines a GetPeergroupEntitiesResponse structure and types." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ListPeergroupResponse": { "properties": { "peergroups": { "items": { "$ref": "#/components/schemas/Peergroup" }, "type": "array", "title": "Peergroups" }, "next": { "type": "string", "title": "Next" } }, "additionalProperties": false, "type": "object", "required": [ "peergroups" ], "title": "ListPeergroupResponse", "description": "Defines a ListPeergroupResponse structure and types." }, "OccurrenceMeta": { "properties": { "type": { "$ref": "#/components/schemas/OccurrenceType" } }, "additionalProperties": false, "type": "object", "required": [ "type" ], "title": "OccurrenceMeta", "description": "Occurrence Meta definition." }, "OccurrenceType": { "type": "string", "enum": [ "last_occurrence" ], "title": "OccurrenceType", "description": "Allowed Occurrence types definition." }, "Peergroup": { "properties": { "name": { "type": "string", "title": "Name" }, "description": { "type": "string", "title": "Description" }, "external_id": { "type": "string", "title": "External Id" } }, "additionalProperties": false, "type": "object", "required": [ "name", "description", "external_id" ], "title": "Peergroup", "description": "Defines a Peergroup structure and types." }, "PostPeergroupEntitiesChangeRequest": { "properties": { "entities_to_add": { "items": { "$ref": "#/components/schemas/EntityIdObject" }, "type": "array", "title": "Entities To Add" }, "entities_to_remove": { "items": { "$ref": "#/components/schemas/EntityIdObject" }, "type": "array", "title": "Entities To Remove" } }, "additionalProperties": false, "type": "object", "required": [ "entities_to_add", "entities_to_remove" ], "title": "PostPeergroupEntitiesChangeRequest", "description": "Defines a PostPeergroupEntitiesChangeRequest structure and types." }, "ProfileDTO": { "properties": { "id": { "type": "string", "title": "Id" }, "version": { "type": "string", "title": "Version" }, "rule_code": { "type": "string", "title": "Rule Code" }, "description": { "type": "string", "title": "Description" }, "type": { "$ref": "#/components/schemas/ProfileType" }, "field": { "$ref": "#/components/schemas/ProfileField" }, "look_back_until": { "type": "string", "title": "Look Back Until" }, "id_selectors": { "items": { "$ref": "#/components/schemas/ProfileIdSelector" }, "type": "array", "minItems": 1, "title": "Id Selectors" }, "filters": { "items": { "$ref": "#/components/schemas/Filter" }, "type": "array", "title": "Filters" }, "query": { "type": "string", "title": "Query" }, "metadata": { "$ref": "#/components/schemas/ProfileMetadata" } }, "type": "object", "required": [ "id", "version", "rule_code", "description", "type", "field", "id_selectors" ], "title": "ProfileDTO", "description": "Defines a PorifleDTO." }, "ProfileField": { "properties": { "name": { "type": "string", "title": "Name" }, "type": { "$ref": "#/components/schemas/ProfileFieldType" }, "filters": { "items": { "$ref": "#/components/schemas/Filter" }, "type": "array", "title": "Filters" }, "aggregation_meta": { "$ref": "#/components/schemas/AggregationMeta" }, "occurrence_meta": { "$ref": "#/components/schemas/OccurrenceMeta" } }, "additionalProperties": false, "type": "object", "required": [ "name", "type" ], "title": "ProfileField", "description": "Profile field definition." }, "ProfileFieldType": { "type": "string", "enum": [ "aggregation", "peer_belongship", "value", "occurrence" ], "title": "ProfileFieldType", "description": "Allowed profile field types." }, "ProfileIdSelector": { "properties": { "field_name": { "type": "string", "title": "Field Name" }, "type": { "type": "string", "title": "Type" } }, "additionalProperties": false, "type": "object", "required": [ "field_name", "type" ], "title": "ProfileIdSelector", "description": "Profile field id selector definition." }, "ProfileMetadata": { "properties": { "ui": { "$ref": "#/components/schemas/ProfileMetadataUIDetails" } }, "additionalProperties": false, "type": "object", "required": [ "ui" ], "title": "ProfileMetadata", "description": "Profile metadata." }, "ProfileMetadataUIDetails": { "properties": { "profile_group": { "$ref": "#/components/schemas/ProfileMetadataUIDetailsProfileGroup" }, "dynamo": { "$ref": "#/components/schemas/ProfileMetadataUIDetailsDynamo" }, "display_location": { "$ref": "#/components/schemas/ProfileMetadataUIDetailsDisplayLocation" } }, "additionalProperties": false, "type": "object", "required": [ "profile_group", "dynamo", "display_location" ], "title": "ProfileMetadataUIDetails", "description": "Profile metadata UI details." }, "ProfileMetadataUIDetailsDisplayLocation": { "properties": { "column_header": { "type": "string", "title": "Column Header" }, "row_name": { "type": "string", "title": "Row Name" } }, "additionalProperties": false, "type": "object", "required": [ "column_header", "row_name" ], "title": "ProfileMetadataUIDetailsDisplayLocation", "description": "Display location details for a profile." }, "ProfileMetadataUIDetailsDynamo": { "properties": { "key_pattern": { "type": "string", "title": "Key Pattern" }, "field_id": { "type": "string", "title": "Field Id" }, "value": { "title": "Value" } }, "additionalProperties": false, "type": "object", "required": [ "key_pattern", "field_id" ], "title": "ProfileMetadataUIDetailsDynamo", "description": "DynamoDB key template for a profile." }, "ProfileMetadataUIDetailsProfileGroup": { "properties": { "name": { "type": "string", "title": "Name" }, "type": { "$ref": "#/components/schemas/ProfileMetadataUIDetailsProfileGroupType" }, "values": { "items": { "type": "string" }, "type": "array", "title": "Values" }, "currency_code": { "type": "string", "maxLength": 3, "minLength": 3, "title": "Currency Code" }, "column_headers": { "items": { "type": "string" }, "type": "array", "title": "Column Headers" }, "row_keys": { "items": { "type": "string" }, "type": "array", "title": "Row Keys" }, "position": { "type": "integer", "title": "Position" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "title": "ProfileMetadataUIDetailsProfileGroup", "description": "Profile-group details." }, "ProfileMetadataUIDetailsProfileGroupType": { "type": "string", "enum": [ "string", "number", "boolean", "currency", "dropdown", "custom_profile" ], "title": "ProfileMetadataUIDetailsProfileGroupType", "description": "Profile-group types for metadata." }, "ProfileSummaryDTO": { "properties": { "id": { "type": "string", "title": "Id" }, "description": { "type": "string", "title": "Description" }, "lookback_until": { "type": "string", "title": "Lookback Until" }, "aggregation_type": { "type": "string", "title": "Aggregation Type" }, "profile_type": { "type": "string", "title": "Profile Type" } }, "type": "object", "required": [ "id", "description", "lookback_until", "aggregation_type", "profile_type" ], "title": "ProfileSummaryDTO", "description": "Defines a PorifleSummaryDTO." }, "ProfileType": { "type": "string", "enum": [ "entity", "entity_property", "entity_combination", "peergroup_belongship", "peergroup", "redshift", "custom" ], "title": "ProfileType", "description": "Defines a ProfileType Profile Model to use for validation." }, "Response200": { "properties": {}, "additionalProperties": false, "type": "object", "title": "Response200", "description": "Defines an empty body response, which is related to 200 OK." }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "ValueType": { "type": "string", "enum": [ "bool", "str", "int" ], "title": "ValueType", "description": "Explicitly define the type of certain values." } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } } }