Ana içeriğe geç

Authorities Create Endpoint

Bu sayfa, authorities kaydı oluşturmak için düşünülen endpoint sözleşmesini tanımlar.

Önerilen Route

POST /v1/admin/authorities

Domain Notları

  • aynı device_id + user_id çifti ikinci kez oluşturulamaz
  • owner ataması normal create ile verilmemelidir
  • owner ilişkisi sistem kontrollü kurulum veya transfer-owner akışı ile yönetilmelidir
  • ai_agent kullanıcıları için authority kaydı açılmaz

Örnek Request

{
"device_id": "46000000C47CA670",
"user_id": 2,
"assigned_by": 1
}

Örnek Response

{
"success": true,
"data": {
"id": 44,
"device_id": "46000000C47CA670",
"user_id": 2,
"owner": false,
"is_active": true
},
"meta": {
"request_id": "req_authority_create_001"
}
}

Hata Örnekleri

  • 409 AUTHORITY_ALREADY_EXISTS
  • 422 OWNER_ASSIGNMENT_REQUIRES_SYSTEM_FLOW
  • 422 AI_AGENT_CANNOT_HAVE_AUTHORITY