> 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.

# Create position

POST https://example.gitiho.com/api/position
Content-Type: multipart/form-data

Tạo mới một chức vụ. Nếu tên chức vụ đã tồn tại nhưng đang ở trạng thái Inactive, hệ thống sẽ tự động phục hồi.

**THAM SỐ TRUYỀN QUA BODY (Raw JSON):**

| Tên | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- |
| **name** | `string` | Có | Tên chức vụ cần tạo mới. |

**VÍ DỤ BODY:** `{"name": "Trưởng nhóm Marketing"}`

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/position:
    post:
      operationId: Create position
      summary: Create position
      description: >-
        Tạo mới một chức vụ. Nếu tên chức vụ đã tồn tại nhưng đang ở trạng thái
        Inactive, hệ thống sẽ tự động phục hồi.


        **THAM SỐ TRUYỀN QUA BODY (Raw JSON):**


        | Tên | Kiểu | Bắt buộc | Mô tả |

        | --- | --- | --- | --- |

        | **name** | `string` | Có | Tên chức vụ cần tạo mới. |


        **VÍ DỤ BODY:** `{"name": "Trưởng nhóm Marketing"}`
      tags:
        - positionQuảnLyChứcVụ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/type_admin/positionQuảnLyChứcVụ:CreatePositionPositionQuảnLyChứcVụResponse
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
              required:
                - name
servers:
  - url: https://example.gitiho.com
    description: Default
components:
  schemas:
    type_admin/positionQuảnLyChứcVụ:CreatePositionPositionQuả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: CreatePositionPositionQuảnLyChứcVụResponseData
    type_admin/positionQuảnLyChứcVụ:CreatePositionPositionQuảnLyChứcVụResponse:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/type_admin/positionQuảnLyChứcVụ:CreatePositionPositionQuảnLyChứcVụResponseData
        status:
          type: string
      required:
        - data
        - status
      title: CreatePositionPositionQuảnLyChứcVụResponse

```

## Examples

**Request**

```json
{
  "name": "name"
}
```

**Response**

```json
{
  "data": {
    "id": 41,
    "name": "Phòng ban toạ qua API",
    "created_at": "2025-10-27 11:28:26",
    "updated_at": "2025-10-27 11:28:26"
  },
  "status": "success"
}
```

**SDK Code**

```python
import requests

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

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nname\r\n-----011000010111000001101001--\r\n"
headers = {"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://example.gitiho.com/api/position';
const form = new FormData();
form.append('name', 'name');

const options = {method: 'POST'};

options.body = form;

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"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nname\r\n-----011000010111000001101001--\r\n")

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

	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")

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

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nname\r\n-----011000010111000001101001--\r\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.post("https://example.gitiho.com/api/position")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nname\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://example.gitiho.com/api/position', [
  'multipart' => [
    [
        'name' => 'name',
        'contents' => 'name'
    ]
  ]
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://example.gitiho.com/api/position");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nname\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation
let parameters = [
  [
    "name": "name",
    "value": "name"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://example.gitiho.com/api/position")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```