Skip to content
msMarketSDK

all endpoints

// api reference

Moderation

GET /v1/flags

List flags, newest first

secret key only

GET /v1/flagsrequest
curl https://api.marketsdk.com/v1/flags \
  -H "Authorization: Bearer $MARKETSDK_KEY"
200 example response, flag list
{
  "object": "list",
  "data": [
    {
      "object": "flag",
      "id": "flg_034XtPDs7UJ0TXzTsdaHZa",
      "target_type": "listing",
      "target": "string",
      "reporter": "string",
      "reason": "prohibited_item",
      "note": null,
      "status": "open",
      "resolution": "dismissed",
      "action": null,
      "created_at": "2026-10-01T12:00:00.000Z",
      "resolved_at": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}

parameters

Parameters
fieldtypeabout
limitinteger, in querymin 1, max 100, default 20
starting_afterstring, in queryThe next_cursor of the previous page.
statusone of: open, resolved, in query
targetstring, in queryOnly flags on this listing, seller, or review.

returns 200, flag list

fields
Response fields
fieldtypeabout
objectrequiredone of: list
datarequiredarray of flag
data[].objectrequiredone of: flag
data[].idrequiredstring
data[].target_typerequiredone of: listing, seller, review
data[].targetrequiredstring
data[].reporterrequiredstring
data[].reasonrequiredone of: prohibited_item, counterfeit, scam, offensive, spam, other
data[].noterequiredstring or null
data[].statusrequiredone of: open, resolved
data[].resolutionrequiredone of: dismissed, content_removed, seller_suspended, null or null
data[].actionrequiredstring or nullThe moderation action that resolved it.
data[].created_atrequiredtimestamp
data[].resolved_atrequiredtimestamp or null
has_morerequiredbooleanWhether another page follows.
next_cursorrequiredstring or nullPass as starting_after (or cursor for search) to get the next page.

errors

  • 400The request is not valid.
  • 401No API key, or not a valid one.
  • 429Rate limited. See Retry-After.

POST /v1/flags

Flag a listing, a seller, or a review

On behalf of the end user who reported it.

secret key only

POST /v1/flagsrequest
curl -X POST https://api.marketsdk.com/v1/flags \
  -H "Authorization: Bearer $MARKETSDK_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"target":"lst_034XtPDs7UJ0TXzTsdaHZa","reporter":"buy_034XtPDs7UJ0TXzTsdaHZa","reason":"prohibited_item"}'
201 example response, flag
{
  "object": "flag",
  "id": "flg_034XtPDs7UJ0TXzTsdaHZa",
  "target_type": "listing",
  "target": "string",
  "reporter": "string",
  "reason": "prohibited_item",
  "note": null,
  "status": "open",
  "resolution": "dismissed",
  "action": null,
  "created_at": "2026-10-01T12:00:00.000Z",
  "resolved_at": null
}

body, create flag

Request body
fieldtypeabout
targetrequiredstringA listing, seller, or review id.
reporterrequiredstringThe end user reporting it: a buyer id or a seller id.
reasonrequiredone of: prohibited_item, counterfeit, scam, offensive, spam, other
notestringThe reporter's own words.up to 2000 characters

returns 201, flag

fields
Response fields
fieldtypeabout
objectrequiredone of: flag
idrequiredstring
target_typerequiredone of: listing, seller, review
targetrequiredstring
reporterrequiredstring
reasonrequiredone of: prohibited_item, counterfeit, scam, offensive, spam, other
noterequiredstring or null
statusrequiredone of: open, resolved
resolutionrequiredone of: dismissed, content_removed, seller_suspended, null or null
actionrequiredstring or nullThe moderation action that resolved it.
created_atrequiredtimestamp
resolved_atrequiredtimestamp or null

errors

  • 400The request is not valid.
  • 401No API key, or not a valid one.
  • 404No object with that id in this marketplace.
  • 429Rate limited. See Retry-After.

GET /v1/flags/{id}

Retrieve a flag

secret key only

GET /v1/flags/{id}request
curl https://api.marketsdk.com/v1/flags/{id} \
  -H "Authorization: Bearer $MARKETSDK_KEY"
200 example response, flag
{
  "object": "flag",
  "id": "flg_034XtPDs7UJ0TXzTsdaHZa",
  "target_type": "listing",
  "target": "string",
  "reporter": "string",
  "reason": "prohibited_item",
  "note": null,
  "status": "open",
  "resolution": "dismissed",
  "action": null,
  "created_at": "2026-10-01T12:00:00.000Z",
  "resolved_at": null
}

parameters

Parameters
fieldtypeabout
idrequiredstring, in path

returns 200, flag

fields
Response fields
fieldtypeabout
objectrequiredone of: flag
idrequiredstring
target_typerequiredone of: listing, seller, review
targetrequiredstring
reporterrequiredstring
reasonrequiredone of: prohibited_item, counterfeit, scam, offensive, spam, other
noterequiredstring or null
statusrequiredone of: open, resolved
resolutionrequiredone of: dismissed, content_removed, seller_suspended, null or null
actionrequiredstring or nullThe moderation action that resolved it.
created_atrequiredtimestamp
resolved_atrequiredtimestamp or null

errors

  • 400The request is not valid.
  • 401No API key, or not a valid one.
  • 404No object with that id in this marketplace.
  • 429Rate limited. See Retry-After.

GET /v1/moderation/queue

The review queue: everything with open flags, the longest waiting first

secret key only

GET /v1/moderation/queuerequest
curl https://api.marketsdk.com/v1/moderation/queue \
  -H "Authorization: Bearer $MARKETSDK_KEY"
200 example response, moderation queue
{
  "object": "list",
  "data": [
    {
      "object": "moderation_queue_item",
      "target_type": "listing",
      "target": "string",
      "open_flags": 0,
      "reasons": {},
      "first_flagged_at": "2026-10-01T12:00:00.000Z",
      "last_flagged_at": "2026-10-01T12:00:00.000Z"
    }
  ]
}

parameters

Parameters
fieldtypeabout
target_typeone of: listing, seller, review, in query

returns 200, moderation queue

fields
Response fields
fieldtypeabout
objectrequiredone of: list
datarequiredarray of queue itemTargets with open flags, the longest waiting first. At most 100.
data[].objectrequiredone of: moderation_queue_item
data[].target_typerequiredone of: listing, seller, review
data[].targetrequiredstring
data[].open_flagsrequiredinteger
data[].reasonsrequiredobject of stringsOpen flags by reason.
data[].first_flagged_atrequiredtimestamp
data[].last_flagged_atrequiredtimestamp

errors

  • 400The request is not valid.
  • 401No API key, or not a valid one.
  • 429Rate limited. See Retry-After.

GET /v1/moderation/actions

The moderation log, newest first

secret key only

GET /v1/moderation/actionsrequest
curl https://api.marketsdk.com/v1/moderation/actions \
  -H "Authorization: Bearer $MARKETSDK_KEY"
200 example response, moderation action list
{
  "object": "list",
  "data": [
    {
      "object": "moderation_action",
      "id": "mod_034XtPDs7UJ0TXzTsdaHZa",
      "target_type": "listing",
      "target": "string",
      "action": "dismiss",
      "reason": "string",
      "actor": "string",
      "flags_resolved": 0,
      "created_at": "2026-10-01T12:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

parameters

Parameters
fieldtypeabout
limitinteger, in querymin 1, max 100, default 20
starting_afterstring, in queryThe next_cursor of the previous page.
targetstring, in query

returns 200, moderation action list

fields
Response fields
fieldtypeabout
objectrequiredone of: list
datarequiredarray of moderation action
data[].objectrequiredone of: moderation_action
data[].idrequiredstring
data[].target_typerequiredone of: listing, seller, review
data[].targetrequiredstring
data[].actionrequiredone of: dismiss, remove_content, suspend_seller, reinstate_seller
data[].reasonrequiredstring
data[].actorrequiredstring
data[].flags_resolvedrequiredintegerOpen flags this action resolved.
data[].created_atrequiredtimestamp
has_morerequiredbooleanWhether another page follows.
next_cursorrequiredstring or nullPass as starting_after (or cursor for search) to get the next page.

errors

  • 400The request is not valid.
  • 401No API key, or not a valid one.
  • 429Rate limited. See Retry-After.

POST /v1/moderation/actions

Act on a flagged target

Resolves the target's open flags and logs who acted and why.

secret key only

POST /v1/moderation/actionsrequest
curl -X POST https://api.marketsdk.com/v1/moderation/actions \
  -H "Authorization: Bearer $MARKETSDK_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"target":"string","action":"dismiss","reason":"string","actor":"string"}'
201 example response, moderation action
{
  "object": "moderation_action",
  "id": "mod_034XtPDs7UJ0TXzTsdaHZa",
  "target_type": "listing",
  "target": "string",
  "action": "dismiss",
  "reason": "string",
  "actor": "string",
  "flags_resolved": 0,
  "created_at": "2026-10-01T12:00:00.000Z"
}

body, create moderation action

Request body
fieldtypeabout
targetrequiredstringThe listing, seller, or review acted on.
actionrequiredone of: dismiss, remove_content, suspend_seller, reinstate_sellerdismiss closes the open flags and changes nothing else. remove_content removes a listing or a review; a removed review stops counting toward reputation. suspend_seller suspends the seller, or the seller of a listing, or a seller who wrote a review: they cannot publish or take orders, and their listings leave search. reinstate_seller lifts a suspension.
reasonrequiredstringWhy. Kept with the action.up to 2000 characters
actorrequiredstringWho on your team took the action, for the log.up to 200 characters

returns 201, moderation action

fields
Response fields
fieldtypeabout
objectrequiredone of: moderation_action
idrequiredstring
target_typerequiredone of: listing, seller, review
targetrequiredstring
actionrequiredone of: dismiss, remove_content, suspend_seller, reinstate_seller
reasonrequiredstring
actorrequiredstring
flags_resolvedrequiredintegerOpen flags this action resolved.
created_atrequiredtimestamp

errors

  • 400The request is not valid.
  • 401No API key, or not a valid one.
  • 404No object with that id in this marketplace.
  • 409The object is not in a state that allows this.
  • 429Rate limited. See Retry-After.