Position
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
GET /position/get-by-id/{id}
Get position using its _id
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
name | string | |
created_at | string | |
updated_at | string | |
is_deleted | boolean | |
completely_deleted | boolean | |
sections | object[] | |
sections[]._id | string | |
sections[].is_deleted | boolean | |
sections[].completely_deleted | boolean | |
sections[].name | string | |
organizations | object[] | |
organizations[]._id | string | |
organizations[].organization_id | string | |
organizations[].max_employee_count | number | |
organizations[].is_available | boolean |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"created_at": "string",
"updated_at": "string",
"is_deleted": false,
"completely_deleted": false,
"sections": [
{
"_id": "string",
"is_deleted": false,
"completely_deleted": false,
"name": "string"
}
],
"organizations": [
{
"_id": "string",
"organization_id": "string",
"max_employee_count": 0,
"is_available": false
}
]
},
"time": "2025-05-01T12:00:00Z"
}POST /position/get-paging
Get positions by paging
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
search | string | Yo‘q | |
section_id | string | Yo‘q | |
organization_id | string | Yo‘q | |
accessed_organization_ids | string[] | Yo‘q |
{
"page": 1,
"limit": 20,
"search": "string",
"section_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"organization_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"accessed_organization_ids": [
"63f8b0c4e4b0d3a2f8e4b0c4"
]
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
name | string | |
created_at | string | |
updated_at | string | |
max_employee_count | number | |
employee_count | number |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"name": "string",
"created_at": "string",
"updated_at": "string",
"max_employee_count": 0,
"employee_count": 0
}
]
},
"time": "2025-05-01T12:00:00Z"
}POST /position/create
Create an HR position. name, section_ids (at least one existing section) and organizations (at least one entry) are required. Returns the created position aggregated with its sections. Fails with 400 if the name already exists in the account, or if a referenced section or organization does not exist.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | Position name (required, 3–100 characters). Must be unique within the account. |
section_ids | string[] | Ha | Sections (departments) this position belongs to (required, at least one). Every id must reference an existing, non-deleted section. |
organizations | object[] | Ha | Per-organization availability of the position (required, at least one). |
organizations[].organization_id | string | Ha | Organization the position is opened in (required). Must exist. |
organizations[].is_available | boolean | Ha | Whether the position is currently open for hiring in this organization (required). A position whose every organization entry is is_available=false is auto soft-deleted by the backend. |
organizations[].max_employee_count | number | Yo‘q | Headcount cap for this organization. Defaults to 0 (uncapped) when omitted. |
{
"name": "Sales manager",
"section_ids": [
"63f8b0c4e4b0d3a2f8e4b0c4"
],
"organizations": [
{
"organization_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"is_available": false,
"max_employee_count": 0
}
]
}Javob
Javob tuzilishi quyidagi bilan bir xil: GET /position/get-by-id/{id}.
PUT /position/update/{id}
Update an HR position by ObjectId. name, section_ids and organizations are all required — this is a full replacement of those fields, not a patch. The organizations named in the payload are pulled and re-pushed; organizations not named keep their existing entry. Returns the updated position aggregated with its sections.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Position ObjectId to update |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | Updated position name (required, 3–100 characters). |
section_ids | string[] | Ha | Sections (departments) this position belongs to (required, at least one). Every id must reference an existing, non-deleted section. |
organizations | object[] | Ha | Full replacement set of per-organization entries (required, at least one). The entries for the organizations named here are removed and re-added, so send every organization the position should remain open in — an organization left out keeps its previous entry untouched. |
organizations[].organization_id | string | Ha | Organization the position is opened in (required). Must exist. |
organizations[].is_available | boolean | Ha | Whether the position is currently open for hiring in this organization (required). A position whose every organization entry is is_available=false is auto soft-deleted by the backend. |
organizations[].max_employee_count | number | Yo‘q | Headcount cap for this organization. Defaults to 0 (uncapped) when omitted. |
{
"name": "Sales manager",
"section_ids": [
"63f8b0c4e4b0d3a2f8e4b0c4"
],
"organizations": [
{
"organization_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"is_available": false,
"max_employee_count": 0
}
]
}Javob
Javob tuzilishi quyidagi bilan bir xil: GET /position/get-by-id/{id}.
DELETE /position/delete/{id}
Soft-delete an HR position by ObjectId (sets is_deleted=true). Fails with 400 when at least one employee still holds the position — the error payload lists the blocking employees. Deleting an already-deleted position is a no-op.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Position ObjectId to delete |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "63f8b0c4e4b0d3a2f8e4b0c4",
"time": "2025-05-01T12:00:00Z"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.