---
title: "Adds a User or a Group to an Application with a Role"
method: POST
path: "/orgs/{orgId}/apps/{appId}/users"
tags: ["public", "UserRole"]
---

# Adds a User or a Group to an Application with a Role

`POST /orgs/{orgId}/apps/{appId}/users`

## Path parameters

- `orgId` string, required
- `appId` string, required

## Request body

- UserRoleRequest — Holds the mapping of role for a subject on a particular object.
  - `id` string, required — The User or Group Id
  - `role` string, required — The role that this User or Group holds

## Response `200`

The User or Group ID and the associated role.

- UserRoleResponse — UserRole holds the mapping of role to user or group for a particular object.
  - `created_at` string, required — The time the user or the group was first registered with Humanitec
  - `email` string — The email address of the user from the profile
  - `id` string, required — The User or Group Id
  - `invite` string — The status of an invitation (If applicable)
  - `name` string, required — The name the User or Group goes by
  - `role` string, required — The role that this User or Group holds
  - `type` string, required — The type of the account. Could be user, service, group or system
  - `idp_id` string — The IdP id the group is registered for. Empty if user is not a group.

## Other responses

- `400` — The request was invalid. More detail can be found in the error body.
- `403` — Server understands the request but refuses to authorize it.
- `404` — Either the resource or a related resource could not be found. More detail can be found in the error body.

---

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