---
title: "Assign users to access group"
method: POST
path: "/access-groups/{accessGroupId}/users"
tags: ["users"]
---

# Assign users to access group

`POST /access-groups/{accessGroupId}/users`

## Request

- Base URL: `https://api.smartrecruiters.com/user-api/v201804`
- URL: `https://api.smartrecruiters.com/user-api/v201804/access-groups/{accessGroupId}/users`
- Auth: one of:
  - API key in header `x-smarttoken`
  - OAuth 2
    - Authorization code: `https://www.smartrecruiters.com/identity/oauth/allow`
    - Token URL: `https://api.smartrecruiters.com/identity/oauth/token` scopes: `users_manage`

## Request body

- UserId[]

## Response `201`

Users successfully added to access group

- AccessGroups
  - `content` AccessGroup[]
    - `id` string
    - `name` string

## Other responses

- `400`: Cannot assigned user to access group with codes * **ACCESS_GROUP_NOT_ALLOWED_FOR_USER** when access groups are not allowed for user
- `403`: with code * **PERMISSION_DENIED** Not permitted to manage access groups
- `404`: User or access group not found with codes * **USER_NOT_FOUND** when user with given id doesn't exist * **ACCESS_GROUP_NOT_FOUND** when access group with given id doesn't exist

---

[API](https://skmtc.dev/smartrecruiters/apis/users-api.md) - [All operations](https://skmtc.dev/smartrecruiters/apis/users-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smartrecruiters/apis/users-api/revisions/22cf1eb7cae7?raw)
