# Post an Existing TOE to your Portfolio source: https://developer.mastercard.com/riskrecon-api/documentation/testing/toe-samples/add-an-exist-toe-smpl/index.md Allows you to instantly add an existing TOE to your portfolio using its TOE ID. ## Pre-requisites {#pre-requisites} Refer to the [Add an Existing TOE to your Portfolio](https://developer.mastercard.com/riskrecon-api/documentation/use-cases/portfolio-management/portfolio/add-an-existing-toe/index.md) use case. ## Request URL for the Sandbox environment {#request-url-for-the-sandbox-environment} POST https://api.sandbox.riskrecon.com/v1/toe/{toe_id} ## Request URL for the Production environment {#request-url-for-the-production-environment} POST https://api.riskrecon.com/v1/toe/{toe_id} ## Test Cases {#test-cases} ### Test Case: Success - Add an existing TOE to your portfolio {#test-case-success---add-an-existing-toe-to-your-portfolio} **Request** Here is an example of a request made to add an existing TOE to your portfolio using the `curl` command. ```bash curl -X 'POST' \ 'https://api.sandbox.riskrecon.com/v1/toe/09918d09-8d52-4e86-a3ec-5ef4d461e2ba' \ -H 'accept: application/json' \ -H 'Authorization: valid_JWT' \ -H 'Content-Type: application/json' \ -d '{ "assessment_frequency": "continuous", "internal_ids": [ "testing_c" ], "internal_names": [ "testing_c ], "risk_relationship_slugs": [ "ownenterprise_critical" ], "subscription_level": 2 }' ``` **Response** post: HTTP response 200 ```json { "internal_id": [ "example.com" ], "internal_name": [ "Some Company, Inc." ], "toe_id": "5976423a-ee35-11e3-8569-14109ff1a304", "toe_short_name": "Example, CO." } ``` ### Test Case: Fail - Invalid Subscription Level {#test-case-fail---invalid-subscription-level} **Request** Here is an example of a request with an incorrect subscription level using the `curl` command. ```bash curl -X 'POST' \ 'https://api.sandbox.riskrecon.com/v1/toe/09918d09-8d52-4e86-a3ec-5ef4d461e2ba' \ -H 'accept: application/json' \ -H 'Authorization: valid_JWT' \ -H 'Content-Type: application/json' \ -d '{ "assessment_frequency": "continuous", "internal_ids": [ "1234" ], "internal_names": [ "Riskrecon" ], "risk_relationship_slugs": [ "ownenterprisecritic" ], "subscription_level": 9 }' ``` **Response** HTTP Error response 400 ```json { "Errors": { "Error": [ { "Description": "Bad Request", "Details": "subscription_level: is invalid", "ReasonCode": "BAD_REQUEST", "Recoverable": false, "Source": "RISKRECON_API" } ] } } ``` ### Test Case: Fail - Invalid Assessment Frequency {#test-case-fail---invalid-assessment-frequency} **Request** Here is an example of a request made with an incorrect assessment frequency using a `curl` command. ```bash curl -X 'POST' \ 'https://api.sandbox.riskrecon.com/v1/toe/09918d09-8d52-4e86-a3ec-5ef4d461e2ba' \ -H 'accept: application/json' \ -H 'Authorization: valid_JWT' \ -H 'Content-Type: application/json' \ -d '{ "assessment_frequency": "continu", "internal_ids": [ "1234" ], "internal_names": [ "Riskrecon" ], "risk_relationship_slugs": [ "ownenterprise_critical" ], "subscription_level": 2 }' ``` **Response** HTTP Error response 400 ```json { "Errors": { "Error": [ { "Description": "Bad Request", "Details": "assessment_frequency: is invalid", "ReasonCode": "BAD_REQUEST", "Recoverable": false, "Source": "RISKRECON_API" } ] } } ``` ### Test Case: Fail - Assessment Frequency Missing {#test-case-fail---assessment-frequency-missing} **Request** Here is an example of a request made without providing the assessment frequency using a `curl` command. ```bash curl -X 'POST' \ 'https://api.sandbox.riskrecon.com/v1/toe/09918d09-8d52-4e86-a3ec-5ef4d461e2ba' \ -H 'accept: application/json' \ -H 'Authorization: valid_JWT' \ -H 'Content-Type: application/json' \ -d '{ "assessment_frequency": "", "internal_ids": [ "1234" ], "internal_names": [ "RiskRecon" ], "risk_relationship_slugs": [ "ownenterprisecritic" ], "subscription_level": 2 }' ``` **Response** HTTP Error response 400 ```json { "Errors": { "Error": [ { "Description": "Bad Request", "Details": "assessment_frequency: can't be blank", "ReasonCode": "BAD_REQUEST", "Recoverable": false, "Source": "RISKRECON_API" } ] } } ```