> ## Documentation Index
> Fetch the complete documentation index at: https://docs.member.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# File Report

> File a moderation report against a community entity.

Validates membership, prevents self-reports, and enforces a 24-hour
duplicate guard.

Returns 201 Created with the new report on success.
Returns 403 when the hub does not exist, the reporter is not a hub member,
        or the reporter is banned/soft-banned.  All three cases return an
        identical response body so that hub IDs cannot be enumerated.
Returns 422 when the report fails validation (self-report, duplicate, etc.),
        or when reportable_type is unsupported (e.g. 'message' — see
        FILEABLE_REPORTABLE_TYPES in schemas.py).

Security (R2.I1): hub-existence resolution happens INSIDE the route body
using _err(), not via a Depends() that raises HTTPException.  This ensures
the "hub missing" 403 and the "not a member" 403 go through the same code
path and produce byte-identical response bodies, preventing hub enumeration.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/hubs/{hub_id}/reports
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/hubs/{hub_id}/reports:
    post:
      tags:
        - community-moderation
      summary: File Report
      description: >-
        File a moderation report against a community entity.


        Validates membership, prevents self-reports, and enforces a 24-hour

        duplicate guard.


        Returns 201 Created with the new report on success.

        Returns 403 when the hub does not exist, the reporter is not a hub
        member,
                or the reporter is banned/soft-banned.  All three cases return an
                identical response body so that hub IDs cannot be enumerated.
        Returns 422 when the report fails validation (self-report, duplicate,
        etc.),
                or when reportable_type is unsupported (e.g. 'message' — see
                FILEABLE_REPORTABLE_TYPES in schemas.py).

        Security (R2.I1): hub-existence resolution happens INSIDE the route body

        using _err(), not via a Depends() that raises HTTPException.  This
        ensures

        the "hub missing" 403 and the "not a member" 403 go through the same
        code

        path and produce byte-identical response bodies, preventing hub
        enumeration.
      operationId: >-
        community_moderation.post_community_moderation_post_hubs_by_hub_id_reports
      parameters:
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/FileReportBody'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/ModerationReportResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    FileReportBody:
      properties:
        data:
          $ref: '#/components/schemas/FileReportData'
      required:
        - data
      title: FileReportBody
      type: object
    ModerationReportResponse:
      properties:
        data:
          $ref: '#/components/schemas/ModerationReportResource'
      required:
        - data
      title: ModerationReportResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FileReportData:
      properties:
        attributes:
          $ref: '#/components/schemas/FileReportAttributes'
        type:
          const: moderation_reports
          default: moderation_reports
          title: Type
          type: string
      required:
        - attributes
      title: FileReportData
      type: object
    ModerationReportResource:
      properties:
        attributes:
          $ref: '#/components/schemas/ModerationReportAttributes'
        id:
          title: Id
          type: string
        type:
          const: moderation_reports
          default: moderation_reports
          title: Type
          type: string
      required:
        - id
        - attributes
      title: ModerationReportResource
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    FileReportAttributes:
      properties:
        notes:
          anyOf:
            - maxLength: 1000
              type: string
            - type: 'null'
          title: Notes
        reason_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason Id
        reason_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Reason Ids
        reportable_id:
          title: Reportable Id
          type: string
        reportable_type:
          title: Reportable Type
          type: string
      required:
        - reportable_type
        - reportable_id
      title: FileReportAttributes
      type: object
    ModerationReportAttributes:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        reason_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason Id
        reason_ids:
          items:
            type: string
          title: Reason Ids
          type: array
        reportable_id:
          title: Reportable Id
          type: string
        reportable_type:
          title: Reportable Type
          type: string
        resolution:
          title: Resolution
          type: string
        resolved_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Resolved At
        status:
          title: Status
          type: string
      required:
        - reportable_type
        - reportable_id
        - reason_id
        - reason_ids
        - notes
        - status
        - resolution
        - resolved_at
        - created_at
      title: ModerationReportAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````