TSGGLOBAL Support sign in
Skip to page content
Browse TNID API docs

TNID API documentation User Spam reporting Create spam report

Create spam report

On this page

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

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

{
  "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

{
  "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.000000",
      "user": {
        "id": "00000000-0000-4000-8000-000000000002"
      },
      "userNote": "user note"
    }
  }
}