POST · Modérer

Feedback : Modérer. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Feedback

POST /api/v1/feedback/moderation

operationId : feedback_moderate

Accès

Permission

Consentements OAuth

OAuth : délégation d’un équipier pour l’API

feedback.moderate

api:connect, feedback:moderate

KHONY_ORIGIN est l’origine HTTPS de votre application Khony, sans chemin final. Remplacez les identifiants de l’exemple par ceux de vos ressources autorisées. Les données de réponse ci-dessous illustrent le format ; elles ne sont pas le résultat d’un appel à votre organisation.

Paramètres et en-têtes

Nom

Emplacement

Requis

Type et contraintes

Idempotency-Key

header

Oui

string ; Longueur maximale : 200

X-Khony-Confirmation

header

Non

string ; uuid

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

productId

JSON

Oui

string

request

JSON

Oui

object

Variantes de la requête

Sélecteur

Valeur

Autres champs requis dans request

request.operation

"board_create"

name, description

request.operation

"status"

postId, expectedRevision, status

request.operation

"properties"

postId, expectedRevision

request.operation

"comments_lock"

postId, expectedRevision, locked

request.operation

"comment_visibility"

postId, expectedRevision, commentId, expectedCommentRevision, visibility

request.operation

"suggestion_reject"

postId, expectedRevision, targetPostId, expectedTargetRevision

request.operation

"suggestion_restore"

postId, expectedRevision, targetPostId, expectedTargetRevision, decisionId

Choisissez une variante et respectez son schéma complet : les contraintes des champs optionnels et les unions imbriquées restent applicables.

Exemple de requête

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/feedback/moderation" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Idempotency-Key: feedback-command-example-20261023' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "operation": "status",
    "postId": "post_01k3w8d7vhe008000000000001",
    "expectedRevision": "4242",
    "status": "planned"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": {
    "id": "post_01k3w8d7vhe008000000000001",
    "status": "planned"
  }
}
JSON
Schéma complet du corps JSON
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "request": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "board_create"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": {
              "type": "string",
              "maxLength": 500
            }
          },
          "required": [
            "operation",
            "name",
            "description"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "status"
            },
            "postId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "status": {
              "type": "string",
              "enum": [
                "new",
                "in_review",
                "planned",
                "completed",
                "closed"
              ]
            }
          },
          "required": [
            "operation",
            "postId",
            "expectedRevision",
            "status"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "properties"
            },
            "postId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "boardId": {
              "type": "string",
              "pattern": "^board_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "visibility": {
              "type": "string",
              "enum": [
                "public",
                "internal"
              ]
            },
            "tags": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema2"
              }
            },
            "assignment": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "none"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "member"
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "required": [
                    "type",
                    "id"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "team"
                    },
                    "id": {
                      "type": "string",
                      "pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
                    }
                  },
                  "required": [
                    "type",
                    "id"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "operation",
            "postId",
            "expectedRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "comments_lock"
            },
            "postId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "locked": {
              "type": "boolean"
            }
          },
          "required": [
            "operation",
            "postId",
            "expectedRevision",
            "locked"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "comment_visibility"
            },
            "postId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "commentId": {
              "type": "string",
              "pattern": "^comment_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "expectedCommentRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "visibility": {
              "type": "string",
              "enum": [
                "public",
                "internal"
              ]
            }
          },
          "required": [
            "operation",
            "postId",
            "expectedRevision",
            "commentId",
            "expectedCommentRevision",
            "visibility"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "suggestion_reject"
            },
            "postId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "targetPostId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedTargetRevision": {
              "$ref": "#/$defs/__schema1"
            }
          },
          "required": [
            "operation",
            "postId",
            "expectedRevision",
            "targetPostId",
            "expectedTargetRevision"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "suggestion_restore"
            },
            "postId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "targetPostId": {
              "$ref": "#/$defs/__schema0"
            },
            "expectedTargetRevision": {
              "$ref": "#/$defs/__schema1"
            },
            "decisionId": {
              "type": "string",
              "pattern": "^feedback_suggestion_decision_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            }
          },
          "required": [
            "operation",
            "postId",
            "expectedRevision",
            "targetPostId",
            "expectedTargetRevision",
            "decisionId"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema1": {
      "type": "string",
      "maxLength": 20,
      "pattern": "^\\d+$"
    },
    "__schema2": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "color": {
          "type": "string",
          "enum": [
            "gray",
            "red",
            "orange",
            "yellow",
            "green",
            "blue",
            "purple",
            "pink"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "public",
            "internal"
          ]
        }
      },
      "required": [
        "name",
        "color"
      ],
      "additionalProperties": false
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/__schema0"
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  }
}
JSON

Refus et reprise

Les statuts documentés pour cette opération sont 400, 401, 402, 403, 404, 409, 428, 429, 500, 503. Identifiez la cause avec error.code et, lorsqu’il est présent, error.reason. Une réponse 409 peut demander une relecture de révision ou signaler une commande incompatible ; une réponse 428 demande une confirmation humaine. Ne rejouez une écriture que selon son contrat.

Notes du contrat
JSON
{
  "description": "Dedicated API OAuth api:connect and the stated Feedback scope, actual delegated teammate, current organization/product consent and native role. Existing organization keys do not acquire these operations. Every admission consumes an API request. Send a stable Idempotency-Key and exactly the same body on uncertain-response retry; effect and durable actor/product/transport receipt commit together. Same key with changed data or stale expected post/comment/view state returns 409. Replay revalidates authority and never reapplies old effects. Requires native human confirmation: a 428 confirmation_required returns confirmationUrl/id. Open it in the authorizing human session, review the exact input and approve. Retry this exact body/key with X-Khony-Confirmation: confirmationId within five minutes. Session, grant, action, product, input and key are bound by the server. A model boolean is never approval. Native administrator status/properties/assignment/visibility/lock/thread and suggestion decision rules. All affected resources belong to the selected product. Public/internal thread changes preserve descendants and internal parents."
}
JSON