레퍼런스HTTP APIWorkspace settings

Edit an achievement rule as its next version

POST
/v1/achievement-rules/{family_id}/versions

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.

Authorization

cookieSession
cookie__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.

Path Parameters

family_id*string

The rule family's id: every version of one rule shares it.

Match^([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)$
Formatuuid

Header Parameters

X-Requested-With?"werft-web"

Required with a cookie session: the literal werft-web.

Value in"werft-web"

Request Body

application/json
  1. body
category_id*string
Match^([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)$
Formatuuid
title*string
Length1 <= length <= 80
type_id*string
Match^([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)$
Formatuuid
definition*string
Length1 <= length <= 2000
judge*string
Value in"always""luna"
agent_ids?null
Defaultnull

Response Body

The new version, and its receipt.

application/json
  1. response
rule*
receipt_id*|null
Example Request
curl -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"}'
Example Response
{  "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"}