API ReferenceCommunity
Publish a community post (with up to 4 photos).
Mint photo `fileId`s via `POST /api/v1/uploads` (`purpose=community_image`) first, then pass them in `fileIds` together with the post body.
Authorization
bearerAuth AuthorizationBearer <token>
AdonisJS access-token guard (middleware.auth({ guards: ["api"] })). Send Authorization: Bearer <oat_…> (issued by /auth/register, /auth/login, /auth/social/{google,apple}, or /auth/guest).
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/community/posts" \ -H "Content-Type: application/json" \ -d '{ "body": "Pop-up tonight on Tahlia — first 20 burgers half-price. See you there!", "fileIds": [ "fil_01jq8zu1a3c5e7g9j1l3n5p7q9" ], "country": "SA", "city": "Riyadh", "channel": "discussion" }'{ "data": { "id": "string", "ownerId": "string", "userId": "string", "userName": "string", "userAvatar": "string", "userType": "string", "body": "string", "content": "string", "mediaUrls": [ "http://example.com" ], "conversationId": "string", "country": "string", "city": "string", "channel": "news", "owner": { "id": "string", "fullName": "string", "avatar": { "original": "string", "thumb": "string", "medium": "string", "large": "string" }, "truckName": "string" }, "likedByMe": true, "status": "string", "likesCount": 0, "repliesCount": 0, "reactions": 0, "replyCount": 0, "images": [ { "id": "string", "purpose": "string", "urls": { "original": "string", "thumb": "string", "medium": "string", "large": "string" } } ], "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "post": { "id": "string", "ownerId": "string", "userId": "string", "userName": "string", "userAvatar": "string", "userType": "string", "body": "string", "content": "string", "mediaUrls": [ "http://example.com" ], "conversationId": "string", "country": "string", "city": "string", "channel": "news", "owner": { "id": "string", "fullName": "string", "avatar": { "original": "string", "thumb": "string", "medium": "string", "large": "string" }, "truckName": "string" }, "likedByMe": true, "status": "string", "likesCount": 0, "repliesCount": 0, "reactions": 0, "replyCount": 0, "images": [ { "id": "string", "purpose": "string", "urls": { "original": "string", "thumb": "string", "medium": "string", "large": "string" } } ], "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }, "reply": {} }, "meta": { "requestId": "string" }}{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication is required to access this resource." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "VALIDATION_ERROR", "message": "One or more fields are invalid.", "fields": [ { "path": "email", "rule": "email", "message": "Must be a valid email address." } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}