---
title: "Update My Role"
method: PATCH
path: "/api/roles/{role_id}"
tags: ["roles"]
---

# Update My Role

`PATCH /api/roles/{role_id}`

## Request

- Base URL: `https://api.parlel.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.parlel.com/api/roles/{role_id}`
- Auth: none declared

Change one of the caller's own roles. Absent fields are left alone.

## Editing an open role is allowed, and is not a loophole

A live role can be edited: a salary band moves, a location changes, the title
was wrong. The alternative -- freeze on publish, force a close-and-repost --
would break every link to the role in order to fix a typo in it, which is the
outcome the whole closed-stays-readable rule exists to avoid.

What it cannot do is change ``status``. Publishing and closing are their own
endpoints because each has a precondition and a timestamp that is written
once, and a settable status field would be a second path to both that happened
to skip them.

## Path parameters

- `role_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- RolePatch: A partial update. ``PATCH`` semantics: absent means UNCHANGED. The opposite of ``PUT /api/company`` and ``PUT /api/profile``, and the difference is not an inconsistency -- it follows from what the client is. Those two are one form holding one object, so "the body is the new state" is the honest description. A company may hold two hundred roles and edits them from a list, one field at a time; a PUT there would mean every "close the salary range" interaction has to resend the entire brief, and the first client that forgets a field silently wipes it. Absent versus null is therefore load-bearing, and it is read off ``model_fields_set`` rather than by a sentinel value: absent means untouched, an explicit ``null`` means cleared. Every field is inherited from ``RoleCreate``, including its validators, so the two bodies cannot drift -- only the requiredness changes. ``status`` is absent here too. Publishing and closing have preconditions and timestamps, and a settable status field would route around both.
  - `title` string, nullable
  - `description` string, nullable
  - `location` string, nullable
  - `remote` 'onsite' | 'hybrid' | 'remote', nullable
  - `employment_type` 'full_time' | 'part_time' | 'contract' | 'internship', nullable
  - `seniority` 'intern' | 'junior' | 'mid' | 'senior' | 'staff' | 'principal' | 'exec', nullable
  - `comp_min` integer, nullable
  - `comp_max` integer, nullable
  - `comp_currency` string, nullable
  - `comp_period` 'year' | 'day' | 'hour', nullable
  - `apply_url` string, nullable: must be a http:// or https:// URL with a hostname and no credentials
  - `skills` string[], nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/parlel/apis/parlel-api.md) · [All operations](https://skmtc.dev/parlel/apis/parlel-api/llms.txt) · [OpenAPI document](https://skmtc.dev/parlel/apis/parlel-api/revisions/4d41a8f5cfc9?raw)
