> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.gitiho.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.gitiho.com/_mcp/server.

# Update position

PUT https://example.gitiho.com/api/position/24
Content-Type: application/json

Cập nhật chức vụ đã tồn tại

**Queries:**

| Query | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- |
| **id** | Integer | Có | Id của chức vụ cần cập nhật |

Params body (json)

| Tên | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- |
| name | String(255) | Có | Tên mới của chức vụ |

**Response: Xem example response**

Reference: https://developer.gitiho.com/gitiho-business-api/admin/position-quản-ly-chức-vụ/update-position

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/position/24:
    put:
      operationId: Update position
      summary: Update position
      description: |-
        Cập nhật chức vụ đã tồn tại

        **Queries:**

        | Query | Kiểu | Bắt buộc | Mô tả |
        | --- | --- | --- | --- |
        | **id** | Integer | Có | Id của chức vụ cần cập nhật |

        Params body (json)

        | Tên | Kiểu | Bắt buộc | Mô tả |
        | --- | --- | --- | --- |
        | name | String(255) | Có | Tên mới của chức vụ |

        **Response: Xem example response**
      tags:
        - positionQuảnLyChứcVụ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/type_admin/positionQuảnLyChứcVụ:UpdatePositionPositionQuảnLyChứcVụResponse
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
                - name
servers:
  - url: https://example.gitiho.com
    description: Default
components:
  schemas:
    type_admin/positionQuảnLyChứcVụ:UpdatePositionPositionQuảnLyChứcVụResponseData:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - created_at
        - updated_at
      title: UpdatePositionPositionQuảnLyChứcVụResponseData
    type_admin/positionQuảnLyChứcVụ:UpdatePositionPositionQuảnLyChứcVụResponse:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/type_admin/positionQuảnLyChứcVụ:UpdatePositionPositionQuảnLyChứcVụResponseData
        status:
          type: string
      required:
        - data
        - status
      title: UpdatePositionPositionQuảnLyChứcVụResponse

```

## Examples

**Request**

```json
{
  "name": "Tên chức vụ update"
}
```

**Response**

```json
{
  "data": {
    "id": 24,
    "name": "Tên chức vụ update",
    "created_at": "2023-09-18 10:50:29",
    "updated_at": "2025-10-27 11:44:51"
  },
  "status": "success"
}
```

**SDK Code**

```python
import requests

url = "https://example.gitiho.com/api/position/24"

payload = { "name": "Tên chức vụ update" }
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://example.gitiho.com/api/position/24';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"Tên chức vụ update"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://example.gitiho.com/api/position/24"

	payload := strings.NewReader("{\n  \"name\": \"Tên chức vụ update\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://example.gitiho.com/api/position/24")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Tên chức vụ update\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://example.gitiho.com/api/position/24")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Tên chức vụ update\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://example.gitiho.com/api/position/24', [
  'body' => '{
  "name": "Tên chức vụ update"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://example.gitiho.com/api/position/24");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Tên chức vụ update\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["name": "Tên chức vụ update"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://example.gitiho.com/api/position/24")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```