---
title: "Grant a role at a scope."
method: POST
path: "/v1/role_assignments"
tags: ["Roles"]
---

# Grant a role at a scope.

`POST /v1/role_assignments`

## Request

- Base URL: `https://api.yardstick.team`
- URL: `https://api.yardstick.team/v1/role_assignments`
- Auth: HTTP bearer

## Request body

- object
  - `user` string, required
  - `role` 'admin' | 'recruiter' | 'department_lead' | 'hiring_manager', required
  - `scope` union, required
    - object
      - `type` 'org', required
      - `id` string, required
    - object
      - `type` 'department', required
      - `id` string, required
    - object
      - `type` 'job', required
      - `id` string, required

## Response `201`

Role assignment created.

- RoleAssignment
  - `id` string, required
  - `user` string, required
  - `role` 'admin' | 'recruiter' | 'department_lead' | 'hiring_manager', required
  - `scope` union, required
    - object
      - `type` 'org', required
      - `id` string, required
    - object
      - `type` 'department', required
      - `id` string, required
    - object
      - `type` 'job', required
      - `id` string, required
  - `created_at` string, date-time, required
  - `created_by` string, nullable

## Other responses

- `400` (unresolved $ref)
- `401` (unresolved $ref)
- `403` (unresolved $ref)
- `422` (unresolved $ref)

---

[API](https://skmtc.dev/yardstick/apis/yardstick-public-api.md) · [All operations](https://skmtc.dev/yardstick/apis/yardstick-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yardstick/apis/yardstick-public-api/revisions/35b5a6e88b35?raw)
