Errors
not_found_portfolio
404 — the portfolio referenced by the token or by the request does not resolve in this scope.
Last updated
Cause
Matter returns not_found_portfolio when a prt_* portfolio id named on the token, on a request parameter, or on a resource-bind action does not resolve to a row visible to the caller. This can happen when a portfolio has been deleted, when its id is mistyped, or when the calling token's account doesn't own the portfolio.
Portfolios are account-scoped containers for entities. The id is not globally unique by accident — different accounts cannot share a portfolio, and a portfolio id from one account cannot be referenced by a token from another. As with not_found_resource, the error collapses "doesn't exist" and "exists but invisible" to avoid leaking the existence of portfolios in other accounts.
Fix
- Read the portfolio id from a recent
listPortfoliosresponse. Don't construct portfolio ids by hand. - Confirm the calling token belongs to the same account that owns the portfolio. Cross-account access requires a separate token issued by the target account.
- If the portfolio has been deleted, restore the token's
portfolio_idtonull(account-wide) or re-bind it to an existing portfolio. - If you intend to create a new portfolio, use
createPortfolioand capture the returned id.
Related codes
not_found_resource— a non-portfolio id failed to resolve.scope_resource_out_of_portfolio— the portfolio resolves but the requested resource isn't in it.