---
title: "Create or update portfolio user"
method: PUT
path: "/portfolio/accounts/{accountId}/users/{id}"
tags: ["Portfolio Users"]
---

# Create or update portfolio user

`PUT /portfolio/accounts/{accountId}/users/{id}`

## Request

- Base URL: `https://eliq.data-management-api.eliq.com` (the document declares no server; this is the origin it was published from)
- URL: `https://eliq.data-management-api.eliq.com/portfolio/accounts/{accountId}/users/{id}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/eliq/apis/eliq-data-management-api/docs/portfolio/accounts/:accountId/users/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Create or update user on an account for the portfolio.
 If a user with the given id does not exist on the account, a new account user will be created.
 If a user with id exists on the account, that user will be updated.

## Path parameters

- `accountId` string, required
- `id` string, required

## Request body

- PortfolioUser
  - `id` string, nullable
  - `name` string, required
  - `role` 'user' | 'admin' | 'owner', required
  - `created_at_utc` string
  - `last_logon_utc` string, nullable
  - `magic_link_emails` string[], nullable

## Response `200`

Portfolio user was updated

- PortfolioUser
  - `id` string, nullable
  - `name` string, required
  - `role` 'user' | 'admin' | 'owner', required
  - `created_at_utc` string
  - `last_logon_utc` string, nullable
  - `magic_link_emails` string[], nullable

## Other responses

- `201`: Portfolio user was created
- `400`: Bad request. See error code and description for more info
- `404`: Portfolio account was not found

---

[API](https://skmtc.dev/eliq/apis/eliq-data-management-api.md) - [All operations](https://skmtc.dev/eliq/apis/eliq-data-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/eliq/apis/eliq-data-management-api/revisions/9614ae7d0651?raw)
