Edit an achievement rule as its next version
Owners and admins (achievement_rule.manage), signed in; API keys are refused. The body is the whole rule, as for a new one. A rule's rows never change: this makes version + 1 under a new id and sets the previous version's superseded_by to it; achievements already counted keep pointing at the version they were judged by. A disabled rule's new version is disabled too. 400 and 409 type_in_use as for a new rule; two edits at once are saved one after the other, each as its own version. Writes an update_achievement_rule receipt with the new and previous version ids, never the definition. Another workspace's rule is 404.
Auth: cookie session only; no scope. Idempotency-Key: ignored.
cookieSession__Host-werft_session<token>For the web console: the browser session cookie set by POST /v1/auth/login. It holds the scopes of the user's workspace role (owner: all; admin and member: all but sessions:recover). Requests other than GET must also send X-Requested-With: werft-web.
family_id*stringThe rule family's id: every version of one rule shares it.
^([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)$uuidX-Requested-With?"werft-web"Required with a cookie session: the literal werft-web.
"werft-web"application/json- body
category_id*string^([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)$uuidtitle*string1 <= length <= 80type_id*string^([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)$uuiddefinition*string1 <= length <= 2000judge*string"always""luna"agent_ids?nullnullThe new version, and its receipt.
application/json- response
rule*receipt_id*|nullcurl -X POST 'https://example.com/v1/achievement-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions' \ -H 'Content-Type: application/json' \ -d '{ "category_id": "5b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e", "title": "Design doc merged", "type_id": "6c2f3d4e-5a6b-4c7d-9e8f-0a1b2c3d4e5f", "definition": "A design document for a change the session made: it says what changes and why.", "judge": "luna"}'{ "rule": { "id": "9f5c6a7b-8d9e-4f0a-8b1c-3d4e5f6a7b82", "family_id": "8e4b5f6a-7c8d-4e9f-9a0b-2c3d4e5f6a71", "version": 2, "category_id": "5b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e", "title": "Design doc merged", "type_id": "6c2f3d4e-5a6b-4c7d-9e8f-0a1b2c3d4e5f", "definition": "A design document for a change the session made: it says what changes and why.", "judge": "luna", "agent_ids": null, "created_by": "3e7f1a90-5c2d-4b8e-8f61-2a9d0c4b7e35", "created_at": "2026-11-02T01:00:00.000Z", "superseded_by": null, "disabled_at": null, "disabled_by": null }, "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}