# Müşteriler

Uç noktalarında kullanılan veri türlerinin ve formatlarının tanımları sayfanın alt kısmında bulunabilir.

## Uç Noktaları

## Müşterileri Getir

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/crm/customers`

Arama kriterlerine uyan müşterileri getirir.

#### Query Parameters

| Name             | Type   | Description                                                                                                                                                                                                                |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name             | string | <p>Müşteri adında aranacak metin.</p><p>Eşleşme, yalnızca müşteri adındaki bir kelime verilen arama metniyle <strong>başlarsa</strong> gerçekleşir.</p><p></p><p>Arama büyük/küçük harfe <strong>duyarsızdır</strong>.</p> |
| limit            | number | Varsayılan değer : 10                                                                                                                                                                                                      |
| skip             | number | Varsayılan değer : 0                                                                                                                                                                                                       |
| includeAllFields | string | <p><code>true</code> : tüm müşteri alanlarını getirir.</p><p><code>false</code> : sadece müşteri ismini getirir.</p><p></p><p>Varsayılan değer : <code>false</code></p>                                                    |
| email            | string | <p>Müşteri veya iletişim posta adreslerinde aranacak metin.</p><p></p><p>Arama büyük/küçük harfe <strong>duyarsızdır</strong>.</p>                                                                                         |

{% tabs %}
{% tab title="200: OK Müşteri listesi" %}

```javascript
Client[]
```

{% endtab %}

{% tab title="403: Forbidden Müşterileri görüntüleme izniniz yok." %}

```javascript
{ code: 4 }
```

{% endtab %}
{% endtabs %}

## Id'e Göre Müşteri Getir

<mark style="color:blue;">`GET`</mark> `https://cubicl.io/api/v1/crm/customers/:id`

**Path Parameters**

| Name                                 | Type   | Description   |
| ------------------------------------ | ------ | ------------- |
| id<mark style="color:red;">\*</mark> | string | Müşteri ID'si |

{% tabs %}
{% tab title="200: OK Müşteri detayları" %}

```javascript
Client
```

{% endtab %}

{% tab title="403: Forbidden Müşterileri görüntüleme izniniz yok." %}

```javascript
{ code: 4 }
```

{% endtab %}
{% endtabs %}

## Müşteri Ekle

<mark style="color:green;">`POST`</mark> `https://cubicl.io/api/v1/crm/customers`

#### Request Body

| Name                                   | Type       | Description                                                                                        |
| -------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark> | string     | Kullanıcı arayüzünde gösterilen ve arama için kullanılan kısa bir ad                               |
| portalCustomerManagerIds               | string\[]  | Bu müşterinin portal kullanıcılarından aktiviteler için bildirim alan kullanıcı ID'lerinin listesi |
| customFields                           | object     | Özel alanların, adlarının ve değerlerin olduğu bir nesne.                                          |
| contacts                               | Contact\[] | İletişim halinde olduğunuz bu müşteri ile çalışan kişilerin listesi.                               |
| phone                                  | string     | Müşterinin telefonu                                                                                |
| email                                  | string     | Müşterinin e-posta adresi                                                                          |
| fullname                               | string     | Müşterinin adı ve soyadı                                                                           |

{% tabs %}
{% tab title="200: OK Client details" %}

```javascript
Client
```

{% endtab %}
{% endtabs %}

## Müşteri Güncelle

<mark style="color:orange;">`PUT`</mark> `https://cubicl.io/api/v1/crm/customers/:id`

#### Path Parameters

| Name                                 | Type   | Description   |
| ------------------------------------ | ------ | ------------- |
| id<mark style="color:red;">\*</mark> | string | Müşteri ID'si |

#### Request Body

| Name                                   | Type       | Description                                                                                        |
| -------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark> | string     | Kullanıcı arayüzünde gösterilen ve arama için kullanılan kısa bir ad                               |
| fullname                               | string     | Müşterinin adı ve soyadı                                                                           |
| email                                  | string     | Müşterinin e-posta adresi                                                                          |
| phone                                  | string     | Müşterinin telefonu                                                                                |
| contacts                               | Contact\[] | İletişim halinde olduğunuz bu müşteri ile çalışan kişilerin listesi.                               |
| customFields                           | object     | Özel alanların adlarının ve değerlerin olduğu bir nesne.                                           |
| portalCustomerManagerIds               | string\[]  | Bu müşterinin portal kullanıcılarından aktiviteler için bildirim alan kullanıcı ID'lerinin listesi |

{% tabs %}
{% tab title="200: OK Müşteri detayları" %}

```javascript
Client
```

{% endtab %}
{% endtabs %}

## Müşteri Sil

<mark style="color:red;">`DELETE`</mark> `https://cubicl.io/api/v1/crm/customers/:id`

#### Path Parameters

| Name                                 | Type   | Description   |
| ------------------------------------ | ------ | ------------- |
| id<mark style="color:red;">\*</mark> | string | Müşteri ID'si |

{% tabs %}
{% tab title="200: OK İçerik yok" %}

{% endtab %}
{% endtabs %}

## Veriler

#### Müşteriler

```typescript
type Client = {
    _id: string;
    // Kullanıcı arayüzünde gösterilen ve arama için kullanılan kısa bir ad.
    name: string;
    phone: string;
    email: string;
    fullname: string;
    // İletişim halinde olduğunuz bu müşteri ile çalışan kişiler.
    contacts: Contact[];
    // Özel alanların, adlarının ve değerlerin olduğu bir nesne.
    // customFields değeri boş olabilir.
    customFields: {
        [fieldId: string]: string | null
    } | null;
    // Bu müşterinin portal kullanıcılarından aktiviteler için bildirim alan
    // kullanıcı ID'lerinin listesi
    portalCustomerManagerIds: string[];
    createdAt: number;
}
```

#### Kişiler

```typescript
type Contact = {
    name: string;
    position: string;
    phone: string;
    email: string;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kilavuz.cubicl.io/api-entegrasyonu/musteriler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
