dambel

دمبل

shevron
ورود | ثبت نام

API Docs / reports / create



POST /api/v1/reports

Creates a new report for a specified element (e.g., gym, user).


Permissions

PermissionDescription
reports.createCreate a report

Request Body Parameters

NameTypeRequiredDescriptionExample
reportable_typestringYesType of the element to report (e.g., gym)"gym"
reportable_idintYesID of the element to report456
descriptionstringYesDescription of the report (max 255 chars)"Broken equipment"

Request Example

{
  "reportable_type": "gym",
  "reportable_id": 456,
  "description": "Broken equipment"
}

Response

201 Created

Returns the created report resource.

Example

{
  "report": {
    "id": 123,
    "reportable_type": "App\\Models\\Gym",
    "reportable_id": 456,
    "user_id": 789,
    "description": "Broken equipment",
    "signed_off": false,
    "created_at": "2020-01-01 00:00:00"
  }
}

For a full schema, see Report Resource.


Error Responses

StatusDescriptionReference
422Validation errorValidation error
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube