REST API
Base URL (default prefix):
/{prefix}/api
→ /vgcomments/apiBlade Comments uses this API from the browser. Livewire Comments mostly talks to PHP services directly but shares the same backend rules.
All mutating routes expect a valid web session CSRF token (X-CSRF-TOKEN / _token) when called from your app.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /comments | List comments |
POST | /comments | Create comment |
PUT | /comments/{uuid} | Update comment |
DELETE | /comments/{uuid} | Delete comment |
POST | /comments/{uuid}/reactions | Add reaction |
DELETE | /comments/{uuid}/reactions | Remove reaction |
POST | /comments/{uuid}/report | Report comment |
POST | /files | Upload attachment |
GET | /files/{uuid}.{extension} | Stream attachment |
Typical query / body fields
Comments are scoped by:
page_id— string key (e.g.blog-42,dashboard)- and/or morph pair
commentable_id+commentable_type(type must be inallowed_commentable_types)
Common create fields:
content(required, length from config)parent_id(reply)- Guest:
author_name,author_email,author_urlwhenallow_guestsis true recaptcha_tokenwhen reCAPTCHA is enabled
List endpoints support ordering (e.g. latest) and pagination.
File streaming
Uploaded files are not always public disk URLs. Use:
GET /{prefix}/files/{uuid}.{extension}Custom frontends
You can skip both UI packages and build your own client against this API. Still install vgcomments, publish assets only if you need the admin UI, and migrate.