Alt Kullanıcılar
Bir müşterinin paneline sınırlı izinlerle giren alt hesapları yöneten beş uç.
Genel Bakış
Alt kullanıcı, bir müşterinin paneline sınırlı izinlerle giren ikinci bir kişidir: muhasebeci yalnız faturaları, teknik ekip yalnız hizmetleri görür.
İzin kümesi sabittir ve on değerden oluşur. Hesap sahibinin profili, fatura iletişim kişileri ve e-posta geçmişi devredilemez; bunlar yalnız hesabın kendisine açıktır.
Referans
Alt Kullanıcıları Listeleme
Müşterinin tüm alt kullanıcılarını döndürür.
pending davet bekliyor, active etkin, inactive pasif.0.curl 'https://panel.ornek.com/api/v1/admin/clients/42/subusers' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/subusers', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/subusers');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetClientSubusers(['id' => 42]);{
"data": [
{
"id": 4,
"email": "[email protected]",
"label": "Accounting",
"status": "active",
"permissions": ["view_invoices", "view_services"],
"email_notifications": 0,
"sms_notifications": 0,
"linked_user_id": 31,
"linked_user_name": "John Doe",
"invited_at": "2026-06-01 10:00:00",
"accepted_at": "2026-06-02 09:12:00",
"created_at": "2026-06-01 10:00:00"
}
]
}Alt Kullanıcı Ekleme
Müşteriye alt kullanıcı ekler. Kayıt pending durumunda başlar.
curl -X POST 'https://panel.ornek.com/api/v1/admin/clients/42/subusers' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","label":"Accounting","permissions":["view_invoices","view_services"]}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/subusers', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: '[email protected]',
label: 'Accounting',
permissions: ['view_invoices', 'view_services'],
send_invite: true,
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/subusers');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'label' => 'Accounting',
'permissions' => ['view_invoices', 'view_services'],
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->CreateClientSubuser([
'id' => 42,
'email' => '[email protected]',
'permissions' => ['view_invoices', 'view_services'],
]);
// Yazilan izinleri yanittan okuyun: taninmayan anahtar sessizce dusurulur.
$granted = $response['data']['permissions'];Alt Kullanıcıyı Güncelleme
Gönderdiğiniz alanları günceller, geri kalanına dokunmaz.
curl -X PATCH 'https://panel.ornek.com/api/v1/admin/clients/42/subusers/5' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"status":"active"}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/subusers/5', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ status: 'active' }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/subusers/5');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['status' => 'active']),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->UpdateClientSubuser([
'id' => 42,
'subuser_id' => 5,
'status' => 'active',
]);
// Ilk kez aktif yapmak, e-posta eslesiyorsa gercek bir hesaba baglar.
$linkedTo = $response['data']['linked_user_id'];Daveti Yeniden Gönderme
Daveti bekleyen bir alt kullanıcıya daveti tekrar gönderir.
curl -X POST 'https://panel.ornek.com/api/v1/admin/clients/42/subusers/5/resend-invite' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/subusers/5/resend-invite', {
method: 'POST',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/subusers/5/resend-invite');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->ResendClientSubuserInvite([
'id' => 42,
'subuser_id' => 5,
]);Alt Kullanıcıyı Silme
Alt kullanıcıyı siler. Bağlı olduğu gerçek müşteri hesabı bundan etkilenmez.
curl -X DELETE 'https://panel.ornek.com/api/v1/admin/clients/42/subusers/5' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/subusers/5', {
method: 'DELETE',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/subusers/5');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->DeleteClientSubuser([
'id' => 42,
'subuser_id' => 5,
]);Tuzaklar
İzin listesi kapalı bir kümedir. Onda olmayan bir anahtar gönderirseniz hata almazsınız; anahtar atılır ve kayıt eksik izinle yazılır. Yazma isteğinden dönen permissions alanını okuyup ne verildiğini doğrulayın.
Bir alt kullanıcı ilk kez active yapıldığında, e-postası mevcut bir müşteri hesabıyla eşleşiyorsa o hesaba bağlanır. Bu, bir kişinin kendi hesabıyla girip başka bir müşterinin paneline geçebilmesi demektir; durumu değiştirmeden önce e-postanın kime ait olduğunu bilin.
Yeniden gönderme ucu yalnız pending durumundaki kayıtlarda çalışır. Etkin bir alt kullanıcıya davet göndermek istiyorsanız önce durumu geri çevirmeniz gerekir.
İlgili Makaleler
Geri bildiriminiz için teşekkürler!
Yukarıda bulamadığınız her şey için destek ekibimiz her zaman yanınızda.