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

# Create a report

> Submits a new moderation report for content within a project. Upserts the subject and reporter identities automatically.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/reports
openapi: 3.1.0
info:
  title: Whistle SDK API
  description: >-
    HTTP API for the Whistle SDK. All endpoints are authenticated via an API key
    (`wh_…`) sent as a Bearer token. The API key is org-scoped — no organization
    slug or ID is needed in the URL.


    Base URL: `https://api.kansato.com/sdk/whistle/v1`


    Local development default: `http://localhost:3001/sdk/whistle/v1`
  version: 1.0.0
servers:
  - url: https://api.kansato.com/sdk/whistle/v1
    description: Production
  - url: http://localhost:3001/sdk/whistle/v1
    description: Local development (default PORT)
security:
  - apiKey: []
tags:
  - name: Reports
    description: Create, list, and manage moderation reports.
  - name: Identities
    description: Mirror user identities from your platform.
paths:
  /projects/{projectId}/reports:
    post:
      tags:
        - Reports
      summary: Create a report
      description: >-
        Submits a new moderation report for content within a project. Upserts
        the subject and reporter identities automatically.
      operationId: createReport
      parameters:
        - name: projectId
          in: path
          required: true
          description: Project UUID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReportBody'
            example:
              subject:
                type: user
                externalId: user_789
                display:
                  name: Jane Doe
                  username: janedoe
              reporter:
                type: user
                externalId: user_123
              target:
                contentExternalId: post_456
                contentType: post
              reason:
                names:
                  - harassment
              description: This post contains targeted harassment.
              automated: false
      responses:
        '200':
          description: Report created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReportResponse'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateReportBody:
      type: object
      required:
        - subject
        - target
        - reason
      properties:
        subject:
          $ref: '#/components/schemas/IngestSubject'
        reporter:
          $ref: '#/components/schemas/IngestSubject'
        target:
          type: object
          required:
            - contentExternalId
            - contentType
          properties:
            contentExternalId:
              type: string
              description: Your content identifier
            contentType:
              type: string
              description: Content type (e.g. post, comment)
        reason:
          type: object
          description: Report reason(s). Use `names` array or single `name` string.
          properties:
            name:
              type: string
            names:
              type: array
              items:
                type: string
        description:
          type: string
        automated:
          type: boolean
          description: Whether this report was generated automatically
    CreateReportResponse:
      type: object
      required:
        - report
      properties:
        report:
          type: object
          required:
            - id
            - projectId
            - status
            - createdAt
          properties:
            id:
              type: string
            projectId:
              type: string
            status:
              type: string
              enum:
                - OPEN
                - IN_REVIEW
                - RESOLVED
                - DISMISSED
                - CLOSED
            createdAt:
              type: string
              format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    IngestSubject:
      type: object
      required:
        - type
        - externalId
      properties:
        type:
          type: string
          description: Identity type (e.g. user)
          example: user
        externalId:
          type: string
          description: External ID from your platform
          example: user_789
        display:
          type: object
          properties:
            name:
              type: string
              nullable: true
            username:
              type: string
              nullable: true
            avatarUrl:
              type: string
              nullable: true
        metadata:
          description: Arbitrary JSON metadata
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key with `wh_` prefix. Send as Bearer token: `Authorization: Bearer
        wh_xxxxxxxxxxxx`

````