> ## Documentation Index
> Fetch the complete documentation index at: https://docs.muhasip.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Etiketler kaydı oluşturun

> Firma kapsamında yeni kayıt oluşturur.

## Ne yapar?

Firma kapsamında yeni kayıt oluşturur. İlişkili kullanıcı, proje, durum, etiket, cari ve işlem kimlikleri firmada doğrulanır. Tekrar POST isteği yeni kayıt oluşturabilir.

## Ön koşullar ve izin

Etkin API anahtarı ve `muhasip:todo:write` izni gerekir.

İlişkili kayıtlar aynı firmaya ait olmalıdır. Erişim ayarları için [kimlik ve izinler](/baslangic/kimlik-ve-izinler) rehberini inceleyin.

[İstek ve cevap şemalarını indirin](/openapi.json).

## İstek örnekleri

Örnekler temsilîdir. Kimlikleri, belge tarihlerini ve iş verisini kendi yetkili kayıtlarınızla değiştirin. Node.js örnekleri **Node.js 20 veya üzeri** içindir; PHP örnekleri cURL uzantısını kullanır. Hiçbiri otomatik tekrar yapmaz.

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST 'https://api.muhasip.pro/apps/todo/labels' \
    --user "$MUHASIP_API_USER_ID:$MUHASIP_API_SECRET" \
    --header 'Accept: */*' \
    --header 'Content-Type: application/json' \
    --data-binary @- <<'JSON'
  {
    "title": "Ödeme takibi"
  }
  JSON
  ```

  ```php PHP theme={null}
  <?php
  $apiUserId = getenv('MUHASIP_API_USER_ID');
  $secretKey = getenv('MUHASIP_API_SECRET');
  if (!$apiUserId || !$secretKey) {
      throw new RuntimeException('API kimlik bilgileri eksik.');
  }
  $headers = ['Accept: */*', 'Content-Type: application/json'];
  $body = <<<'JSON'
  {
    "title": "Ödeme takibi"
  }
  JSON;
  $handle = curl_init('https://api.muhasip.pro/apps/todo/labels');
  curl_setopt_array($handle, [
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_FOLLOWLOCATION => false,
      CURLOPT_HTTPHEADER => $headers,
      CURLOPT_CONNECTTIMEOUT => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
      CURLOPT_USERPWD => $apiUserId . ':' . $secretKey,
      CURLOPT_POSTFIELDS => $body,
  ]);
  $response = curl_exec($handle);
  $httpStatus = curl_getinfo($handle, CURLINFO_RESPONSE_CODE);
  curl_close($handle);
  if ($response === false) {
      throw new RuntimeException('Bağlantı tamamlanamadı; mali işlemi otomatik tekrarlamayın.');
  }
  if ($httpStatus < 200 || $httpStatus >= 300) {
      throw new RuntimeException('HTTP ' . $httpStatus . '; kaynak hata açıklamasını değerlendirin.');
  }
  // $response gövdesini bu işlemin cevap biçimine göre işleyin; ham cevabı loglamayın.
  echo 'HTTP ' . $httpStatus . PHP_EOL;
  ```

  ```javascript Node.js theme={null}
  async function main() {
    const apiUserId = process.env.MUHASIP_API_USER_ID
    const secretKey = process.env.MUHASIP_API_SECRET
    if (!apiUserId || !secretKey) throw new Error("API kimlik bilgileri eksik.")
    const response = await fetch("https://api.muhasip.pro/apps/todo/labels", {
      method: "POST",
      redirect: "manual",
      headers: {
        Accept: "*/*",
        Authorization: "Basic " + Buffer.from(`${apiUserId}:${secretKey}`).toString("base64"),
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        title: "Ödeme takibi"
      }),
      signal: AbortSignal.timeout(30000)
    })
    const data = await response.arrayBuffer()
    if (!response.ok) throw new Error(`HTTP ${response.status}; kaynak hata açıklamasını değerlendirin.`)
    // data gövdesini bu işlemin cevap biçimine göre işleyin; ham cevabı loglamayın.
    console.log("HTTP", response.status)
  }

  main().catch(() => {
    console.error("İstek tamamlanamadı; mali işlemi otomatik tekrarlamayın.")
    process.exitCode = 1
  })
  ```
</CodeGroup>

## Cevabı değerlendirin

Önce HTTP durumunu, ardından bu kaynağın `status` ve sonuç alanlarını değerlendirin. Bütün uçlar aynı sonuç zarfını veya oluşturma için `201` kodunu kullanmaz.

Temsilî başarılı cevap; gerçek hizmet çağrısından alınmamıştır:

```json theme={null}
{
  "status": true,
  "result": {
    "_id": "64b000000000000000000001",
    "title": "Ödeme takibi"
  }
}
```

## Hata durumunda

| HTTP | Bu işlemde anlamı | İzlenecek adım |
| - | - | - |
| 400 | Alan doğrulaması başarısız. | Alan adını, türünü ve zorunluluğunu kontrol edin; değişmeyen hatalı isteği tekrar göndermeyin. |
| 401 | API kimliği/parolası, erişim süresi veya firma doğrulanamadı. | Anahtar kimliğini, gizli değeri, erişim süresini ve firma erişimini kontrol edin. |
| 403 | API izni, IP kısıtı veya kayıt erişimi uygun değil. | Anahtarın izinlerini, IP kısıtını ve kayıt kimliğini kontrol edin. |
| 429 | Ortak istek sınırı aşıldı; sayısal status alanı kullanılır. | Varsa Retry-After bilgisini değerlendirin. Mali çağrıyı otomatik yeniden göndermeyin. |
| 500 | İşlem gerçekleştirilemedi. | İşlem sonucunu inceleyin; bağlantı/hata oluşması mali etkinin hiç başlamadığını kanıtlamaz. |

Ağ kesintisi, zaman aşımı veya JSON olmayan cevap mali etkinin oluşmadığını kanıtlamaz. Ham istek/cevapları genel loglara yazmayın. [Hata yönetimi](/rehberler/hata-yonetimi)

## Sonraki adım

İlgili liste veya detay çağrısıyla kaydı ve bağlı iş sonucunu doğrulayın. Fiziksel silme, arşiv ve mali iptali ayrı değerlendirin.

[Kaynak akışı](/rehberler/kaynaklar/gorevler) · [İşlem takibi](/rehberler/islem-takibi) · [Kapsam ve sınırlamalar](/rehberler/kapsam-ve-sinirlamalar)


## OpenAPI

````yaml openapi.json POST /apps/todo/labels
openapi: 3.0.3
info:
  title: Muhasip API
  version: 2026-10-18.1
  description: >-
    Fatura, banka, POS ve tahsilat, GİB e-Arşiv, pazaryeri, online işlemler,
    görevler, ajanda ve takvim entegrasyonları. İşlem alanları, izinler, istek
    ve cevap örnekleri ile hata yönetimi.
servers:
  - url: https://api.muhasip.pro
    description: Muhasip API
security:
  - BasicAuth: []
tags:
  - name: Uygulamalar
  - name: Görev yönetimi
  - name: Ajanda ve takvim
  - name: Fatura
    description: Fatura bağlantısı, belge işlemleri ve muhasebeye aktarım.
  - name: Banka
    description: >-
      Banka hesapları, hareketler, mahsup ve mevcut çalışma alanı alt
      kaynakları.
  - name: POS ve tahsilat
    description: POS hesapları, komisyonlar ve tahsilat bağlantıları.
  - name: GİB e-Arşiv
    description: GİB hesabı, sorgu, taslak ve SMS imzalama.
  - name: Pazaryeri
    description: Trendyol bağlantısı ve sipariş aktarımı.
  - name: Online işlemler
    description: Online işlem ekranı yapılandırması.
  - name: İşlem takibi
    description: Mali işlem durumu ve tekrar çağrı makbuzları.
paths:
  /apps/todo/labels:
    post:
      tags:
        - Görev yönetimi
      summary: Etiketler kaydı oluşturun
      description: >-
        Firma kapsamında yeni kayıt oluşturur. İlişkili kullanıcı, proje, durum,
        etiket, cari ve işlem kimlikleri firmada doğrulanır. Tekrar POST isteği
        yeni kayıt oluşturabilir.
      operationId: corePostAppsTodoLabels
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CoreTodoLabelsCreate'
            example:
              title: Ödeme takibi
      responses:
        '200':
          description: İşlem cevabı. Örnek değerler temsilîdir.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  result:
                    $ref: '#/components/schemas/CoreTodoLabelsRecord'
                required:
                  - status
              example:
                status: true
                result:
                  _id: 64b000000000000000000001
                  title: Ödeme takibi
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          description: İşlem gerçekleştirilemedi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: false
                message: İşlem gerçekleştirilemedi.
components:
  schemas:
    CoreTodoLabelsCreate:
      type: object
      properties:
        title:
          type: string
          description: Etiket başlığı.
        color:
          type: string
          description: Renk.
          nullable: true
        icon:
          type: string
          description: İkon.
          nullable: true
        scope:
          type: string
          description: Kapsam; yeni kayıtta task.
          nullable: true
          default: task
      required:
        - title
      additionalProperties: false
    CoreTodoLabelsRecord:
      type: object
      properties:
        _id:
          type: string
          description: Kayıt kimliği.
          pattern: ^[a-fA-F0-9]{24}$
          example: 64b000000000000000000001
        id:
          type: string
          description: Kayıt kimliği.
          pattern: ^[a-fA-F0-9]{24}$
          example: 64b000000000000000000001
        companiesId:
          type: string
          description: Kayıt kimliği.
          pattern: ^[a-fA-F0-9]{24}$
          example: 64b000000000000000000001
        createdDate:
          type: string
          format: date-time
        title:
          type: string
          description: Etiket başlığı.
        color:
          type: string
          description: Renk.
          nullable: true
        icon:
          type: string
          description: İkon.
          nullable: true
        scope:
          type: string
          description: Kapsam; yeni kayıtta task.
          nullable: true
          default: task
      additionalProperties: true
    Error:
      type: object
      properties:
        status:
          type: boolean
        code:
          type: string
        message:
          type: string
        description:
          type: string
        retryable:
          type: boolean
        reviewRequired:
          type: boolean
        operationId:
          type: string
      required:
        - status
      additionalProperties: true
    ValidationErrors:
      type: object
      properties:
        status:
          type: boolean
          enum:
            - false
        result:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              joiType:
                type: string
              path:
                oneOf:
                  - type: string
                  - type: integer
              label:
                type: string
            additionalProperties: true
      required:
        - status
        - result
    RateLimitError:
      type: object
      properties:
        status:
          type: integer
          enum:
            - 429
        error:
          type: string
        message:
          type: string
      required:
        - status
        - error
        - message
  responses:
    ValidationError:
      description: Alan doğrulaması başarısız.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrors'
          example:
            status: false
            result:
              - type: required
                joiType: any.required
                path: title
                label: title
    Unauthorized:
      description: API kimliği/parolası, erişim süresi veya firma doğrulanamadı.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: Basic realm="Muhasip API", charset="UTF-8"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: false
            code: UNAUTHORIZED
            message: API kimlik bilgileri doğrulanamadı.
    Forbidden:
      description: Ürün, IP, modül izni veya kaynak kapsamı uygun değil.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: false
            message: Ürün, IP, modül izni veya kaynak kapsamı uygun değil.
    RateLimited:
      description: Ortak istek sınırı aşıldı; sayısal status alanı kullanılır.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          example:
            status: 429
            error: Too Many Requests
            message: Rate limit exceeded. Please try again later.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Kullanıcı adı apiUserId, parola secretKey. Aktif ve süresi geçmemiş API
        kullanıcısı ve uygun firma gerekir.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.