---
title: "How do I register sub-holding keys (SHKs) with a portfolio?"
slug: "how-do-i-register-sub-holding-keys-shks-with-a-portfolio"
updated: 2024-08-20T12:26:19Z
published: 2024-08-20T12:26:19Z
canonical: "support.lusid.com/how-do-i-register-sub-holding-keys-shks-with-a-portfolio"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I register sub-holding keys (SHKs) with a portfolio?

Providing you have suitable [access control permissions](/v1/docs/identity-management-and-access-control-iam), you can register one or more [sub-holding keys](/v1/docs/what-is-a-sub-holding-key-shk) (SHKs) with a transaction portfolio in order to divide holdings into strategies.

You can register a set of SHKs when you create a portfolio, and subsequently [modify the set at any time](/v1/docs/how-do-i-register-sub-holding-keys-shks-with-a-portfolio#modifying-an-existing-portfolio-to-add-or-remove-shks).

## Registering SHKs when you create a portfolio

1. [Obtain an API access token](/v1/docs/how-do-i-obtain-and-use-a-short-lived-api-access-token-from-okta).
2. Call the LUSID [CreatePortfolio](https://www.lusid.com/docs/api#operation/CreatePortfolio) API for your LUSID domain, passing in your API access token, nominating a `scope` in the URL, and specifying in the request body:
  - A `displayName`.
  - A `code` unique within the `scope`.
  - A `baseCurrency` to which foreign currency transactions can be normalised upon provision of a trade to portfolio rate. This must be an [ISO 4217 currency code](https://en.wikipedia.org/wiki/ISO_4217#Numeric_codes), for example `GBP` or `JPY`.
  - A comma-separated list of SHKs in the `subHoldingKeys` collection. Each must be the 3-stage key of an existing [property type](/v1/docs/how-do-i-create-a-property-type) in the `Transaction` domain.

For example:

```json
curl -X POST "https://<your-domain>.lusid.com/api/api/transactionportfolios/Ibor"
-H "Authorization: Bearer <your-API-access-token>"
-H "Content-Type: application/json-patch+json"
-d '{
  "displayName": "UK equity transaction portfolio",
  "code": "UK-Equity",
  "created": "2023-01-01T00:00:00Z",
  "baseCurrency": "GBP",
  "subHoldingKeys": ["Transaction/Strategy/Signal", "Transaction/Cash/Category"],
}'
```

## Modifying an existing portfolio to add or remove SHKs

1. [Obtain an API access token](/v1/docs/how-do-i-obtain-and-use-a-short-lived-api-access-token-from-okta).
2. Call the LUSID [PatchPortfolioDetails](https://www.lusid.com/docs/api/#operation/PatchPortfolioDetails) API for your LUSID domain, passing in your API access token, and specifying the `scope` and `code` of the portfolio to modify in the URL.
3. Specify an API request that adheres to the [JSON PATCH specification](https://datatracker.ietf.org/doc/html/rfc6902), specifically:
  - An `op` of `add`.
  - A `path` of `/subHoldingKeys`.
  - A comma-separated list of SHKs in the `value` collection. Each must be the 3-stage key of an existing [property type](/v1/docs/how-do-i-create-a-property-type) in the `Transaction` domain. Note that existing SHKs are replaced, so include them in the list to retain.

For example:

```json
curl -X POST "https://<your-domain>.lusid.com/api/api/transactionportfolios/Ibor/UK-Equity/details"
 -H "Authorization: Bearer <your-API-access-token>"
 -H "Content-Type: application/json-patch+json"
 -d '[
  {
    "value": ["Transaction/Client/AccountType", "Transaction/Strategy/Signal", "Transaction/Portfolio/Manager"],
    "path": "/subHoldingKeys",
    "op": "add"
  }
]'
```
