From 79996aeb98fbf8c85c0a32f3168b473010a81e24 Mon Sep 17 00:00:00 2001 From: Francisco de Maussion Date: Mon, 3 Nov 2025 19:01:28 +0100 Subject: [PATCH 1/2] adds OIDC docs --- source/includes/_accounts.md.erb | 34 ++++++------ source/includes/_auth.md | 89 +++++++++++++++++++----------- source/includes/_households.md.erb | 2 +- source/includes/_intro.md | 6 +- source/includes/_investors.md.erb | 2 +- source/includes/_models.md.erb | 18 +++--- source/includes/_securities.md | 6 +- source/includes/_version.md | 4 ++ 8 files changed, 95 insertions(+), 66 deletions(-) diff --git a/source/includes/_accounts.md.erb b/source/includes/_accounts.md.erb index f7b94ca38c8..a2c8c3a7021 100644 --- a/source/includes/_accounts.md.erb +++ b/source/includes/_accounts.md.erb @@ -25,24 +25,24 @@ } ``` -| Name | Type | Description | -|-------------|--------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| id | int | Account ID | -| external_id | string | Your account identifier | -| name | string | Account name | -| value | string | Account value | -| type | string | Account type . | -| tax_status | string | Account tax status. One of [these values](http://api.stratifi.com/docs/v1/#account-tax-statuses). | | -| number | string | Account number | -| strategy | int | Account strategy represented as Model Portfolio Id. You can find the desired model portfolio using the [list or get endpoint](http://api.stratifi.com/docs/v1/#list-model-portfolios). | -| investor | int | Investor ID | +| Name | Type | Description | +|-------------|--------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| id | int | Account ID | +| external_id | string | Your account identifier | +| name | string | Account name | +| value | string | Account value | +| type | string | Account type . | +| tax_status | string | Account tax status. One of [these values](#account-tax-statuses). | | +| number | string | Account number | +| strategy | int | Account strategy represented as Model Portfolio Id. You can find the desired model portfolio using the [list or get endpoint](#list-model-portfolios). | +| investor | int | Investor ID | | advisor | int | Advisor ID. Ideally, you would provide the investor ID. However, if you don't have that information but you know who is the advisor that owns this account then you can pass the advisor ID. We will assign the account to the `default_investor` of the selected advisor. | -| positions[] | List of [Positions Objects](#positions) | Account holdings | -| risk | [Risk Object](#risk-object-definition) | Account risk | -| tolerance | [Tolerance Object](#tolerance-object-definition) | Account tolerance | -| drift | float | Drift between the risk and the tolerance overall scores | -| sources | List of [Sources Objects](#account-source-object-definition) | List of sources that are associated with the account | -| teams | List of Teams Ids | List of teams ids that are associated with the account | +| positions[] | List of [Positions Objects](#positions) | Account holdings | +| risk | [Risk Object](#risk-object-definition) | Account risk | +| tolerance | [Tolerance Object](#tolerance-object-definition) | Account tolerance | +| drift | float | Drift between the risk and the tolerance overall scores | +| sources | List of [Sources Objects](#account-source-object-definition) | List of sources that are associated with the account | +| teams | List of Teams Ids | List of teams ids that are associated with the account | ### Account Source Object Definition diff --git a/source/includes/_auth.md b/source/includes/_auth.md index 49079051ca6..343f31f305e 100644 --- a/source/includes/_auth.md +++ b/source/includes/_auth.md @@ -3,7 +3,7 @@ We use the OAuth 2.0 protocol with PKCE, an industry standard for authorization management. Make sure you have the _CLIENT ID_ an a _SECRET KEY_ provided by our support team. If you don't have them contact us -at support@stratifi.com. +at support@stratifi.com. ## Authorization Code Flow + PCKE @@ -85,9 +85,10 @@ curl -X POST "https://backend.stratifi.com/o/token/" \ "token_type": "Bearer", "expires_in": 3600, "refresh_token": "{{ refresh_token }}", - "scope": "read write", + "scope": "openid read write", "advisor_id": 1, - "session_token": "{{ session_token }} + "session_token": "{{ session_token }}", + "id_token": "{{ id_token }}" } ``` @@ -104,15 +105,16 @@ curl -X POST "https://backend.stratifi.com/o/token/" \ **Response** -| Parameter | Type | | -|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| -| token_type | string | Always "Bearer" | -| access_token | string | An access token valid to consult other endpoints on behalf of the user | -| expires_in | string | Expiration time of the access token in seconds | -| refresh_token | string | An refresh token valid to renew the access token. It does not expires. | -| scope | string | The scopes with granted access for this token | -| advisor_id | int | The ID of the advisor associated to this user | -| session_token | string | A short-lived token used to start a session in stratifi.com (more details) | +| Parameter | Type | | +|---------------|--------|------------------------------------------------------------------------------------------------------| +| token_type | string | Always "Bearer" | +| access_token | string | An access token valid to consult other endpoints on behalf of the user | +| expires_in | string | Expiration time of the access token in seconds | +| refresh_token | string | An refresh token valid to renew the access token. It does not expires. | +| scope | string | The scopes with granted access for this token | +| advisor_id | int | The ID of the advisor associated to this user | +| session_token | string | A short-lived token used to [start a session in stratifi.com](#starting-a-session-in-stratifi-com) | +| id_token | string | An OpenID Connect ID token used to start a session in stratifi.com | 6. Include the _Authorization_ header in your requests as follows: @@ -137,9 +139,10 @@ curl -X POST "https://backend.stratifi.com/o/token/" \ "token_type": "Bearer", "expires_in": 3600, "refresh_token": "{{ refresh_token }}", - "scope": "read write", + "scope": "openid read write", "advisor_id": 1, - "session_token": "{{ session_token }} + "session_token": "{{ session_token }}", + "id_token": "{{ id_token }}" } ``` @@ -155,18 +158,38 @@ curl -X POST "https://backend.stratifi.com/o/token/" \ **Response** -| Parameter | Type | | -|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| -| token_type | string | Always "Bearer" | -| access_token | string | An access token valid to consult other endpoints on behalf of the user | -| expires_in | string | Expiration time of the access token in seconds | -| refresh_token | string | An refresh token valid to renew the access token | -| scope | string | The scopes with granted access for this token | -| advisor_id | int | The ID of the advisor associated to this user | -| session_token | string | A short-lived token used to start a session in stratifi.com (more details) | +| Parameter | Type | | +|---------------|--------|----------------------------------------------------------------------------------------------------| +| token_type | string | Always "Bearer" | +| access_token | string | An access token valid to consult other endpoints on behalf of the user | +| expires_in | string | Expiration time of the access token in seconds | +| refresh_token | string | An refresh token valid to renew the access token | +| scope | string | The scopes with granted access for this token | +| advisor_id | int | The ID of the advisor associated to this user | +| session_token | string | A short-lived token used to [start a session in stratifi.com](#starting-a-session-in-stratifi-com) | +| id_token | string | An OpenID Connect ID token used to start a session in stratifi.com | ## Starting a session in stratifi.com +### OIDC Flow (Recommended) +You can start a session in stratifi.com using the OpenID Connect protocol. To do so, you need to include the `openid` scope +when requesting the authorization code. The response will include an `id_token` property that you can use to start a session in stratifi.com. + +```shell +curl -X POST "https://backend.stratifi.com/o/sso/" \ + -H "Authorization: Bearer {{ access-token }}" \ + -d "{'starting_url': '/advisor/investors'}" + +redirection to "https://advisors.stratifi.com/advisor/investors/" +``` + +Making an authenticated request to the `/o/sso/` endpoint will redirect the user to stratifi.com and start a session. +You can include an optional `starting_url` property to specify the path where the user will be redirected after starting the session. +If not provided, the user will be redirected to the default dashboard. + + +### Session Token Flow(Deprecated) + The authorization responses described above contain a **session_token** property. This token automatically authenticates advisors in stratifi.com, meaning that the advisor won't be required to fill the credentials when visiting Stratifi. @@ -188,10 +211,10 @@ To build an authenticated URL you need 3 parts: | Model Portfolios list | `/advisor/models/` | | Model Portfolios overview | `/advisor/models//` | -Having these 3 elements, the full URL is: `https://{{ base_domain}}{{ path }}?session={{ sesison_token }}` +Having these 3 elements, the full URL is: `https://{{ base_domain }}{{ path }}?session={{ sesison_token }}` -For instance, `https://advisors-sandbox.stratifi.com/advisor/investors/1/?session=abc123` will lead the user -to the details page of the client with id 1 in the sandbox environment. +For instance, `https://advisors.stratifi.com/advisor/investors/1/?session=abc123` will lead the user +to the details page of the client with id 1. Note: The session token has a life of 5 minutes. After that, you will need to follow the refresh token flow to get a new one. If you use an expired token in an URL, the user will be redirected to the signin page in @@ -216,10 +239,10 @@ curl -X GET "https://backend.stratifi.com/api/v1/userinfo/" **Response** -| Name | Type | Description | -|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| -| first_name | string | User first name | -| last_name | string | User last name | -| email | string | User email address | -| advisor_id | int | The ID of the advisor associated to this user | -| session_token | string | A short-lived token used to start a session in stratifi.com (more details) | +| Name | Type | Description | +|---------------|--------|----------------------------------------------------------------------------------------------------| +| first_name | string | User first name | +| last_name | string | User last name | +| email | string | User email address | +| advisor_id | int | The ID of the advisor associated to this user | +| session_token | string | A short-lived token used to [start a session in stratifi.com](#starting-a-session-in-stratifi-com) | diff --git a/source/includes/_households.md.erb b/source/includes/_households.md.erb index 00a9ced9cf7..366ce0cd390 100644 --- a/source/includes/_households.md.erb +++ b/source/includes/_households.md.erb @@ -221,4 +221,4 @@ curl "https://backend.stratifi.com/api/v1/households/11/prism_aggregation/" -H " |--------|-----------------------------------|---------------------------| | scores | [Scores Factors](#scores-factors) | Risk score factors | | media | [Scores Images](#scores-media) | Risk score factors images | -| status | [Scores Status](#scores-status) | Risk score status | +| status | [Scores Status](#risk-statuses) | Risk score status | diff --git a/source/includes/_intro.md b/source/includes/_intro.md index 00204de8e49..dba528b20df 100644 --- a/source/includes/_intro.md +++ b/source/includes/_intro.md @@ -9,10 +9,10 @@ you are familiar with Postman, you can consult and import this collection and play with the API. -Before start using the API you need contact us at +Before start using the API you need contact us at support@stratifi.com and request API access. We will provide you a _CLIENT ID_ an a _SECRET KEY_ required to complete the authorization process. If you want to know more about how the information is organized in StratiFi or want to familiarize with the API -structure go to the About section. If you are ready to -start, go to the Authorization section. +structure go to the [About](#about-stratifi) section. If you are ready to +start, go to the [Authorization](#authorization) section. diff --git a/source/includes/_investors.md.erb b/source/includes/_investors.md.erb index a7307c9e849..e978a0ae40d 100644 --- a/source/includes/_investors.md.erb +++ b/source/includes/_investors.md.erb @@ -271,4 +271,4 @@ curl "https://backend.stratifi.com/api/v1/investors/11/prism_aggregation/" -H "A |--------|-----------------------------------|---------------------------| | scores | [Scores Factors](#scores-factors) | Risk score factors | | media | [Scores Images](#scores-media) | Risk score factors images | -| status | [Scores Status](#scores-status) | Risk score status | +| status | [Scores Status](#risk-statuses) | Risk score status | diff --git a/source/includes/_models.md.erb b/source/includes/_models.md.erb index 2baadf1093d..780fac1f52c 100644 --- a/source/includes/_models.md.erb +++ b/source/includes/_models.md.erb @@ -83,12 +83,12 @@ curl "https://backend.stratifi.com/api/v1/models/" -H "Authorization: Bearer {{ **Response Fields** -| Name | Type | Description | -|----------|--------|---------------------------------------------------| -| count | int | Total number of models | -| next | string | Link to next page of models | -| previous | string | Link to previous page of models | -| results | Object | List of [model objects](#model-object-definition) | +| Name | Type | Description | +|----------|--------|-------------------------------------------------------------| +| count | int | Total number of models | +| next | string | Link to next page of models | +| previous | string | Link to previous page of models | +| results | Object | List of [model objects](#model-portfolio-object-definition) | **Filtering Fields** @@ -124,7 +124,7 @@ curl "https://backend.stratifi.com/api/v1/models/1/" -H "Authorization: Bearer { -request-url: `/models//` -**Response:** The requested [model object](#model-object-definition). +**Response:** The requested [model object](#model-portfolio-object-definition). ## Create Model Portfolio @@ -185,7 +185,7 @@ curl -X POST "https://backend.stratifi.com/api/v1/models/" -H "Authorization: Be | company | int | Optional | | external_id | int | Optional | -**Response:** The new [model object](#model-object-definition). +**Response:** The new [model object](#model-portfolio-object-definition). ## Update Model Portfolio @@ -269,4 +269,4 @@ curl "https://backend.stratifi.com/api/v1/models/11/prism_score/" -H "Authorizat |--------|-----------------------------------|---------------------------| | scores | [Scores Factors](#scores-factors) | Risk score factors | | media | [Scores Images](#scores-media) | Risk score factors images | -| status | [Scores Status](#scores-status) | Risk score status | +| status | [Scores Status](#risk-statuses) | Risk score status | diff --git a/source/includes/_securities.md b/source/includes/_securities.md index 4f6b4958d2e..55854810442 100644 --- a/source/includes/_securities.md +++ b/source/includes/_securities.md @@ -46,7 +46,8 @@ > Get security by ticker ```shell -curl "https://backend.stratifi.com/api/v1/securities/ticker/GOOGL" -H "Authorization: Bearer {{ access-token }}" +curl "https://backend.stratifi.com/api/v1/securities/ticker/GOOGL" \ + -H "Authorization: Bearer {{ access-token }}" ``` -request-type: GET @@ -58,7 +59,8 @@ curl "https://backend.stratifi.com/api/v1/securities/ticker/GOOGL" -H "Authoriza > Get security by cusip ```shell -curl "https://backend.stratifi.com/api/v1/securities/cusip/02079K305" -H "Authorization: Bearer {{ access-token }}" +curl "https://backend.stratifi.com/api/v1/securities/cusip/02079K305" \ + -H "Authorization: Bearer {{ access-token }}" ``` -request-type: GET diff --git a/source/includes/_version.md b/source/includes/_version.md index 3ec566f6990..3139d20f4a1 100644 --- a/source/includes/_version.md +++ b/source/includes/_version.md @@ -1,5 +1,9 @@ # Changelog +- 1.14.0 (2025-11-03) + - session token deprecation notice + - adds OIDC support + - adds '/o/sso/' for starting a session on stratifi.com - 1.13.0 (2024-07-08) - Modify `sources` field in `household`, `investor`, `account` and `model_portfolio`, now returns an object with the fields `id`, `provider`, `provider_id`, `created` and `modified`. - Add `source_id` and `source_provider` filters to `household`, `investor`, `account` and `model_portfolio`. From 13d8619738d72a470728f0f8e3e03c22250fb613 Mon Sep 17 00:00:00 2001 From: Francisco de Maussion Date: Thu, 6 Nov 2025 16:52:19 +0100 Subject: [PATCH 2/2] adds provider name filtering for investors, accounts, households and MPs --- source/includes/_accounts.md.erb | 15 ++++++++------- source/includes/_households.md.erb | 13 +++++++------ source/includes/_investors.md.erb | 15 ++++++++------- source/includes/_models.md.erb | 11 ++++++----- source/includes/_version.md | 3 ++- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/source/includes/_accounts.md.erb b/source/includes/_accounts.md.erb index a2c8c3a7021..0f041714274 100644 --- a/source/includes/_accounts.md.erb +++ b/source/includes/_accounts.md.erb @@ -106,13 +106,14 @@ curl "https://backend.stratifi.com/api/v1/accounts/" -H "Authorization: Bearer { **Filtering Fields** -| Name | Type | Description | -|-----------------|--------|--------------------------| -| external_id | string | Your account identifier | -| investor | int | Investor ID | -| household | int | Household ID | -| source_id | int | Source ID | -| source_provider | int | Source provider ID | +| Name | Type | Description | +|----------------------|--------|-------------------------| +| external_id | string | Your account identifier | +| investor | int | Investor ID | +| household | int | Household ID | +| source_id | int | Source ID | +| source_provider | int | Source provider ID | +| source_provider_name | str | Source provider Name | ## Get Account diff --git a/source/includes/_households.md.erb b/source/includes/_households.md.erb index 366ce0cd390..bb19b569d3e 100644 --- a/source/includes/_households.md.erb +++ b/source/includes/_households.md.erb @@ -93,12 +93,13 @@ curl "https://backend.stratifi.com/api/v1/households/" -H "Authorization: Bearer **Filtering Fields** -| Name | Type | Description | -|-----------------|--------|---------------------------| -| advisor | int | Advisor ID | -| external_id | string | Your household identifier | -| source_id | int | Source ID | -| source_provider | int | Source provider ID | +| Name | Type | Description | +|----------------------|--------|---------------------------| +| advisor | int | Advisor ID | +| external_id | string | Your household identifier | +| source_id | int | Source ID | +| source_provider | int | Source provider ID | +| source_provider_name | str | Source provider Name | ## Get Household diff --git a/source/includes/_investors.md.erb b/source/includes/_investors.md.erb index e978a0ae40d..080cc9240df 100644 --- a/source/includes/_investors.md.erb +++ b/source/includes/_investors.md.erb @@ -107,13 +107,14 @@ curl "https://backend.stratifi.com/api/v1/investors/" -H "Authorization: Bearer **Filtering Fields** -| Name | Type | Description | -|-----------------|--------|--------------------------| -| advisor | int | Advisor ID | -| household | int | Household ID | -| external_id | string | Your investor identifier | -| source_id | int | Source ID | -| source_provider | int | Source provider ID | +| Name | Type | Description | +|----------------------|--------|--------------------------| +| advisor | int | Advisor ID | +| household | int | Household ID | +| external_id | string | Your investor identifier | +| source_id | int | Source ID | +| source_provider | int | Source provider ID | +| source_provider_name | str | Source provider Name | ## Get Investor diff --git a/source/includes/_models.md.erb b/source/includes/_models.md.erb index 780fac1f52c..fa2d31552fd 100644 --- a/source/includes/_models.md.erb +++ b/source/includes/_models.md.erb @@ -92,11 +92,12 @@ curl "https://backend.stratifi.com/api/v1/models/" -H "Authorization: Bearer {{ **Filtering Fields** -| Name | Type | Description | -|-----------------|--------|-------------------------| -| external_id | string | Your model identifier | -| source_id | int | Source ID | -| source_provider | int | Source provider ID | +| Name | Type | Description | +|----------------------|--------|-----------------------| +| external_id | string | Your model identifier | +| source_id | int | Source ID | +| source_provider | int | Source provider ID | +| source_provider_name | str | Source provider Name | ## Get Model Portfolio diff --git a/source/includes/_version.md b/source/includes/_version.md index 3139d20f4a1..088cd0c33f5 100644 --- a/source/includes/_version.md +++ b/source/includes/_version.md @@ -1,9 +1,10 @@ # Changelog -- 1.14.0 (2025-11-03) +- 1.14.0 (2025-11-06) - session token deprecation notice - adds OIDC support - adds '/o/sso/' for starting a session on stratifi.com + - adds filtering for provider_name on sources field for household, investor, account and model_portfolio endpoints - 1.13.0 (2024-07-08) - Modify `sources` field in `household`, `investor`, `account` and `model_portfolio`, now returns an object with the fields `id`, `provider`, `provider_id`, `created` and `modified`. - Add `source_id` and `source_provider` filters to `household`, `investor`, `account` and `model_portfolio`.