---
title: "Create a role"
method: POST
path: "/roles"
tags: ["Roles"]
---

# Create a role

`POST /roles`

Creates a role.

## Headers

- `idempotency-key` string, uuid, required

## Request body

- union — Request schema for creating a role.
  - object — Request to create a role assignment for an account group.
    - `user_id` string, uuid, required — User unique identifier.
    - `entity_type` string, required — Entity type must be ACCOUNT_GROUP
    - `entity_id` string, uuid, required — Account group unique identifier.
    - `role_type` 'GUARDIAN', required — Role type for account group. * GUARDIAN - Guardian for child account groups
    - `custody_type` 'SOLE_CUSTODY' | 'JOINT_CUSTODY' — Custody type for child account groups. * SOLE_CUSTODY - Single guardian * JOINT_CUSTODY - Multiple guardians required
  - object — Request to create a role for a business entity.
    - `user_id` string, uuid, required — User unique identifier.
    - `entity_type` string, required — Entity type must be BUSINESS
    - `entity_id` string, uuid, required — Unique identifier for the business.
    - `role_type` 'LEGAL_REPRESENTATIVE' | 'AUTHORISED_SIGNATORY' | 'ULTIMATE_BENEFICIAL_OWNER' | 'CONTRACTING_EXECUTIVE' | 'TRADER' | 'SOLE_TRADER', required — Role type for business entity. * LEGAL_REPRESENTATIVE - Legal representative of the business * AUTHORISED_SIGNATORY - Authorised signatory * ULTIMATE_BENEFICIAL_OWNER - Ultimate beneficial owner * CONTRACTING_EXECUTIVE - Contracting executive * TRADER - Trader * SOLE_TRADER - Sole trader

## Response `200`

Role created.

- union — Response schema for creating a role.
  - object — Role assignment for an account group.
    - `id` string, uuid, required — Unique identifier for the role.
    - `created_at` string, date-time, required — Date and time when the resource was created. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
    - `updated_at` string, date-time, required — Date and time when the resource was last updated. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
    - `user_id` string, uuid, required — User unique identifier.
    - `entity_type` string, required — Entity type must be ACCOUNT_GROUP
    - `entity_id` string, uuid, required — Unique identifier of the entity a role is attached to.
    - `role_type` 'GUARDIAN', required — Role type for account group.
    - `custody_type` 'SOLE_CUSTODY' | 'JOINT_CUSTODY' — Custody type for child account groups. * SOLE_CUSTODY - Single guardian * JOINT_CUSTODY - Multiple guardians required
    - `status` 'PENDING' | 'ACTIVE' | 'DEACTIVATED', required — Status of the role assignment. * PENDING - Role is not activated * ACTIVE - Role is active * DEACTIVATED - Role is deactivated
  - object — Role assignment for a business entity.
    - `id` string, uuid, required — Unique identifier for the role.
    - `created_at` string, date-time, required — Date and time when the resource was created. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
    - `updated_at` string, date-time, required — Date and time when the resource was last updated. [RFC 3339-5](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), [ISO8601 UTC](https://www.iso.org/iso-8601-date-and-time-format.html)
    - `user_id` string, uuid, required — User unique identifier.
    - `entity_type` string, required — Entity type must be BUSINESS
    - `entity_id` string, uuid, required — Unique identifier of the entity a role is attached to.
    - `role_type` 'LEGAL_REPRESENTATIVE' | 'AUTHORISED_SIGNATORY' | 'ULTIMATE_BENEFICIAL_OWNER' | 'CONTRACTING_EXECUTIVE' | 'TRADER' | 'SOLE_TRADER', required — Role type for business entity. * LEGAL_REPRESENTATIVE - Legal representative of the business * AUTHORISED_SIGNATORY - Authorised signatory * ULTIMATE_BENEFICIAL_OWNER - Ultimate beneficial owner * CONTRACTING_EXECUTIVE - Contracting executive * TRADER - Trader * SOLE_TRADER - Sole trader
    - `status` 'PENDING' | 'ACTIVE' | 'DEACTIVATED', required — Status of the role assignment. * PENDING - Role is not activated * ACTIVE - Role is active * DEACTIVATED - Role is deactivated

## Other responses

- `400` — Bad Request. The incoming request had a malformed parameter/object.
- `401` — Unauthorized. The caller has not been authenticated.
- `403` — Forbidden. The caller has been authenticated but is not allowed to take the requested action.
- `406` — Not Acceptable. The resource does not have a current representation that would be acceptable to the user agent. "Accept" header defined unsupported value.
- `429` — Too Many Requests. The caller has exceeded their quota for the time period and has been throttled.
- `500` — Internal Server Error. The service encountered an unexpected error.
- `503` — Service Unavailable. The service handling for this request cannot be reached at this time.
- `504` — Gateway Timeout. The service gateway has reached its internal timeout.

---

[API](https://skmtc.net/upvest/apis/upvest-investment-api.md) · [All operations](https://skmtc.net/upvest/apis/upvest-investment-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/upvest/upvest-investment-api/revisions/2c6bc192bc09/schema)
