Ana içeriğe geç

İçerik Güncelle

İçerik bilgilerini günceller.

Endpoint

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

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • content.update - Tüm içerikleri güncelleme
  • content.update.own - Sadece kendi içeriklerini güncelleme

Request

Headers

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

Path Parameters

ParametreTipZorunluAçıklama
uuidstringEvetİçerik UUID'si

Request Body

ParametreTipZorunluAçıklama
titlestringHayırİçerik başlığı
slugstringHayırİçerik slug'ı
contentstringHayırİçerik metni
excerptstringHayırİçerik özeti
statusstringHayırİçerik durumu (draft, published, archived)
typestringHayırİçerik tipi
is_activebooleanHayırAktif durumu
published_atdatetimeHayırYayınlanma tarihi

Example Request

{
"title": "Örnek İçerik Updated",
"content": "Güncellenmiş içerik metni...",
"status": "published"
}

Response

Success Response (200 OK)

{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"title": "Örnek İçerik Updated",
"slug": "ornek-icerik",
"content": "Güncellenmiş içerik metni...",
"status": "published",
"is_active": true,
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Error Responses

404 Not Found

{
"message": "Not Found"
}

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL

curl -X PATCH https://api.example.com/api/v1/contents/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"title": "Örnek İçerik Updated",
"content": "Güncellenmiş içerik metni...",
"status": "published"
}'

Notes

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