POST · Modifier

Roadmaps : Modifier. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Roadmaps

POST /api/v1/roadmaps/command

operationId : roadmap_command

Accès

Permission

Consentements OAuth

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

roadmap.update

api:connect, roadmap:write

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

Non

string ; uuid

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

idempotencyKey

JSON

Oui

string ; uuid

Variantes de la requête

Sélecteur

Valeur

Autres champs requis dans request

request.type

"create"

name, description, isPublic

request.type

"update"

roadmapId, expectedRevision, name, description, isPublic

request.type

"replace_items"

roadmapId, expectedRevision, items

request.type

"move_item"

roadmapId, expectedRevision, postId, columnId, position

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/roadmaps/command" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Idempotency-Key: 0198f886-9f71-7000-8000-000000000010' \
  --header 'X-Khony-Confirmation: 0198f886-9f71-7000-8000-000000000011' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "idempotencyKey": "0198f886-9f71-7000-8000-000000000010",
  "request": {
    "type": "create",
    "name": "Delivery",
    "description": "Confirmed work",
    "isPublic": true
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": {
    "id": "roadmap_01k3w8d7vhe008000000000002",
    "isPublic": true,
    "revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "deleted": false
  }
}
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": {
            "type": {
              "type": "string",
              "const": "create"
            },
            "name": {
              "$ref": "#/$defs/__schema0"
            },
            "description": {
              "$ref": "#/$defs/__schema1"
            },
            "isPublic": {
              "$ref": "#/$defs/__schema2"
            },
            "columns": {
              "$ref": "#/$defs/__schema3"
            },
            "filters": {
              "$ref": "#/$defs/__schema10"
            }
          },
          "required": [
            "type",
            "name",
            "description",
            "isPublic"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "update"
            },
            "roadmapId": {
              "$ref": "#/$defs/__schema11"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema12"
            },
            "name": {
              "$ref": "#/$defs/__schema0"
            },
            "description": {
              "$ref": "#/$defs/__schema1"
            },
            "isPublic": {
              "$ref": "#/$defs/__schema2"
            },
            "columns": {
              "$ref": "#/$defs/__schema3"
            },
            "filters": {
              "$ref": "#/$defs/__schema10"
            },
            "columnMoves": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_-]{1,80}$"
              },
              "additionalProperties": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_-]{1,80}$"
              }
            }
          },
          "required": [
            "type",
            "roadmapId",
            "expectedRevision",
            "name",
            "description",
            "isPublic"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "replace_items"
            },
            "roadmapId": {
              "$ref": "#/$defs/__schema11"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema12"
            },
            "items": {
              "maxItems": 5000,
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema13"
              }
            }
          },
          "required": [
            "type",
            "roadmapId",
            "expectedRevision",
            "items"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "move_item"
            },
            "roadmapId": {
              "$ref": "#/$defs/__schema11"
            },
            "expectedRevision": {
              "$ref": "#/$defs/__schema12"
            },
            "postId": {
              "type": "string",
              "pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            },
            "columnId": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]{1,80}$"
            },
            "position": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            }
          },
          "required": [
            "type",
            "roadmapId",
            "expectedRevision",
            "postId",
            "columnId",
            "position"
          ],
          "additionalProperties": false
        }
      ]
    },
    "idempotencyKey": {
      "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": [
    "productId",
    "request",
    "idempotencyKey"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "minLength": 2,
      "maxLength": 80
    },
    "__schema1": {
      "type": "string",
      "maxLength": 500
    },
    "__schema2": {
      "type": "boolean"
    },
    "__schema3": {
      "minItems": 1,
      "maxItems": 20,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema4"
      }
    },
    "__schema4": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_-]{1,80}$"
        },
        "name": {
          "type": "string",
          "maxLength": 80
        },
        "status": {
          "type": "string",
          "enum": [
            "new",
            "in_review",
            "planned",
            "completed",
            "closed"
          ]
        },
        "icon": {
          "default": {
            "type": "default"
          },
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "default"
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "icon"
                },
                "value": {
                  "type": "string",
                  "enum": [
                    "circle",
                    "clock",
                    "lightbulb",
                    "flag",
                    "rocket",
                    "check",
                    "star",
                    "wrench",
                    "code",
                    "chart"
                  ]
                }
              },
              "required": [
                "type",
                "value"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "emoji"
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 32
                }
              },
              "required": [
                "type",
                "value"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "image"
                },
                "value": {
                  "type": "string",
                  "pattern": "^\\/api\\/roadmap-icons\\/[a-f0-9-]{36}\\/[a-f0-9-]{36}$"
                }
              },
              "required": [
                "type",
                "value"
              ]
            }
          ]
        },
        "color": {
          "type": "string",
          "pattern": "^#[a-fA-F0-9]{6}$"
        },
        "filters": {
          "$ref": "#/$defs/__schema5"
        }
      },
      "required": [
        "id",
        "name",
        "status"
      ],
      "additionalProperties": false
    },
    "__schema5": {
      "type": "object",
      "properties": {
        "selection": {
          "type": "string",
          "enum": [
            "manual",
            "automatic"
          ]
        },
        "boardIds": {
          "maxItems": 100,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema6"
          }
        },
        "tagIds": {
          "maxItems": 100,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema7"
          }
        },
        "tagMatch": {
          "type": "string",
          "enum": [
            "any",
            "all"
          ]
        },
        "statuses": {
          "maxItems": 5,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema8"
          }
        },
        "sources": {
          "maxItems": 5,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema9"
          }
        },
        "dateField": {
          "type": "string",
          "enum": [
            "created",
            "updated",
            "target"
          ]
        },
        "dateFrom": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "dateTo": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "minVotes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000000
        },
        "minRequesters": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000000
        },
        "minInsights": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000000
        },
        "sort": {
          "type": "string",
          "enum": [
            "manual",
            "recent",
            "newest",
            "oldest",
            "votes",
            "requesters",
            "insights",
            "title"
          ]
        }
      },
      "additionalProperties": false
    },
    "__schema6": {
      "type": "string",
      "pattern": "^board_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema7": {
      "type": "string",
      "pattern": "^tag_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema8": {
      "type": "string",
      "enum": [
        "new",
        "in_review",
        "planned",
        "completed",
        "closed"
      ]
    },
    "__schema9": {
      "type": "string",
      "enum": [
        "portal",
        "widget",
        "internal",
        "api",
        "import"
      ]
    },
    "__schema10": {
      "$ref": "#/$defs/__schema5"
    },
    "__schema11": {
      "type": "string",
      "pattern": "^roadmap_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema12": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "__schema13": {
      "type": "object",
      "properties": {
        "postId": {
          "type": "string",
          "pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "columnId": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_-]{1,80}$"
        },
        "position": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000
        },
        "targetDate": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "changeReason": {
          "type": "string",
          "maxLength": 500
        }
      },
      "required": [
        "postId",
        "columnId",
        "position"
      ],
      "additionalProperties": false
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^roadmap_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "isPublic": {
          "type": "boolean"
        },
        "revision": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "deleted": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "isPublic",
        "revision",
        "deleted"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}
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 plus the explicit Roadmap scope and current native human product authority; technical keys/cookies are refused. Native organization/product, API entitlement, billing and request admission apply. Requires runtime-verified human confirmation (HTTP 428 handshake); a model boolean is never approval. Send a stable UUID idempotencyKey and matching Idempotency-Key header, exactly the same arguments on retry. Actor/transport/product/input-bound SQL receipt and native effects commit together. Current authorities and private-roadmap entitlement are rechecked before replay, including after target deletion. Read detail/items for expectedRevision; a stale revision conflicts. roadmap:write and native administrator. request.type create/update/replace_items/move_item. Private creation/edit requires roadmap.private. Public audience requires roadmap.publish; create additionally requires roadmap.create. Column changes and placements additionally require feedback.update: their native path changes the shared Feedback status and emits native history, commitment facts and outbox. Manual placement operations reject automatic roadmaps. replace_items is the complete desired manual membership, not an append; omitted targetDate clears it as in the native UI. Update preserves omitted filters/columns; columnMoves transfers occupied removed columns. Native text description remains text, maximum 500 characters."
}
JSON