mirror of
https://github.com/mastodon/documentation
synced 2025-04-11 22:56:17 +02:00

* fix relrefs around trends and related entities * revert moving caption-links to middle of page * hide empty menu in table of contents * clarify edit notifs are only for boosted statuses * following/followers no longer need auth * fix typo * specify cooldown period for account Move * use the correct cooldown * add missing parameters to accounts/id/statuses * link to account_statuses_filter.rb * fix typo (#1072) * fix typo (#1073) * fix link to http sig spec (#1067) * simply HTTP request examples in api methods docs * add missing client_secret to oauth/token (#1062) * Add any, all, none to hashtag timeline * minor formatting changes * Update signature requirements and advice * fix public key -> private key * clarify use of RSA with SHA256 * Add note about saving your profile after adding rel-me link * v2 filters api * comment out params that shouldn't be used in v2 filter api * admin trends * remove old todo * canonical email blocks + scheduled statuses * remove under-construction warnings from finished pages * verify api method params with source code * fix typo (#1088) * fix broken caption-links (#1100) * fix formatting of entities (#1094) * Remove keybase section from user guide (#1093) * fix typos (#1092) * Verify limits are accurate (#1086) * add mention of iframe limitation (#1084) * Add CORS header to WEB_DOMAIN example (#1083) * Fix typo (#1081) * pin http sigs spec at draft 8 * Revert "pin http sigs spec at draft 8" This reverts commit 9fd5f7032b69b29e77599dd62adfe8d2f5cd4f20. * add case sensitivity warning to 4.0 roles * Add url length note to bio (#1087) * remove follow scope from examples (#1103) * clarify usage of update_credentials to update profile fields * add noindex to Account entitity * remove required hint from technically not required property
155 lines
4.4 KiB
Markdown
155 lines
4.4 KiB
Markdown
---
|
|
title: reports API methods
|
|
description: Report problematic users to your moderators.
|
|
menu:
|
|
docs:
|
|
weight: 70
|
|
name: reports
|
|
parent: methods-accounts
|
|
identifier: methods-reports
|
|
aliases: [
|
|
"/methods/reports",
|
|
"/api/methods/reports",
|
|
"/methods/accounts/reports",
|
|
]
|
|
---
|
|
|
|
<style>
|
|
#TableOfContents ul ul ul {display: none}
|
|
</style>
|
|
|
|
## File a report {#post}
|
|
|
|
```http
|
|
POST /api/v1/reports HTTP/1.1
|
|
```
|
|
|
|
**Returns:** [Report]({{< relref "entities/report" >}})\
|
|
**OAuth:** User token + `write:reports`\
|
|
**Version history:**\
|
|
1.1 - added\
|
|
2.3.0 - add `forward` parameter\
|
|
3.5.0 - add `category` and `rule_ids` parameters\
|
|
4.0.0 - `category` is now optional if `rule_ids` is provided
|
|
|
|
#### Request
|
|
##### Headers
|
|
|
|
Authorization
|
|
: {{<required>}} Provide this header with `Bearer <user token>` to gain authorized access to this API method.
|
|
|
|
##### Form data parameters
|
|
|
|
account_id
|
|
: {{<required>}} String. ID of the account to report.
|
|
|
|
status_ids[]
|
|
: Array of String. You can attach statuses to the report to provide additional context.
|
|
|
|
comment
|
|
: String. The reason for the report. Default maximum of 1000 characters.
|
|
|
|
forward
|
|
: Boolean. If the account is remote, should the report be forwarded to the remote admin? Defaults to false.
|
|
|
|
category
|
|
: String. Specify if the report is due to `spam`, `violation` of enumerated instance rules, or some `other` reason. Defaults to `other`. Will be set to `violation` if `rule_ids[]` is provided (regardless of any category value you provide).
|
|
|
|
rule_ids[]
|
|
: Array of Integer. For `violation` category reports, specify the ID of the exact rules broken. Rules and their IDs are available via [GET /api/v1/instance/rules]({{< relref "methods/instance#rules" >}}) and [GET /api/v1/instance]({{< relref "methods/instance#get" >}}).
|
|
|
|
#### Response
|
|
##### 200: OK
|
|
|
|
Sample call with one status ID provided and a category of `spam` with a comment
|
|
|
|
```json
|
|
{
|
|
"id": "48914",
|
|
"action_taken": false,
|
|
"action_taken_at": null,
|
|
"category": "spam",
|
|
"comment": "Spam account",
|
|
"forwarded": false,
|
|
"created_at": "2022-08-25T09:56:16.763Z",
|
|
"status_ids": [
|
|
"108882889550545820"
|
|
],
|
|
"rule_ids": null,
|
|
"target_account": {
|
|
"id": "108366849347798387",
|
|
"username": "Baluke",
|
|
"acct": "Baluke",
|
|
"display_name": "Baluke Dental Studios",
|
|
"locked": false,
|
|
"bot": false,
|
|
"discoverable": false,
|
|
"group": false,
|
|
"created_at": "2022-05-26T00:00:00.000Z",
|
|
"note": "<p>Baluke Dental Studios is a full service dental lab offering fabrication, staining, and digital services. Advanced technologies and a meticulous process ensure reduced chair time, lower costs, and better patient outcomes with beautiful smiles. Talk to a representative today.</p><p><a href=\"https://baluke.com/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"\">baluke.com/</span><span class=\"invisible\"></span></a></p>",
|
|
"url": "https://mastodon.social/@Baluke",
|
|
"avatar": "https://files.mastodon.social/accounts/avatars/108/366/849/347/798/387/original/dbcfe99ed5def0f4.png",
|
|
"avatar_static": "https://files.mastodon.social/accounts/avatars/108/366/849/347/798/387/original/dbcfe99ed5def0f4.png",
|
|
"header": "https://static-cdn.mastodon.social/headers/original/missing.png",
|
|
"header_static": "https://static-cdn.mastodon.social/headers/original/missing.png",
|
|
"followers_count": 0,
|
|
"following_count": 0,
|
|
"statuses_count": 38,
|
|
"last_status_at": "2022-08-25",
|
|
"emojis": [],
|
|
"fields": []
|
|
}
|
|
}
|
|
```
|
|
|
|
##### 401: Unauthorized
|
|
|
|
Invalid or missing Authorization header
|
|
|
|
```json
|
|
{
|
|
"error": "The access token is invalid"
|
|
}
|
|
```
|
|
|
|
##### 404: Not found
|
|
|
|
Report not filed.
|
|
|
|
```json
|
|
{
|
|
"error": "Record not found"
|
|
}
|
|
```
|
|
|
|
##### 422: Unprocessable entity
|
|
|
|
Token does not have an authorized user
|
|
|
|
```json
|
|
{
|
|
"error": "This method requires an authenticated user"
|
|
}
|
|
```
|
|
|
|
Alternatively, the `category` was set to `violation` but invalid or missing `rule_ids` were provided
|
|
|
|
```json
|
|
{
|
|
"error": "Validation failed: Rule ids does not reference valid rules"
|
|
}
|
|
```
|
|
|
|
Alternatively (Mastodon 3.5), the `category` was set to something other than `violation` but some `rule_ids` were provided
|
|
|
|
```json
|
|
{
|
|
"error": "Validation failed: Rule ids must be blank"
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## See also
|
|
|
|
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/controllers/api/v1/reports_controller.rb" caption="app/controllers/api/v1/reports_controller.rb" >}} |