> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # CreateReport # Package: feedbackModeration # Namespace: ReportsService # Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/reports-v2/create-report.md ## Permission Scopes: Manage Reports: SCOPE.DC_REPORTS.MANAGE-REPORTS ## Introduction Creates a report. --- ## REST API ### Schema ``` Method: createReport Description: Creates a report. URL: https://www.wixapis.com/reports/v2/reports Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: report Method parameters: param name: report | type: Report | required: true - name: entityName | type: string | description: Reported entity name, such as `comment`. - name: entityId | type: string | description: Reported entity GUID. - name: reason | type: Reason | description: Reason for the report. - name: reasonType | type: Type | description: Report reason type. - enum: - UNKNOWN_TYPE: Unknown type. This value is not used. - OTHER: Entity is reported for other reasons. Specify in `details`. - SPAM: Entity is reported for spam. - NUDITY_OR_SEXUAL_HARASSMENT: Entity is reported for nudity or sexual harassment. - HATE_SPEECH_OR_SYMBOLS: Entity is reported for hate speech. - FALSE_INFORMATION: Entity is reported for false information. - COMMUNITY_GUIDELINES_VIOLATION: Entity is reported for a community guideline violation. - VIOLENCE: Entity is reported for violence. - SUICIDE_OR_SELF_INJURY: Entity is reported for mentioning suicide. - UNAUTHORIZED_SALES: Entity is reported for unuathorized sales. - EATING_DISORDER: Entity is reported for mentioning an eating disorder. - INVOLVES_A_CHILD: Entity is reported for involving a minor. - TERRORISM: Entity is reported for mentioning terrorism. - DRUGS: Entity is reported for mentioning drugs. - UNLAWFUL: Entity is reported for unlawful actions. - EXPOSING_IDENTIFYING_INFO: Entity is reported for exposing identifying details. - name: details | type: string | description: Why the entity is reported. - name: extendedFields | type: ExtendedFields | description: Custom field data for the report object. **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: CreateReportResponse - name: report | type: Report | description: Created report. - name: id | type: string | description: Report GUID. - name: entityName | type: string | description: Reported entity name, such as `comment`. - name: entityId | type: string | description: Reported entity GUID. - name: identity | type: IdentificationData | description: Identity of who created a report. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: identityType | type: IdentityType | description: Identity type - enum: - ANONYMOUS_VISITOR: A site visitor who has not logged in. - MEMBER: A logged-in site member. - name: reason | type: Reason | description: Reason for the report. - name: reasonType | type: Type | description: Report reason type. - enum: - UNKNOWN_TYPE: Unknown type. This value is not used. - OTHER: Entity is reported for other reasons. Specify in `details`. - SPAM: Entity is reported for spam. - NUDITY_OR_SEXUAL_HARASSMENT: Entity is reported for nudity or sexual harassment. - HATE_SPEECH_OR_SYMBOLS: Entity is reported for hate speech. - FALSE_INFORMATION: Entity is reported for false information. - COMMUNITY_GUIDELINES_VIOLATION: Entity is reported for a community guideline violation. - VIOLENCE: Entity is reported for violence. - SUICIDE_OR_SELF_INJURY: Entity is reported for mentioning suicide. - UNAUTHORIZED_SALES: Entity is reported for unuathorized sales. - EATING_DISORDER: Entity is reported for mentioning an eating disorder. - INVOLVES_A_CHILD: Entity is reported for involving a minor. - TERRORISM: Entity is reported for mentioning terrorism. - DRUGS: Entity is reported for mentioning drugs. - UNLAWFUL: Entity is reported for unlawful actions. - EXPOSING_IDENTIFYING_INFO: Entity is reported for exposing identifying details. - name: details | type: string | description: Why the entity is reported. - name: revision | type: string | description: Revision number, which increments by 1 each time the rule is updated. To prevent conflicting changes, the existing revision must be used when updating a rule. - name: createdDate | type: string | description: Date and time when the report created. - name: updatedDate | type: string | description: Date and time when the report updated. - name: extendedFields | type: ExtendedFields | description: Custom field data for the report object. **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). ``` ### Examples ### Create Report ```curl curl -X POST \ https://www.wixapis.com/reports/v2/reports \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' \ -d '{ "report": { "entityName": "comment", "entityId": "50353fbc-b265-4f03-888f-a53aa272758d" "reason": { "reasonType": "DRUGS", "description": "This person promotes drug usage." } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.feedbackModeration.ReportsService.createReport(report) Description: Creates a report. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: report Method parameters: param name: report | type: Report | required: true - name: entityName | type: string | description: Reported entity name, such as `comment`. - name: entityId | type: string | description: Reported entity GUID. - name: reason | type: Reason | description: Reason for the report. - name: reasonType | type: Type | description: Report reason type. - enum: - UNKNOWN_TYPE: Unknown type. This value is not used. - OTHER: Entity is reported for other reasons. Specify in `details`. - SPAM: Entity is reported for spam. - NUDITY_OR_SEXUAL_HARASSMENT: Entity is reported for nudity or sexual harassment. - HATE_SPEECH_OR_SYMBOLS: Entity is reported for hate speech. - FALSE_INFORMATION: Entity is reported for false information. - COMMUNITY_GUIDELINES_VIOLATION: Entity is reported for a community guideline violation. - VIOLENCE: Entity is reported for violence. - SUICIDE_OR_SELF_INJURY: Entity is reported for mentioning suicide. - UNAUTHORIZED_SALES: Entity is reported for unuathorized sales. - EATING_DISORDER: Entity is reported for mentioning an eating disorder. - INVOLVES_A_CHILD: Entity is reported for involving a minor. - TERRORISM: Entity is reported for mentioning terrorism. - DRUGS: Entity is reported for mentioning drugs. - UNLAWFUL: Entity is reported for unlawful actions. - EXPOSING_IDENTIFYING_INFO: Entity is reported for exposing identifying details. - name: details | type: string | description: Why the entity is reported. - name: extendedFields | type: ExtendedFields | description: Custom field data for the report object. **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: PROMISE - name: _id | type: string | description: Report GUID. - name: entityName | type: string | description: Reported entity name, such as `comment`. - name: entityId | type: string | description: Reported entity GUID. - name: identity | type: IdentificationData | description: Identity of who created a report. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: identityType | type: IdentityType | description: Identity type - enum: - ANONYMOUS_VISITOR: A site visitor who has not logged in. - MEMBER: A logged-in site member. - name: reason | type: Reason | description: Reason for the report. - name: reasonType | type: Type | description: Report reason type. - enum: - UNKNOWN_TYPE: Unknown type. This value is not used. - OTHER: Entity is reported for other reasons. Specify in `details`. - SPAM: Entity is reported for spam. - NUDITY_OR_SEXUAL_HARASSMENT: Entity is reported for nudity or sexual harassment. - HATE_SPEECH_OR_SYMBOLS: Entity is reported for hate speech. - FALSE_INFORMATION: Entity is reported for false information. - COMMUNITY_GUIDELINES_VIOLATION: Entity is reported for a community guideline violation. - VIOLENCE: Entity is reported for violence. - SUICIDE_OR_SELF_INJURY: Entity is reported for mentioning suicide. - UNAUTHORIZED_SALES: Entity is reported for unuathorized sales. - EATING_DISORDER: Entity is reported for mentioning an eating disorder. - INVOLVES_A_CHILD: Entity is reported for involving a minor. - TERRORISM: Entity is reported for mentioning terrorism. - DRUGS: Entity is reported for mentioning drugs. - UNLAWFUL: Entity is reported for unlawful actions. - EXPOSING_IDENTIFYING_INFO: Entity is reported for exposing identifying details. - name: details | type: string | description: Why the entity is reported. - name: revision | type: string | description: Revision number, which increments by 1 each time the rule is updated. To prevent conflicting changes, the existing revision must be used when updating a rule. - name: _createdDate | type: Date | description: Date and time when the report created. - name: _updatedDate | type: Date | description: Date and time when the report updated. - name: extendedFields | type: ExtendedFields | description: Custom field data for the report object. **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). ``` ### Examples ### createReport ```javascript import { reports } from '@wix/reports'; async function createReport(report) { const response = await reports.createReport(report); }; ``` ### createReport (with elevated permissions) ```javascript import { reports } from '@wix/reports'; import { auth } from '@wix/essentials'; async function myCreateReportMethod(report) { const elevatedCreateReport = auth.elevate(reports.createReport); const response = await elevatedCreateReport(report); } ``` ### createReport (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { reports } from '@wix/reports'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { reports }, // Include the auth strategy and host as relevant }); async function createReport(report) { const response = await myWixClient.reports.createReport(report); }; ``` ---