Portfolios
Portfolios organize the insurance you track and the profiles it covers. On this page, we’ll look at how to create, retrieve, update, and delete a portfolio.
Create a key in API keys and send it as shown below. Your key accesses only your own account’s data. See Authentication. Example IDs and product names are illustrative; replace them with values returned by your API.
Try these requests in the playground. Sign in to execute requests using your own account.
The Portfolio Model
A portfolio belongs to one user and has its own list of profiles and tracked policies. Creating a portfolio also creates one editable self profile, using your profile name or “Me”.
Properties
- Name
id- Type
- string
- Description
The opaque portfolio ID, prefixed with
port_and followed by 32 hexadecimal characters.
- Name
name- Type
- string
- Description
The portfolio name. Trimmed, nonblank, and at most 255 characters.
- Name
created_at- Type
- timestamp
- Description
Creation time as Unix seconds.
- Name
updated_at- Type
- timestamp
- Description
Last update time as Unix seconds.
List all portfolios
Retrieve a paginated list of your portfolios, ordered newest first. Each response includes pagination metadata; pages beyond the available results return an empty list.
Optional attributes
- Name
page- Type
- integer
- Description
Page number, starting at 1. Defaults to 1; maximum 1000000.
- Name
limit- Type
- integer
- Description
Number of results per page. Defaults to 20; maximum 100.
Request
curl -G "https://api.insuredspeaks.com/v1/portfolios" \
-H "X-API-Key: $API_KEY" \
-d page=1 \
-d limit=20
Response
{
"success": true,
"data": [
{
"id": "port_8f15e4c0904c4c118239c9628302c172",
"name": "My Family Insurance",
"created_at": 1792713600,
"updated_at": 1792713600
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
}
Create a portfolio
Create a portfolio and its self profile together. The response contains the portfolio; use List all profiles to find the self profile's ID. Returns 201 on success.
Required attributes
- Name
name- Type
- string
- Description
A nonblank portfolio name, up to 255 characters.
Request
curl "https://api.insuredspeaks.com/v1/portfolios" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Family Insurance"
}'
Response
{
"success": true,
"data": {
"id": "port_8f15e4c0904c4c118239c9628302c172",
"name": "My Family Insurance",
"created_at": 1792713600,
"updated_at": 1792713600
}
}
Retrieve a portfolio
Retrieve a portfolio by its ID. Use the separate profiles and tracked policy endpoints to browse its contents. Returns 404 if the portfolio does not exist or belongs to another user.
Request
curl "https://api.insuredspeaks.com/v1/portfolios/$PORTFOLIO_ID" \
-H "X-API-Key: $API_KEY"
Response
{
"success": true,
"data": {
"id": "port_8f15e4c0904c4c118239c9628302c172",
"name": "My Family Insurance",
"created_at": 1792713600,
"updated_at": 1792713600
}
}
Update a portfolio
Rename an existing portfolio. Its owner, profiles, and tracked policies remain the same. Returns the updated portfolio.
Required attributes
- Name
name- Type
- string
- Description
The new portfolio name. Must be nonblank and at most 255 characters.
Request
curl -X PATCH "https://api.insuredspeaks.com/v1/portfolios/$PORTFOLIO_ID" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Family Protection"
}'
Response
{
"success": true,
"data": {
"id": "port_8f15e4c0904c4c118239c9628302c172",
"name": "Family Protection",
"created_at": 1792713600,
"updated_at": 1792717200
}
}
Delete a portfolio
Delete a portfolio and all of its profiles, tracked policies, and coverage assignments. This includes its self profile. Shared catalogue products are preserved. This request accepts no body.
Request
curl -X DELETE "https://api.insuredspeaks.com/v1/portfolios/$PORTFOLIO_ID" \
-H "X-API-Key: $API_KEY"
Response
{
"success": true,
"message": "Resource deleted"
}
Errors
Portfolio endpoints return success: false and a message when a request fails. Invalid input returns 400, invalid authentication 401, and missing or inaccessible resources 404. Conflicts return 409, oversized bodies 413, and API-key rate limits 429. Server failures return 500 or 503. Responses use Cache-Control: no-store.