NAV

API Reference

The Coanda API is organized around REST. Our Api has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses and uses standard HTTP response codes, authentication and verbs.

You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Please read the Authentication chapter first.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Authorization: Bearer myToken"

Make sure to replace myToken with the generated token.

Coanda uses JWT tokens to allow access to the API.

Coanda expects for the JWT token to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer myToken

Generate an authorization token

curl "https://aaaic-backend.ppd.rafa.3a-digital.fr/user-service/v1/token/acquire?username=myuser%40test.com&password=testpassword"
-H "accept: text/plain"

The above command returns the JWT token as a raw string in the response body:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.dyt0CoTl4WoVjAHI9Q_CwSKhl6d_9rhM3NrXuJttkao

This endpoint generate a JWT token from a combination of username and password.

HTTP Request

GET /user-service/v1/token/acquire

URL Parameters

ParameterDescription
usernameYour username/clientId. Must be sent url_encoded.
passwordYour password/clientSecret. Must be sent url_encoded.

Simulator Module

The simulator module offers several endpoint to perform various computations on a saving project. The three main endpoints are each dedicated to a specific management mode (free, delegated and glidepath).

Free Management

curl \
  --location 'https://aaaic-backend.ppd.rafa.3a-digital.fr/simulator-service/simulator/free_management' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <myToken>' \
  --data '{
    "simulation_start_date": "202008",
    "simple_deposits": [
      {
        "amount": 5000,
        "date": "202010"
      }
    ],
    "periodic_deposits": [
      {
        "amount": 197.2,
        "start_date": "202008",
        "end_date": "202507",
        "frequency": "MONTHLY"
      }
    ],
    "portfolio_composition": [
      {
        "isin": "LU1883308352",
        "currency": "GBP",
        "percentage": 50,
      },
      {
        "isin": "LU1681046931",
        "currency": "EUR",
        "percentage": 50,
      },
    ],
    "target_amount": 5000,
    "horizon": 60,
    "current_savings": 1000,
    "simulator_uuid": "aaaic:simulators:243",
}'

The above command returns JSON structured like this:

{
  "success_percentage": "float",
  "graphs": {
    "nb_scenarios": "int",
    "scenarios_smooth": [
      {
        "name": "string",
        "data": [
          {
            "x": "float",
            "y": "float"
          }
        ]
      }
    ],
    "synthesis": {
      "savings": {
        "x": "float",
        "y": "float"
      },
      "median": {
        "x": "float",
        "y": "float"
      },
      "lower_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      },
      "mid_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      },
      "upper_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      }
    },
    "success_percentage": "float",
    "scenarios_perc_above_cumulative_savings": "float",
    "id": "string",
    "scenarios": [
      {
        "name": "savings",
        "data": [
          {
            "x": "float",
            "y": "float"
          }
        ],
        "lineWidth": "float",
        "zIndex": "float"
      }
    ]
  },
  "statistics": {
    "mar_ratio": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "sharp_ratio": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "annualized_return": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "max_drawdown": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "annualized_volatility": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    }
  },
  "scenarios_table": {
    "capital_distribution_at_horizon": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "capital_gain_or_loss": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "absolute_return": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "cumulative_savings": "float",
    "gross_cumulative_savings": "float"
  },
  "uc_allocation": [
    {
      "series": "string",
      "percentage": "float"
    }
  ]
}

This endpoint performs a simulation for free management allocations.

HTTP Request

POST /simulator-service/simulator/free_management

Request body

The request body is a JSON object representing a simulation request.

The SimulationRequest object

ParameterMandatoryTypeDescription
simulator_uuidtruestringUnique identifier of the simulator to use. Provided by AAA.
target_amountfalsenumberThe amount of money the client wishes to reach at horizon.
horizontrueintegerThe length (in number of months) of the project’s analysis period.
current_savingsfalsenumberThe money the client has on his account before the project starts.
start_datetruestringThe starting point in time of the simulation. Format is YYYYMM.
simple_depositsfalse[SimpleCashFlow]The series of projected one-time cash contributions.
periodic_depositsfalse[PeriodicCashFlow]The series of projected recurring cash contributions.
simple_withdrawalsfalse[SimpleCashFlow]The series of projected one-time cash withdrawals.
periodic_withdrawalsfalse[PeriodicCashFlow]The series of projected recurring cash withdrawals.
portfolio_compositiontrue[WeightedAsset]Specifies the portfolio composition (assets and corresponding weights).

The WeightedAsset object

ParameterMandatoryTypeDescription
isintruestringThe ISIN code of the asset.
currencytruestringThe currency of the asset, identified by a trigram (e.g. “EUR”).
percentagetruenumberThe weight the asset represent in the portfolio, as a percentage.

The SimpleCashFlow object

ParameterMandatoryTypeDescription
amounttruenumberThe amount of the cash flow.
datetruestringThe date of the cash flow. Format is YYYYMM.

The PeriodicCashFlow object

ParameterMandatoryTypeDescription
amounttruenumberThe amount of the cash flow.
start_datetruestringThe date to start the recurrence. Format is YYYYMM.
end_datetruestringThe date to end the recurrence. Format is YYYYMM.
frequencytruestringFrequency of the recurrence. Can be MONTHLY/QUARTERLY/YEARLY/SEMI_ANNUALLY

Delegated Management

curl \
  --location 'https://aaaic-backend.ppd.rafa.3a-digital.fr/simulator-service/simulator/delegated_management' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <myToken>' \
  --data '{
    "simulation_start_date": "202008",
    "simple_deposits": [
      {
        "amount": 5000,
        "date": "202010"
      }
    ],
    "periodic_deposits": [
      {
        "amount": 197.2,
        "start_date": "202008",
        "end_date": "202507",
        "frequency": "MONTHLY"
      }
    ],
    "target_amount": 5000,
    "horizon": 60,
    "current_savings": 1000,
    "simulator_uuid": "aaaic:simulators:236",
    "profile_idx": 2
}'

The above command returns JSON structured like this:

{
  "success_percentage": "float",
  "graphs": {
    "nb_scenarios": "int",
    "scenarios_smooth": [
      {
        "name": "string",
        "data": [
          {
            "x": "float",
            "y": "float"
          }
        ]
      }
    ],
    "synthesis": {
      "savings": {
        "x": "float",
        "y": "float"
      },
      "median": {
        "x": "float",
        "y": "float"
      },
      "lower_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      },
      "mid_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      },
      "upper_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      }
    },
    "success_percentage": "float",
    "scenarios_perc_above_cumulative_savings": "float",
    "id": "string",
    "scenarios": [
      {
        "name": "savings",
        "data": [
          {
            "x": "float",
            "y": "float"
          }
        ],
        "lineWidth": "float",
        "zIndex": "float"
      }
    ]
  },
  "statistics": {
    "mar_ratio": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "sharp_ratio": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "annualized_return": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "max_drawdown": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "annualized_volatility": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    }
  },
  "scenarios_table": {
    "capital_distribution_at_horizon": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "capital_gain_or_loss": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "absolute_return": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "cumulative_savings": "float",
    "gross_cumulative_savings": "float"
  },
  "uc_allocation": [
    {
      "series": "string",
      "percentage": "float"
    }
  ]
}

This endpoint performs a simulation for delegated management allocations.

HTTP Request

POST /simulator-service/simulator/delegated_management

Request body

The request body is a JSON object representing a simulation request.

The SimulationRequest object

ParameterMandatoryTypeDescription
simulator_uuidtruestringUnique identifier of the simulator to use. Provided by AAA.
target_amountfalsenumberThe amount of money the client wishes to reach at horizon.
horizontrueintegerThe length (in number of months) of the project’s analysis period.
current_savingsfalsenumberThe money the client has on his account before the project starts.
start_datetruestringThe starting point in time of the simulation. Format is YYYYMM.
simple_depositsfalse[SimpleCashFlow]The series of projected one-time cash contributions.
periodic_depositsfalse[PeriodicCashFlow]The series of projected recurring cash contributions.
simple_withdrawalsfalse[SimpleCashFlow]The series of projected one-time cash withdrawals.
periodic_withdrawalsfalse[PeriodicCashFlow]The series of projected recurring cash withdrawals.
profile_idxtrueintegerUnique identifier of the delegated profile. Provided by AAA.

The SimpleCashFlow object

ParameterMandatoryTypeDescription
amounttruenumberThe amount of the cash flow.
datetruestringThe date of the cash flow. Format is YYYYMM.

The PeriodicCashFlow object

ParameterMandatoryTypeDescription
amounttruenumberThe amount of the cash flow.
start_datetruestringThe date to start the recurrence. Format is YYYYMM.
end_datetruestringThe date to end the recurrence. Format is YYYYMM.
frequencytruestringFrequency of the recurrence. Can be MONTHLY/QUARTERLY/YEARLY/SEMI_ANNUALLY

Glidepath Management

curl \
  --location 'https://aaaic-backend.ppd.rafa.3a-digital.fr/simulator-service/simulator/glidepath_management' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <myToken>' \
  --data '{
    "simulation_start_date": "202008",
    "simple_deposits": [
      {
        "amount": 5000,
        "date": "202010"
      }
    ],
    "periodic_deposits": [
      {
        "amount": 197.2,
        "start_date": "202008",
        "end_date": "202507",
        "frequency": "MONTHLY"
      }
    ],
    "target_amount": 5000,
    "horizon": 60,
    "current_savings": 1000,
    "simulator_uuid": "aaaic:simulators:170",
    "profile_idx": 2,
    "age": 35
}'

The above command returns JSON structured like this:

{
  "success_percentage": "float",
  "graphs": {
    "nb_scenarios": "int",
    "scenarios_smooth": [
      {
        "name": "string",
        "data": [
          {
            "x": "float",
            "y": "float"
          }
        ]
      }
    ],
    "synthesis": {
      "savings": {
        "x": "float",
        "y": "float"
      },
      "median": {
        "x": "float",
        "y": "float"
      },
      "lower_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      },
      "mid_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      },
      "upper_area": {
        "x": "float",
        "high": "float",
        "low": "float"
      }
    },
    "success_percentage": "float",
    "scenarios_perc_above_cumulative_savings": "float",
    "id": "string",
    "scenarios": [
      {
        "name": "savings",
        "data": [
          {
            "x": "float",
            "y": "float"
          }
        ],
        "lineWidth": "float",
        "zIndex": "float"
      }
    ]
  },
  "statistics": {
    "mar_ratio": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "sharp_ratio": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "annualized_return": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "max_drawdown": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    },
    "annualized_volatility": {
      "quantile_25": "float",
      "quantile_2.5": "float",
      "quantile_50": "float",
      "quantile_75": "float",
      "quantile_97.5": "float"
    }
  },
  "scenarios_table": {
    "capital_distribution_at_horizon": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "capital_gain_or_loss": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "absolute_return": {
      "max": "float",
      "min": "float",
      "in_between": {
        "high": "float",
        "low": "float"
      }
    },
    "cumulative_savings": "float",
    "gross_cumulative_savings": "float"
  },
  "uc_allocation": [
    {
      "series": "string",
      "percentage": "float"
    }
  ]
}

This endpoint performs a simulation for glidepath management allocations.

HTTP Request

POST /simulator-service/simulator/glidepath_management

Request body

The request body is a JSON object representing a simulation request.

The SimulationRequest object

ParameterMandatoryTypeDescription
simulator_uuidtruestringUnique identifier of the simulator to use. Provided by AAA.
target_amountfalsenumberThe amount of money the client wishes to reach at horizon.
horizontrueintegerThe length (in number of months) of the project’s analysis period.
current_savingsfalsenumberThe money the client has on his account before the project starts.
start_datetruestringThe starting point in time of the simulation. Format is YYYYMM.
simple_depositsfalse[SimpleCashFlow]The series of projected one-time cash contributions.
periodic_depositsfalse[PeriodicCashFlow]The series of projected recurring cash contributions.
simple_withdrawalsfalse[SimpleCashFlow]The series of projected one-time cash withdrawals.
periodic_withdrawalsfalse[PeriodicCashFlow]The series of projected recurring cash withdrawals.
profile_idxtrueintegerUnique identifier of the delegated profile. Provided by AAA.
agetrueintegerThe age of the customer

The SimpleCashFlow object

ParameterMandatoryTypeDescription
amounttruenumberThe amount of the cash flow.
datetruestringThe date of the cash flow. Format is YYYYMM.

The PeriodicCashFlow object

ParameterMandatoryTypeDescription
amounttruenumberThe amount of the cash flow.
start_datetruestringThe date to start the recurrence. Format is YYYYMM.
end_datetruestringThe date to end the recurrence. Format is YYYYMM.
frequencytruestringFrequency of the recurrence. Can be MONTHLY/QUARTERLY/YEARLY/SEMI_ANNUALLY

Premia Module

The Premia module is an intelligent tool that supports advisors at every step of their advisory duty. Risk profile definition and saver objectives, integration of their ESG preferences, for tailored allocation recommendations through an algorithmic adequacy engine. All this allows for automatically generating a complete investment proposal, compliant and ready to share with the saver.

This endpoint allows you to create a Premia session. You authenticate with a JWT, create a session via the API, then redirect the user to Premia with the returned session hash.

Create a Premia Session


# Example 1: subscription to a new contract

curl \
  --location '{BASE_BACKEND_URL}/premia/api/v1/sessions' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <myToken>' \
  --data '{
    "recoJourneyUuid": "aaaic:reco_journeys:4",
    "extProductCode": "PERZEN",
    "extSessionCode": "123456",
    "contactEmail": "adeline.monet@gmail.com",
    "clientLastName": "Monet",
    "clientFirstName": "Adeline",
    "clientBirthDate": "19800101",
    "coSubscriberLastName": "Jean",
    "coSubscriberFirstName": "Monet",
    "coSubscriberBirthDate": "19780331",
    "legalPersonName": "",
    "legalPersonIdentifier": "",
    "legalPersonRepresentativeLastName": "",
    "legalPersonRepresentativeFirstName": "",
    "depositInitialEnabled": true,
    "depositInitial": 5000
  }'
  
  
  # Example 2: contribution / redemption / change in allocation
  
  curl \
  --location '{BASE_BACKEND_URL}/premia/api/v1/sessions' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <myToken>' \
  --data '{
    "recoJourneyUuid": "aaaic:reco_journeys:13",
    "extSessionCode": "123456",
    "extProductCode": "01t0N00000B9B8pQAF",
    "contactEmail": "adeline.monet@gmail.com",
    "clientLastName": "Monet",
    "clientFirstName": "Adeline",
    "clientBirthDate": "19800101",
    "coSubscriberLastName": "Jean",
    "coSubscriberFirstName": "Monet",
    "coSubscriberBirthDate": "19780331",
    "legalPersonName": "",
    "legalPersonIdentifier": "",
    "legalPersonRepresentativeLastName": "",
    "legalPersonRepresentativeFirstName": "",
    "depositInitialEnabled": false,
    "clientRiskKey": "2",
    "clientRiskKeyLastUpdateDate": "20250101",
    "hasSustainablePreferences": true,
    "minSustainableInvestments": 15,
    "minTaxonomyAlignment": null,
    "minCoveragePai": 0.50,
    "greenhouseGasEmissions": true,
    "impactOnBiodiversity": false,
    "waterEmissions": true,
    "hazardousWaste": false,
    "controversialWeapons": false,
    "monitoringOfInternationalPrinciples": false,
    "respectOfInternationalPrinciples": false,
    "genderPayGap": false,
    "lowBoardGenderDiversity": false,
    "clientEsgLastUpdateDate": "20250101",
    "periodicDepositsEnabled": true,
    "regularContributionsAmount": 500,
    "regularContributionsFormat": "CHOSEN_FREQUENCY",
    "regularContributionsFrequency": "MONTHLY",
    "currentComposition": {
        "compositionParts": [
            {
                "partWeights": [
                    {
                        "amount": 400,
                        "displayName": "Mirova Europe Environnement",
                        "extCode": "LU0914733059"
                    },
                    {
                        "amount": 300,
                        "displayName": "Afer Rendement Juin 2023",
                        "extCode": "FR5272AB0288"
                    },
                    {
                        "amount": 250,
                        "displayName": "SC Advenis Immo Capital",
                        "extCode": "P801_SCI001"
                    }
                ],
                "type": "FREE_MANAGEMENT"
            }
        ]
    }
  }'

The above command returns JSON structured like this:

{
  "sessionHash": "abc123"
}

HTTP Request

POST /premia/api/v1/sessions

Request body

The request body is a JSON object with all the information to initiate a session on Premia. Depending on the use case, it is built differently. Examples are provided on the right to illustrate the following cases:

Response

In response, the service will provide a session hash, which is required to initiate the corresponding session on Premia.

The PremiaSessionRequest object

ParameterMandatoryTypeDescription
recoJourneyUuidtruestringIdentifier of the Premia configuration to use. Provided by AAA.
extProductCodetruestringYour product code in the partner system (e.g., PERZEN).
extSessionCodetruestringYour internal reference for traceability.
contactEmailfalsestringContact email for notifications.
clientLastNametruestringClient last name.
clientFirstNametruestringClient first name.
clientBirthDatetruestringClient birth date in YYYYMMDD format.
coSubscriberLastNamefalsestringCo-subscriber last name (if applicable).
coSubscriberFirstNamefalsestringCo-subscriber first name (if applicable).
coSubscriberBirthDatefalsestringCo-subscriber birth date in YYYYMMDD format (if applicable).
legalPersonNamefalsestringLegal entity name (for corporate subscriptions).
legalPersonIdentifierfalsestringLegal entity identifier (e.g., SIREN).
legalPersonRepresentativeLastNamefalsestringLegal representative last name (for corporate subscriptions).
legalPersonRepresentativeFirstNamefalsestringLegal representative first name (for corporate subscriptions).
depositInitialEnabledfalsebooleanWhether an initial deposit is enabled.
depositInitialconditionalnumberInitial deposit amount. Required when depositInitialEnabled is true.
clientRiskKeyfalsestringClient risk profile key (e.g., “2”).
clientRiskKeyLastUpdateDatefalsestringDate of last update of the risk profile in YYYYMMDD format.
hasSustainablePreferencesfalsebooleanDoes the client have sustainable/ESG preferences?
minSustainableInvestmentsfalsenumberMinimum % of sustainable investments (use “15” for 15%).
minTaxonomyAlignmentfalsenumberMinimum % taxonomy alignment (use “15” for 15%).
minCoveragePaifalsenumberMinimum % coverage for PAIs (use “15” for 15%).
greenhouseGasEmissionsfalsebooleanPAI Climate.
impactOnBiodiversityfalsebooleanPAI Biodiversity.
waterEmissionsfalsebooleanPAI Water quality.
hazardousWastefalsebooleanPAI Responsible waste management.
controversialWeaponsfalsebooleanPAI Controversial weapons control.
monitoringOfInternationalPrinciplesfalsebooleanPAI Monitoring of international principles.
respectOfInternationalPrinciplesfalsebooleanPAI Respect of international principles.
genderPayGapfalsebooleanPAI Gender pay gap.
lowBoardGenderDiversityfalsebooleanPAI Low board gender diversity.
clientEsgLastUpdateDatefalsestringDate of last update of ESG preferences in YYYYMMDD format.
periodicDepositsEnabledfalsebooleanAre periodic deposits enabled?
regularContributionsAmountconditionalnumberAmount of the periodic contribution. Required when periodicDepositsEnabled is true.
regularContributionsFormatfalsestringContribution format. Values: “CHOSEN_FREQUENCY”.
regularContributionsFrequencyfalsestringContribution frequency. Values: “MONTHLY”, “QUARTERLY”, “SEMIANNUALLY”, “ANNUALLY”.
currentCompositionfalseobjectComposition of the current allocation.
extCodefalsestringSupport code. Context: inside currentComposition.compositionParts[].partWeights[].
displayNamefalsestringFinancial asset name. Context: inside currentComposition.compositionParts[].partWeights[].
amountfalsenumberMarket value of the line. Context: inside currentComposition.compositionParts[].partWeights[].

If the input is invalid or you do not have access, the API will return standard HTTP errors (400, 403, 404) with a JSON body describing the issue.

Redirect the user to Premia

Once you receive the sessionHash, redirect the user’s browser to Premia using the following URL:

{BASE_UI_URL}/premia/sessions?hash={sessionHash}

Replace {BASE_UI_URL} with the Premia host you are integrating with (staging, production, etc.).

const res = await fetch(`${BASE_BACKEND_URL}/premia/api/v1/sessions`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`,
  },
  body: JSON.stringify(payload),
});
const { sessionHash } = await res.json();
window.location.href = `${BASE_UI_URL}/premia/sessions?hash=${sessionHash}`;

Resume a Premia session

Once you know the sessionHash, redirect the user’s browser to Premia using the following URL:

{BASE_UI_URL}/premia/sessions?hash={sessionHash}

Replace {BASE_UI_URL} with the Premia host you are integrating with (staging, production, etc.).

Errors

The Coanda API uses the following error codes:

4xx

Error CodeMeaning
401Unauthorized – Token is invalid.
403Forbidden – Credentials are correct but permissions are not.
404Not Found – The specified endpoint does not exist.
405Method Not Allowed – You tried to access a endpoint with an invalid method.
422Bad Request – Your request is invalid.
429Too Many Requests – You’re sending too many requests in a small interval. Slow down!

5xx

Error CodeMeaning
500Internal Server Error – We had a problem with our server. Try again later.
503Service Unavailable – We’re temporarily offline for maintenance. Please try again later.