Overview
Supported item types
Base URL
Authentication
All write operations (POST) require a Swarms Platform API key passed as a Bearer
token in the Authorization header.
- Sign in at swarms.world.
- Navigate to Settings → API Keys.
- Click Generate new key and copy the value shown once.
401.
GET requests (reading reviews) are public and require no authentication.
Endpoints
POST /api/reviews
Submit a 1–5 star rating and written comment for an agent, prompt, or tool. Authentication: Required (Bearer token)Request
Headers
Body Parameters
Example Request Body
Response
Success — 201 Created
The review was saved. The response body contains the persisted review record.
Error Responses
GET /api/reviews
Fetch all reviews for a given agent, prompt, or tool, along with summary statistics. Authentication: None — this endpoint is public.Request
Query Parameters
Example Request
Response
Success — 200 OK
Each item in
reviews:
Error Responses
Data Models
Review object
ReviewWithUser object (GET response only)
GET response envelope
POST success response
Error response (all error cases)
HTTP Status Codes
Error Reference
All error responses share the same shape:Rules and Constraints
One review per item per user
Each API key is tied to exactly one platform user account. That user may submit only one review per item (model_id). Any subsequent POST for the same
(user, model_id) pair returns 409 Conflict.
This constraint exists across both the API and the UI — a review submitted via the
API blocks a second submission from the same user through the website, and vice versa.
Rating scale
Only whole integers are accepted. Passing
4.5 returns a 400.
Comment length
- Minimum: 2 characters (after whitespace is trimmed).
- Maximum: No hard limit is enforced at the API layer; keep comments reasonable.
model_type casing
model_type is normalised to lowercase before storage. "Agent", "AGENT", and
"agent" are all accepted and stored as "agent".
Review ordering (GET)
Reviews are always returned newest-first (created_at DESC). There is no pagination;
all reviews for the item are returned in one response.
average_rating precision
average_rating is rounded to one decimal place using round-half-up. A mean of
4.25 is returned as 4.3. When there are no reviews the field is null, not 0.
Code Examples
cURL
Submit a review
Fetch reviews for an item
Python
Handling the duplicate-review case
JavaScript / TypeScript
Handling the 409 Conflict gracefully
Notifications
When a review is saved, the platform automatically sends an email notification to the owner of the reviewed item. This happens asynchronously — it does not delay or affect the API response. The email is not sent when:- The reviewer and the item owner are the same user account.
- The item cannot be found in the database (e.g. invalid
model_id). - The owner’s account has no registered email address.