> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/001_user/006_spam_reporting/003__create_spam_report.md).

# Create Spam Report

GraphQL endpoint: `/user`

Creates a spam report to report unwanted or malicious communications.

Required fields:

* `channelType`: The communication channel (SMS, MMS, RCS, VOICE, EMAIL, OTHER)

Optional fields:

* `source`: The source/origin of the communication
* `destination`: The destination of the communication
* `fromNumber`: Deprecated - use `source` instead
* `toNumber`: Deprecated - use `destination` instead
* `reportedAt`: When the report was created
* `timestamp`: Deprecated - use `reportedAt` instead
* `issueType`: Type of issue (SPAM, FRAUD, SCAM, HARASSMENT, ILLEGAL\_CONTENT)
* `userNote`: User's description of the issue
* `messageContent`: Content of the message being reported
* `metadata`: Additional metadata as key-value pairs (flat structure only)

The report is created with status SUBMITTED and can be tracked using the spamReports query.

## Query

```graphql
mutation (
  $source: String
  $fromNumber: String
  $destination: String
  $toNumber: String
  $channelType: SpamReportChannelType!
  $reportedAt: NaiveDateTime
  $timestamp: NaiveDateTime
  $issueType: SpamReportIssueType
  $userNote: String
  $messageContent: String
  $metadata: JSON
) {
  createSpamReport (
    source: $source
    fromNumber: $fromNumber
    destination: $destination
    toNumber: $toNumber
    channelType: $channelType
    reportedAt: $reportedAt
    timestamp: $timestamp
    issueType: $issueType
    userNote: $userNote
    messageContent: $messageContent
    metadata: $metadata
  ) {
    id
    source
    fromNumber
    destination
    toNumber
    userNote
    messageContent
    channelType
    issueType
    status
    createdAt
    updatedAt
    reportedAt
    timestamp
    metadata
    user {
      id
    }
  }
}

```

## Variables

```json
{
  "channelType": "RCS",
  "destination": "1",
  "issueType": "SCAM",
  "messageContent": "message content",
  "metadata": {
    "test": "value"
  },
  "reportedAt": "2024-10-04 02:52:00",
  "source": "213450",
  "userNote": "user note"
}
```

## Response

```json
{
  "data": {
    "createSpamReport": {
      "channelType": "RCS",
      "createdAt": null,
      "destination": "1",
      "fromNumber": "213450",
      "id": "00000000-0000-4000-8000-000000000001",
      "issueType": "SCAM",
      "messageContent": "message content",
      "metadata": {
        "test": "value"
      },
      "reportedAt": "2026-01-15T09:00:00.000000",
      "source": "213450",
      "status": "SUBMITTED",
      "timestamp": "2026-01-15T09:00:00.000000",
      "toNumber": "1",
      "updatedAt": "2026-01-15T09:00:01",
      "user": {
        "id": "00000000-0000-4000-8000-000000000002"
      },
      "userNote": "user note"
    }
  }
}
```
