---
title: "Bayi — API başvurusu"
description: "Bayi hesapları kendi uç-müşterilerini yönetir, hizmet atar, uç-müşteri anahtarı üretir ve kullanım raporu okur. Hizmetler bayinin hesabında kalır ve b"
url: https://www.gyrohosting.com/developers/tr/api/reseller.html
language: tr
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Bayi

Bayi hesapları kendi uç-müşterilerini yönetir, hizmet atar, uç-müşteri anahtarı üretir ve kullanım raporu okur. Hizmetler bayinin hesabında kalır ve bayi indirimiyle fiyatlanır.

Base URL: `https://www.gyrohosting.com/api/v1/client` · OpenAPI: https://www.gyrohosting.com/developers/openapi.json


## GET /cloud/reseller/settings

**Bayi ayarları** · operationId `getResellerSettings` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/getResellerSettings.json




### Yanıtlar

- **200**: Settings
- **403**: Key lacks the scope, IP not allowed, or feature disabled

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/settings' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller setting get
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/reseller/settings", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/settings", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## PUT /cloud/reseller/settings

**Bayi ayarlarını kaydet (beyaz etiket)** · operationId `saveResellerSettings` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/saveResellerSettings.json




### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `white_label` | boolean |  |

### Yanıtlar

- **200**: Settings
- **403**: Key lacks the scope, IP not allowed, or feature disabled

### Örnekler

```bash
curl -s -X PUT 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/settings' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"white_label": true}'
```
```bash
gyro reseller setting set --help    # tüm seçenekler
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/reseller/settings", headers=h, json={"white_label": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/settings", {
  method: "PUT",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"white_label": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/reseller/report

**Uç-müşteri başına kullanım ve fatura raporu** · operationId `resellerReport` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/resellerReport.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `from` | query | string |  |
| `to` | query | string |  |

### Yanıtlar

- **200**: Report
- **403**: Key lacks the scope, IP not allowed, or feature disabled

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/report' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller report get
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/reseller/report", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/report", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/reseller/assign

**Hizmeti uç-müşteriye ata (customer_id 0 = atamayı kaldır)** · operationId `assignService` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/assignService.json




### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `service_id` (zorunlu) | integer |  |
| `customer_id` (zorunlu) | integer |  |

### Yanıtlar

- **200**: Assignment
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/assign' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service_id": 1, "customer_id": 1}'
```
```bash
gyro reseller assign --help    # tüm seçenekler
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/reseller/assign", headers=h, json={"service_id": 1, "customer_id": 1}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/assign", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"service_id": 1, "customer_id": 1}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/reseller/customers

**Uç-müşterileri listele** · operationId `listResellerCustomers` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listResellerCustomers.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `external_ref` | query | string |  |
| `page` | query | integer |  |
| `limit` | query | integer |  |

### Yanıtlar

- **200**: Customers
- **403**: Key lacks the scope, IP not allowed, or feature disabled

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller customer list
```
```hcl
# kaynak gyro_reseller_customer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/reseller_customer
# Reseller (bayi) accounts only
resource "gyro_reseller_customer" "acme" {
  name         = "Acme Ltd"
  external_ref = "acme-001"
  allow_order  = true # Acme's keys may order servers, paid from YOUR balance at your discount
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/reseller/customers

**Uç-müşteri oluştur** · operationId `createResellerCustomer` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/createResellerCustomer.json




### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `name` | string |  |
| `email` | string |  |
| `external_ref` | string | Your own customer id (unique per reseller) |
| `note` | string |  |
| `status` | string (active, suspended) |  |
| `allow_order` | boolean | May this customer's keys order servers (paid from YOUR balance)? |

### Yanıtlar

- **201**: Created
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Ltd", "external_ref": "acme-001", "allow_order": false}'
```
```bash
gyro reseller customer create --help    # tüm seçenekler
```
```hcl
# kaynak gyro_reseller_customer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/reseller_customer
# Reseller (bayi) accounts only
resource "gyro_reseller_customer" "acme" {
  name         = "Acme Ltd"
  external_ref = "acme-001"
  allow_order  = true # Acme's keys may order servers, paid from YOUR balance at your discount
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers", headers=h, json={"name": "Acme Ltd", "external_ref": "acme-001", "allow_order": False}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "Acme Ltd", "external_ref": "acme-001", "allow_order": false}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/reseller/customers/{id}

**Uç-müşteriyi getir** · operationId `getResellerCustomer` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/getResellerCustomer.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Customer
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller customer get 12345
```
```hcl
# kaynak gyro_reseller_customer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/reseller_customer
# Reseller (bayi) accounts only
resource "gyro_reseller_customer" "acme" {
  name         = "Acme Ltd"
  external_ref = "acme-001"
  allow_order  = true # Acme's keys may order servers, paid from YOUR balance at your discount
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## PATCH /cloud/reseller/customers/{id}

**Uç-müşteriyi güncelle (askıya alma = anahtarları çalışmaz)** · operationId `updateResellerCustomer` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/updateResellerCustomer.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `name` | string |  |
| `email` | string |  |
| `external_ref` | string | Your own customer id (unique per reseller) |
| `note` | string |  |
| `status` | string (active, suspended) |  |
| `allow_order` | boolean | May this customer's keys order servers (paid from YOUR balance)? |

### Yanıtlar

- **200**: Customer
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s -X PATCH 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "email": "string", "external_ref": "string", "note": "string", "status": "active", "allow_order": true}'
```
```bash
gyro reseller customer update 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_reseller_customer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/reseller_customer
# Reseller (bayi) accounts only
resource "gyro_reseller_customer" "acme" {
  name         = "Acme Ltd"
  external_ref = "acme-001"
  allow_order  = true # Acme's keys may order servers, paid from YOUR balance at your discount
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.patch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345", headers=h, json={"name": "string", "email": "string", "external_ref": "string", "note": "string", "status": "active", "allow_order": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345", {
  method: "PATCH",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "string", "email": "string", "external_ref": "string", "note": "string", "status": "active", "allow_order": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/reseller/customers/{id}

**Uç-müşteriyi sil (anahtarlar ve webhook'lar iptal, hizmet ataması kalkar)** · operationId `deleteResellerCustomer` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/deleteResellerCustomer.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |
| `confirm` (zorunlu) | query | boolean |  |

### Yanıtlar

- **200**: Deleted
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller customer delete 12345
```
```hcl
# kaynak gyro_reseller_customer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/reseller_customer
# Reseller (bayi) accounts only
resource "gyro_reseller_customer" "acme" {
  name         = "Acme Ltd"
  external_ref = "acme-001"
  allow_order  = true # Acme's keys may order servers, paid from YOUR balance at your discount
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/reseller/customers/{id}/keys

**Uç-müşterinin anahtarlarını listele** · operationId `listResellerCustomerKeys` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listResellerCustomerKeys.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Keys
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller customer key list 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/reseller/customers/{id}/keys

**Uç-müşteri için anahtar üret (token bir kez döner)** · operationId `createResellerCustomerKey` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/createResellerCustomerKey.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `name` (zorunlu) | string |  |
| `scopes` | array<string (cloud_read, cloud_write, cloud_order, cloud_delete, services_read, services_write, webhooks)> |  |
| `services` | array<integer> | Optional service allow list |
| `actions` | array<string> | Optional action allow list: server actions (reboot) or tool:action / tool:* / method:name |
| `ips` | array<string> |  |
| `rate_limit` | integer | Requests per minute (<= your own limit; 0 = default) |

### Yanıtlar

- **201**: Created
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "scopes": ["cloud_read"], "services": [1], "actions": ["string"], "ips": ["string"], "rate_limit": 1}'
```
```bash
gyro reseller customer key create 12345 --help    # tüm seçenekler
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys", headers=h, json={"name": "string", "scopes": ["cloud_read"], "services": [1], "actions": ["string"], "ips": ["string"], "rate_limit": 1}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "string", "scopes": ["cloud_read"], "services": [1], "actions": ["string"], "ips": ["string"], "rate_limit": 1}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/reseller/customers/{id}/keys/{kid}

**Uç-müşteri anahtarını iptal et** · operationId `deleteResellerCustomerKey` · scope `reseller` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/deleteResellerCustomerKey.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |
| `kid` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Deleted
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys/1' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro reseller customer key delete 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/reseller/customers/12345/keys/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```
