Ana içeriğe geç

Organizasyon Güncelle

Organizasyon bilgilerini günceller.

Endpoint

PUT /api/v1/organizations/\{uuid\}
PATCH /api/v1/organizations/\{uuid\}

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • organizations.update - Tüm organizasyonları güncelleme
  • organizations.update.own - Sadece kendi organizasyonlarını güncelleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet
Content-Typeapplication/jsonEvet

Path Parameters

ParametreTipZorunluAçıklama
uuidstringEvetOrganizasyon UUID'si

Request Body

ParametreTipZorunluAçıklama
organization_namestringHayırOrganizasyon adı
organization_codestringHayırOrganizasyon kodu
legal_namestringHayırYasal ad
countrystringHayırÜlke kodu
citystringHayırŞehir
is_activebooleanHayırAktif durumu

Example Request

{
"organization_name": "CyberCert Updated",
"city": "Ankara",
"is_active": true
}

Response

Success Response (200 OK)

{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"organization_name": "CyberCert Updated",
"organization_code": "CYB01",
"legal_name": "CyberCert Ltd.",
"country": "TR",
"city": "Ankara",
"is_active": true,
"created_at": "2025-11-20T12:00:00.000000Z",
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Error Responses

404 Not Found

{
"message": "Organization not found"
}

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL

curl -X PATCH https://api.example.com/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"organization_name": "CyberCert Updated",
"city": "Ankara"
}'

Notes

  • .own permission'ı olan kullanıcılar sadece kendi organizasyonlarını güncelleyebilir
  • PUT tüm alanları günceller, PATCH sadece gönderilen alanları günceller