### Get Plan Portfolio Endpoint Example (Conceptual) Source: https://indexacapital.com/en/api-rest-v1/index This outlines the conceptual structure for retrieving a model portfolio for a plan via a GET request. It requires specifying the product type, risk level, and investment amount in the URI. ```http GET /plans/{product}/{risk}/portfolio/{investment} HTTP/1.1 Host: intapi.indexacapital.com X-AUTH-TOKEN: YOUR_JWT_TOKEN ``` -------------------------------- ### Get Account Documents Response Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index Example JSON response for retrieving a list of documents related to a specific account. It includes details for both account-related documents and holder-related documents. ```json { "account": [ { "id": 55221, "type": "rep_port_month", "name": "asdfasdfasd882143_1488341228.pdf", "originalName": "", "original_name": "", "showName": "Informe mensual Indexa Capital - AABBCCDD - 2017-02", "show_name": "Informe mensual Indexa Capital - AABBCCDD - 2017-02", "created_at": "2017-03-01 05:07:08", "signed": false } ], "holder": [ { "id": 26407, "type": "rep_profile", "name": "asdfasdf8d05f0ee_1477580312.pdf", "originalName": "", "original_name": "", "showName": "Test de idoneidad - 27/10/2016", "show_name": "Test de idoneidad - 27/10/2016", "created_at": "2016-10-27 16:58:32", "signed": false } ] } ``` -------------------------------- ### Account Number URI Parameter Example Source: https://indexacapital.com/en/api-rest-v1/index Shows an example value for the 'account_number' URI parameter. This parameter is required when calling the get account information endpoint and is derived from user information. ```text NK1NUTP1 ``` -------------------------------- ### Account Invoices Response Example Source: https://indexacapital.com/en/api-rest-v1/index An example JSON response for the 'get account invoices' endpoint. It details invoice information including account number, date ranges, fees, VAT, total amount, average fee, and a document object with details about the invoice PDF. ```json [ { "account_number": "INDEXA01", "date_from": "2015-10-01", "date_to": "2015-12-31", "fees": 25.87, "vat": 5.43, "amount": 509532.11, "average_fee": 1.9565532019445353, "document": { "id": 580, "type": "indexa_fees", "name": "asdfasdf990f69e4_1452522735.pdf", "originalName": "", "original_name": "", "showName": "Comisiones de gestión Indexa, T4-2015", "show_name": "Comisiones de gestión Indexa, T4-2015", "created_at": "2016-01-11 15:32:15", "signed": false } } ] ``` -------------------------------- ### Upload Bank Statement Request Body Example Source: https://indexacapital.com/en/api-rest-v1/index This example shows the structure for uploading a bank statement document. It includes the file itself, the document type, and an optional name. ```text ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; { "file": "path/to/your/file.pdf", "type": "bank_account_ownership", "name": "My Bank Statement" } ------WebKitFormBoundary7MA4YWxkTrZu0gW-- ``` -------------------------------- ### Risk Assessment Examples Source: https://indexacapital.com/en/api-rest-v1/index Examples of risk assessment objects, showing different levels of risk tolerance, capacity, and total risk for an investment. These range from minimum to maximum risk profiles. ```json { "tolerance": 10, "capacity": 10, "total": 10 } ``` ```json { "tolerance": 8, "capacity": 7, "total": 7 } ``` ```json { "tolerance": 1, "capacity": 1, "total": 1 } ``` -------------------------------- ### Add Bank Account Request Body Example Source: https://indexacapital.com/en/api-rest-v1/index This example demonstrates the form data structure for adding a new bank account. It requires the IBAN and a boolean indicating if it's for outgoing transactions. ```text ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; { "iban": "your_iban_here", "outgoing": true } ------WebKitFormBoundary7MA4YWxkTrZu0gW-- ``` -------------------------------- ### Create Profile Request Body - Mutual Fund Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index Example JSON request body for creating a mutual fund profile. This includes investment details and user answers to a risk assessment questionnaire. ```json { "type": "mutual", "risk": 10, "investment": 10000, "answers": { "goal": 4, "attitude": 4, "risk": 4, "experience": 1, "age": 33, "wealth": 10000, "income": 100000, "expenses": 25, "stability": 1, "horizon": 100 } } ``` -------------------------------- ### JWT Authentication Token Example Source: https://indexacapital.com/en/api-rest-v1/index An example of a JSON Web Token (JWT) used for authentication. This token is typically included in the 'X-AUTH-TOKEN' header for secured requests. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE1MTkxMjY0NDgsImV4cCI6MTUxOTE4NjQ0OCwiZW5kcG9pbnQiOiJodHRwczovL2ludGFwaS5pbmRleGFjYXBpdGFsLmNvbSJ9.P82WNPoxpTSUf9AJfpYFelON4xy6EBec9vE4qEHee1c ``` -------------------------------- ### User Object Schema and Examples (JSON) Source: https://indexacapital.com/en/api-rest-v1/index Defines the structure of a user object in JSON format, including required fields like username, email, phone, document type, document number, roles, activation status, and affiliate fee. It also includes optional fields for names, sources, accounts, and profiles. Examples showcase different user states such as pending activation, phone activation pending, active user, user with profile but no account, and a full user with account details. ```JSON { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": false, "phone_activated": false, "email_activated": false, "affiliate_fee": 0 } ``` ```JSON { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": false, "phone_activated": false, "email_activated": true, "affiliate_fee": 0 } ``` ```JSON { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": true, "phone_activated": true, "email_activated": true, "affiliate_fee": 0 } ``` ```JSON { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": true, "phone_activated": true, "email_activated": true, "affiliate_fee": 0, "profiles": [ "e5cfe6e9-d40e-4211-96b9-45c1cd78a958" ] } ``` ```JSON { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": true, "phone_activated": true, "email_activated": true, "affiliate_fee": 0, "accounts_relations": [ { "account_number": "PBKLBYZ5", "relation": "owner" }, { "account_number": "PBKRBYY1", "relation": "owner" } ], "accounts": [ { "account_number": "PBKRBYY1", "status": "active", "type": "pension", "@path": "/accounts/PBKRBYY1" }, { "account_number": "PBKLBYZ5", "status": "active", "type": "mutual", "@path": "/accounts/PBKLBYZ5" } ] } ``` -------------------------------- ### User Risk Assessment Answers - Mutual Fund Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index Example JSON object containing user answers for the risk assessment, specifically for a mutual fund profile. This object is part of the larger profile creation request. ```json { "goal": 4, "attitude": 4, "risk": 4, "experience": 1, "income": 100000, "age": 33, "stability": 1, "expenses": 25, "wealth": 10000, "horizon": 100 } ``` -------------------------------- ### JWT Authentication Token Example Source: https://indexacapital.com/en/api-rest-v1/index This snippet shows an example of a JWT (JSON Web Token) used for authentication with the Index Capital API. This token is typically passed in the 'X-AUTH-TOKEN' header for securing API requests. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwYXJ0bmVyQGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE0OTQzMTk1NDUsImV4cCI6MTQ5NDM3OTU0NX0.Ca38TMUyuf7YFiL8MN4JNP0NJJYbB49T-XcLAVPSUOc ``` ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE1MTkxMjY0NDgsImV4cCI6MTUxOTE4NjQ0OCwiZW5kcG9pbnQiOiJodHRwczovL2ludGFwaS5pbmRleGFjYXBpdGFsLmNvbSJ9.P82WNPoxpTSUf9AJfpYFelON4xy6EBec9vE4qEHee1c ``` -------------------------------- ### JWT Authentication Token Example Source: https://indexacapital.com/en/api-rest-v1/index This snippet provides an example of a JSON Web Token (JWT) used for authentication with the API. This token is typically included in the 'X-AUTH-TOKEN' header for secured requests. ```json { "sub": "test@indexacapital.com", "iss": "Indexa Capital", "iat": 1519126448, "exp": 1519186448, "endpoint": "https://intapi.indexacapital.com" } ``` -------------------------------- ### Full Request Body Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index This comprehensive JSON object demonstrates a complete request body for a pension investment, integrating all required fields and nested objects. ```json { "answers": { "goal": 4, "attitude": 4, "risk": 4, "experience": 1, "income": 100000, "age": 33, "stability": 1, "expenses": 25, "wealth": 10000, "horizon": 100 }, "document": "", "id": "23f794f5-51c0-4778-98bc-9b5b16217425", "investment": 10000, "is_outdated": false, "risk": { "tolerance": 10, "capacity": 10, "total": 10 }, "selected_risk": 10, "type": "pension", "needs_to_be_updated": false } ``` -------------------------------- ### Add Account Holder Request Example (POST /accounts/{account_number}/holders) Source: https://indexacapital.com/en/api-rest-v1/index This example demonstrates the request body for the POST /accounts/{account_number}/holders endpoint, used to add a new holder to an existing account. It includes required fields like date, address details, document information, and personal details. ```json { "date": "20231027 10:30:00", "address": { "street_type": "AV", "street_name": "Mayor", "street_number": "10", "postal_code": "28080", "city": "Madrid", "state": 1, "country": 2 }, "document_type_code": "nif", "document": "12345678A", "double_address": false, "full_name": "John Doe", "gender": "H", "marital_status": "S", "earning_type": "PA", "name": "John", "surname": "Doe", "person_type": "natural", "type": "MAIN", "percentage": 100, "participation_level": 100, "documents": [ { "id": 1, "type": "passport", "name": "Passport.pdf", "originalName": "Passport.pdf", "original_name": "Passport.pdf", "showName": "Passport", "show_name": "Passport", "created_at": "20231027 10:30:00", "signed": true, "path": "/documents/passport.pdf" } ], "platform_code": "PLATFORM1", "preferences": [] } ``` -------------------------------- ### User Risk Assessment Answers - Pension Fund Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index Example JSON object containing user answers for the risk assessment, specifically for a pension fund profile. This object is part of the larger profile creation request. Note that 'horizon' is omitted. ```json { "goal": 4, "attitude": 4, "risk": 4, "experience": 1, "income": 100000, "age": 33, "stability": 1, "expenses": 25, "wealth": 10000 } ``` -------------------------------- ### Create Profile Request Body - Pension Fund Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index Example JSON request body for creating a pension fund profile. This includes investment details and user answers to a risk assessment questionnaire. Note that 'horizon' is not required for pension types. ```json { "type": "pension", "risk": 10, "investment": 10000, "answers": { "goal": 4, "attitude": 4, "risk": 4, "experience": 1, "age": 33, "wealth": 10000, "income": 100000, "stability": 1, "expenses": 25 } } ``` -------------------------------- ### HTTP 200 Response Body Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index This is an example of a successful JSON response (HTTP status code 200) from the API. It contains detailed financial data including plan returns, volatility, and historical performance. ```json { "plan_return":{ "ultimo":7.689136836336341, "inicio":51.27636640057338, "inicio_anual":8.63110991644529 }, "volatility":0.059534610706242636, "plan_historic_Retrieve":{ "average":0.0534705221241627, "lowest":-0.172491644516577, "highest":0.184733502818864, "lowest_year":2008, "highest_year":2009 }, "history_data": { "20120531":{ "date":"2012-05-31", "return":100, "benchmark":100 }, "20120630":{ "date":"2012-06-30", "return":100.69917413309058, "benchmark":102.7163613392293, "percentage_return":0.006991741330905749, "benchmark_percentage_return":0.027163613392293007 }, "20120731":{ "date":"2012-07-31", "return":103.97287362236169, "benchmark":103.44734229762655, "percentage_return":0.03250969551095211, "benchmark_percentage_return":0.007116499736425919 }, "20170531":{ "date":"2017-05-31", "return":151.27636640057338, "benchmark":125.47036755321206, "percentage_return":-0.000324013698630137, "benchmark_percentage_return":0 } } } ``` -------------------------------- ### GET /plans/{product}/{risk}/history/{investment} Source: https://indexacapital.com/en/api-rest-v1/index Retrieve historic returns and volatility of an investment plan based on its product type, risk level, and portfolio size. ```APIDOC ## GET /plans/{product}/{risk}/history/{investment} ### Description Retrieve historic returns and volatility of the plan given by its product type, risk level and portfolio size (investment). ### Method GET ### Endpoint /plans/{product}/{risk}/history/{investment} ### Parameters #### Path Parameters - **product** (string) - Required - Product type for which the questions are requested (e.g., 'mutual' or 'pension'). - **risk** (string) - Required - Risk level for which the plan history is requested (e.g., 1 to 10). - **investment** (string) - Required - Investment (portfolio size) for which the plan history is requested (e.g., 50000). ### Request Example (No request body for GET requests) ### Response #### Success Response (200) (Response body structure not detailed in the provided text, but expected to contain historic returns and volatility data.) #### Response Example (No example provided in the input text.) ``` -------------------------------- ### JWT Authentication Token Example Source: https://indexacapital.com/en/api-rest-v1/index An example of a JSON Web Token (JWT) used for authenticating requests to secured endpoints. This token contains header information, payload, and a signature for verifying the token's integrity. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE1MTkxMjY0NDgsImV4cCI6MTUxOTE4NjQ0OCwiZW5kcG9pbnQiOiJodHRwczovL2ludGFwaS5pbmRleGFjYXBpdGFsLmNvbSJ9.P82WNPoxpTSUf9AJfpYFelON4xy6EBec9vE4qEHee1c ``` -------------------------------- ### JWT Authentication Header Example Source: https://indexacapital.com/en/api-rest-v1/index Demonstrates the required 'X-AUTH-TOKEN' header for JWT-secured API requests. This token is essential for authenticating your requests to the Indexa Capital API. ```json { "X-AUTH-TOKEN": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE1MTkxMjY0NDgsImV4cCI6MTUxOTE4NjQ0OCwiZW5kcG9pbnQiOiJodHRwczovL2ludGFwaS5pbmRleGFjYXBpdGFsLmNvbSJ9.P82WNPoxpTSUf9AJfpYFelON4xy6EBec9vE4qEHee1c" } ``` -------------------------------- ### GET /stats/performance Source: https://indexacapital.com/en/api-rest-v1/index Retrieve historic returns for a given product and date range. Supports JWT and JWT_PLATFORM authentication. ```APIDOC ## GET /stats/performance ### Description Retrieve historic returns for a given product and date range. ### Method GET ### Endpoint /stats/performance ### Parameters #### Query Parameters - **from** (string) - Required - Date range start - **to** (string) - Optional - Date range end (YYYY-MM-DD). (Default value: today) - **product** (string) - Required - - **risk** (integer) - Optional - Risk level. one in range [1-10] (Default value: 6) - **size** (string) - Optional - Portofolio size. (one of small, medium, large) (Default value: medium) ### Request Example ```json { "from": "2023-01-01", "to": "2023-12-31", "product": "example_product", "risk": 5, "size": "medium" } ``` ### Response #### Success Response (200) - **data** (object) - Contains historic return data. - **message** (string) - Success message. #### Response Example ```json { "data": { "dates": ["2023-01-01", "2023-01-02"], "returns": [0.01, 0.015] }, "message": "Historic returns retrieved successfully." } ``` ### Security Secured by **JWT_PLATFORM** and **JWT** #### Headers - **X-AUTH-TOKEN** (string) - Required - Authentication token ``` -------------------------------- ### Authentication Error Response Example Source: https://indexacapital.com/en/api-rest-v1/index Illustrates a typical JSON response when an authentication error occurs. This includes the error code 403 and a descriptive message. ```json { "code": 403, "message": "Invalid credentials." } ``` -------------------------------- ### Retrieve Plan History (cURL) Source: https://indexacapital.com/en/api-rest-v1/index This cURL example demonstrates how to request historical returns and volatility for an investment plan. It requires specifying the product type, risk level, and investment amount as URI parameters, along with JWT authentication. ```cURL curl -X GET \ 'https://example.com/plans/mutual/5/50000/history' \ -H 'accept: application/json' \ -H 'X-AUTH-TOKEN: YOUR_JWT_TOKEN' ``` -------------------------------- ### Investment Instrument Data Example Source: https://indexacapital.com/en/api-rest-v1/index Sample data representing investment instruments, including their descriptions, identifiers (ISIN), asset class, and pricing information. This data is part of the broader portfolio information available through the API. ```json { "description": "Vanguard Emerging Markets Stock Index Fund es un fondo abierto constituido en Irlanda. El objetivo del fondo es el seguimiento del rendimiento del Índice Fondo MSCI Select Emerging Markets Index Stock, (índice de empresas de 18 mercados emergentes de Europa, Asia, África y America latina). Código ISIN: IE0031786142.", "identifier": "IE0031786142", "identifier_name": "Código ISIN", "name": "Vanguard Emrg Mk Stk Idx -Inv" }, "price": 150.964, "profit_loss": 107.95607999999999, "realized": false, "subscription_date": "2016-06-03 00:00:00", "titles": 3.6 }, { "amount": 830.0995930000001, "account": "INDEXA05", "cost_amount": 692.98, "cost_price": 20.630544805001488, "date": "2017-03-07", "instrument": { "asset_class": "equity_north_america", "asset_class_description": "equity_north_america", "description": "Es un fondo abierto incorporado en Irlanda cuyo objetivo es hacer un seguimiento del índice Standard & Poor 's 500 Composite Stock Price Index. Por tanto, el fondo invertirá en acciones de grandes empresas estadounidenses. Código ISIN: IE0032126645.", "identifier": "IE0032126645", "identifier_name": "Código ISIN", "name": "Vanguard US 500 Stk Idx -Inst" }, "price": 24.7127, "profit_loss": 137.11959300000012, "realized": false, "subscription_date": "2016-06-02 00:00:00", "titles": 33.59 }, { "amount": 414.318256, "account": "INDEXA05", "cost_amount": 415.386816, "cost_price": 136.6404, "date": "2017-03-07", "instrument": { "asset_class": "fixed_income_euro_inflation_linked", "asset_class_description": "fixed_income_euro_inflation_linked", "description": "El objetivo es proporcionar retornos consistentes con el rendimiento de el Inflation-Linked Barclays Eurozona Bond Index. El Fondo invierte en bonos ligados a la inflación, denominados en euros, contenidos en este índice. Código ISIN: IE00B04GQQ17.", "identifier": "IE00B04GQQ17", "identifier_name": "Código ISIN", "name": "Vanguard Euroz Inf Lk Idx -Inv" }, "price": 136.2889, "profit_loss": -1.0685599999999909, "realized": false, "subscription_date": "2016-06-02 00:00:00", "titles": 3.04 } ] ``` -------------------------------- ### JWT Authentication Token Example Source: https://indexacapital.com/en/api-rest-v1/index Example of a JSON Web Token (JWT) used for authenticating requests to the Indexa Capital API. This token contains claims such as subject, issuer, issuance time, expiration time, and endpoint information. ```JSON { "alg": "HS256", "typ": "JWT" } eyJzdWIiOiJ0ZXN0QGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE1MTkxMjY0NDgsImV4cCI6MTUxOTE4NjQ0OCwiZW5kcG9pbnQiOiJodHRwczovL2ludGFwaS5pbmRleGFjYXBpdGFsLmNvbSJ9 .P82WNPoxpTSUf9AJfpYFelON4xy6EBec9vE4qEHee1c ``` -------------------------------- ### Pension Investment Request Body Example (JSON) Source: https://indexacapital.com/en/api-rest-v1/index This JSON object represents a sample request body for a pension investment. It includes user's financial profile, risk assessment, and investment details, excluding the investment horizon. ```json { "goal": 4, "attitude": 4, "risk": 4, "experience": 1, "income": 100000, "age": 33, "stability": 1, "expenses": 25, "wealth": 10000 } ``` -------------------------------- ### GET /users/me Source: https://indexacapital.com/en/api-rest-v1/index Retrieve data for the currently authenticated user. Requires JWT authentication. ```APIDOC ## GET /users/me ### Description Retrieve data for the currently authenticated user. This endpoint is secured by JWT. ### Method GET ### Endpoint /users/me ### Headers - **X-AUTH-TOKEN** (string) - Required - Authentication token (JWT). - **Accept** (string) - Required ### Response #### Success Response (200) - **username** (string) - Required - **email** (string) - Required - **name** (string) - Optional - **surname** (string) - Optional - **phone** (string) - Required - **document_type** (string) - Required (one of: nif, cif, pass, nie, doc_ext, cif_no_r, nif_no_r, nif_meno) - **document** (string) - Required - **roles** (array of string) - Required - **is_activated** (boolean) - Required - **phone_activated** (boolean) - Required - **email_activated** (boolean) - Required - **source** (string) - Optional - **affiliate_fee** (number) - Required - **profiles** (array of string) - Optional (GUID format) - **accounts** (array of object) - Optional - **account_number** (string) - Required - **status** (string) - Required - **type** (string) - Required (one of: mutual, pension) - **@path** (string) - Required - **accounts_relations** (array of object) - Optional - **account_number** (string) - Required - **relation** (string) - Required (one of: owner, auth, guest) - **person** (object) - Optional - **name** (string) - Required #### Response Example (200) ```json { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": true, "phone_activated": true, "email_activated": true, "affiliate_fee": 0, "accounts_relations": [ { "account_number": "PBKLBYZ5", "relation": "owner" }, { "account_number": "PBKRBYY1", "relation": "owner" } ], "accounts": [ { "account_number": "PBKRBYY1", "status": "active", "type": "pension", "@path": "/accounts/PBKRBYY1" }, { "account_number": "PBKLBYZ5", "status": "active", "type": "mutual", "@path": "/accounts/PBKLBYZ5" } ] } ``` #### Error Response (403) - **code** (integer) - Possible values: 200, 400, 403, 404, 423, 500 - **message** (string) - Required #### Error Response Example (403) ```json { "code": 403, "message": "Invalid credentials." } ``` #### Error Response (423) - **code** (integer) - Possible values: 200, 400, 403, 404, 423, 500 - **message** (string) - Required #### Error Response Example (423) ```json { "code": 423, "message": "Account is locked" } ``` ``` -------------------------------- ### User Creation and Management Source: https://indexacapital.com/en/api-rest-v1/index This endpoint is used to create new users or update existing user profiles. It accepts a comprehensive user object with various fields for personal information, account details, and activation status. ```APIDOC ## POST /websites/indexacapital_en_api-rest-v1/users ### Description Allows for the creation of new users or the updating of existing user profiles. The request body should contain a JSON object with user details. ### Method POST ### Endpoint /websites/indexacapital_en_api-rest-v1/users ### Parameters #### Request Body - **username** (string) - Required - Email address of the user. Must follow the pattern: ^[a-zA-Z0-9.!#$% &'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$ - **email** (string) - Required - Email address of the user. Must follow the pattern: ^[a-zA-Z0-9.!#$% &'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$ - **name** (string) - Optional - First name of the user. - **surname** (string) - Optional - Last name of the user. - **phone** (string) - Required - Phone number of the user. Must follow the pattern: ^\+34([6-7]\d{2})(\d{3})(\d{3})$ - **document_type** (string) - Required - Type of identification document. One of: nif, cif, pass, nie, doc_ext, cif_no_r, nif_no_r, nif_meno - **document** (string) - Required - Identification document number. Must follow the pattern: ^\d{8}\w$ - **roles** (array of string) - Required - List of roles assigned to the user. - **is_activated** (boolean) - Required - Indicates if the user account is activated. - **phone_activated** (boolean) - Required - Indicates if the user's phone number is activated. - **email_activated** (boolean) - Required - Indicates if the user's email address is activated. - **source** (string) - Optional - Source of user registration. - **affiliate_fee** (number) - Required - Affiliate fee associated with the user. - **profiles** (array of string) - Optional - List of profile GUIDs associated with the user. - **accounts** (array of object) - Optional - List of account details. - **account_number** (string) - Required - The account number. - **status** (string) - Required - The status of the account (e.g., active). - **type** (string) - Required - The type of account (mutual, pension). - **@path** (string) - Required - The API path to the account resource. - **accounts_relations** (array of object) - Optional - List of account relationships. - **account_number** (string) - Required - The account number. - **relation** (string) - Required - The type of relation (owner, auth, guest). - **person** (object) - Optional - Object containing personal details. - **name** (string) - Required - The name of the person. ### Request Example ```json { "username": "asdasd@adad.com", "roles": [ "ROLE_USER" ], "email": "asdasd@adad.com", "phone": "+34678987123", "document": "78196523L", "document_type": "nif", "is_activated": true, "phone_activated": true, "email_activated": true, "affiliate_fee": 0, "accounts_relations": [ { "account_number": "PBKLBYZ5", "relation": "owner" }, { "account_number": "PBKRBYY1", "relation": "owner" } ], "accounts": [ { "account_number": "PBKRBYY1", "status": "active", "type": "pension", "@path": "/accounts/PBKRBYY1" }, { "account_number": "PBKLBYZ5", "status": "active", "type": "mutual", "@path": "/accounts/PBKLBYZ5" } ] } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message upon successful user creation or update. #### Response Example ```json { "message": "User created successfully." } ``` #### Error Response (400 Bad Request) - **code** (number) - Error code (e.g., 400). - **message** (string) - Description of the error. #### Error Response Example ```json { "code": 400, "message": "Invalid input data." } ``` #### Error Response (403 Forbidden) - **code** (number) - Error code (e.g., 403). - **message** (string) - Description of the error (e.g., "Invalid credentials."). #### Error Response Example ```json { "code": 403, "message": "Invalid credentials." } ``` #### Error Response (423 Locked) - **code** (number) - Error code (e.g., 423). - **message** (string) - Description of the error (e.g., "Account is locked"). #### Error Response Example ```json { "code": 423, "message": "Account is locked" } ``` #### Error Response (404 Not Found) - **code** (number) - Error code (404). - **message** (string) - Description of the error (e.g., "User not found."). #### Error Response Example ```json { "code": 404, "message": "User not found." } ``` ``` -------------------------------- ### GET /auth/refresh-token Source: https://indexacapital.com/en/api-rest-v1/index Retrieves a new JWT token for the authenticated user. This endpoint is secured by JWT. ```APIDOC ## GET /auth/refresh-token ### Description Retrieve a new JWT token for the currently authenticated user. This endpoint requires a valid JWT token in the request header and is secured by JWT. ### Method GET ### Endpoint /auth/refresh-token ### Headers - **X-AUTH-TOKEN** (string) - Required - The JWT authentication token. ### Response #### Success Response (200) - **token** (string) - The new JWT authentication token. #### Response Example ```json { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGluZGV4YWNhcGl0YWwuY29tIiwiaXNzIjoiSW5kZXhhIENhcGl0YWwiLCJpYXQiOjE1MTkxMjY0NDgsImV4cCI6MTUxOTE4NjQ0OCwiZW5kcG9pbnQiOiJodHRwczovL2ludGFwaS5pbmRleGFjYXBpdGFsLmNvbSJ9.P82WNPoxpTSUf9AJfpYFelON4xy6EBec9vE4qEHee1c" } ``` #### Error Response (403) - **code** (integer) - The error code (e.g., 403). - **message** (string) - Required - A description of the error. #### Error Response Example (403) ```json { "code": 403, "message": "Invalid credentials." } ``` ``` -------------------------------- ### GET /stats/volume Source: https://indexacapital.com/en/api-rest-v1/index Retrieve historic portfolio under management by Indexa Capital. Supports JWT and JWT_PLATFORM authentication. ```APIDOC ## GET /stats/volume ### Description Retrieve historic portfolio under management by Indexa Capital. ### Method GET ### Endpoint /stats/volume ### Parameters #### Query Parameters - **from** (string) - Required - Date range start (YYYY-MM-DD). (Default value: 2015-12-15) - **to** (string) - Optional - Date range end (YYYY-MM-DD). (Default value: yesterday) ### Request Example ```json { "from": "2022-01-01", "to": "2022-12-31" } ``` ### Response #### Success Response (200) - **data** (object) - Contains historic portfolio volume data. - **message** (string) - Success message. #### Response Example ```json { "data": { "dates": ["2022-01-01", "2022-01-02"], "volume": [1000000, 1050000] }, "message": "Historic portfolio volume retrieved successfully." } ``` ### Security Secured by **JWT_PLATFORM** and **JWT** #### Headers - **X-AUTH-TOKEN** (string) - Required - Authentication token ```