CNaughtCNaught
PricingSign In

Update Subaccount

Updates the Subaccount with the given id. This does not include updating the logo: there are separate endpoints for doing so. Aside from the logo, all properties should be included in the request body. Not including the default portfolio id in the update request will have the effect of making the subaccount not have an explicit default portfolio (making it inherit the default portfolio from the parent user).

PUT/subaccounts/{id}

Authorizations#

Authorization

string

header

required

Bearer authentication header of the form Bearer <token>, where <token> is your CNaught API key.

Path Parameters#

id

string

required

ID of subaccount to return / modify

Body#

Subaccount Update Parameters

name

string

required

Name for the subaccount

email

string | null

Optional email associated with the subaccount. If not specified, will remove the email from the subaccount.

default_portfolio_id

string | null

Optional ID of the default portfolio to use for fulfilling orders placed for this subaccount. If not specified, the parent account's default portfolio will be the default portfolio for the subaccount.

Response#

200

Subaccount Details after update

Get Subaccount By Id

Update Subaccount

curl --request PUT \
  --url https://api.cnaught.com/v1/subaccounts/<id> \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Operations Department",
  "email": "jane.doe@example.com",
  "default_portfolio_id": "eWvNvC12"
}'
{
  "id": "5nubL0NS",
  "name": "Operations Department",
  "email": "jane.doe@example.com",
  "default_portfolio_id": "eWvNvC12",
  "logo_url": "https://customer-assets.cnaught.com/fe0df075-30e2-4e58-9feb-154e72a9205f/subaccount_logo.png"
}