リファレンスHTTP APIWorkspace settings

Make an achievement rule

POST
/v1/achievement-rules

Owners and admins (achievement_rule.manage), signed in; API keys are refused. Version 1 of a new rule. category_id and type_id name a category and a type of the workspace that are not archived (400, details.reason_code: unknown_category or unknown_type); agent_ids takes only null. A type is counted by one rule in use at a time: a type another rule in use counts is 409 REVISION_CONFLICT with details.reason_code: type_in_use. A workspace has at most 30 rules in use (details.reason_code: limit_reached). Writes a create_achievement_rule receipt naming the rule's id, family and version, never its definition.

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.

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

Version 1, and its receipt.

application/json
  1. response
rule*
receipt_id*|null
Example Request
curl -X POST 'https://example.com/v1/achievement-rules' \  -H 'Content-Type: application/json' \  -d '{  "category_id": "5b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e",  "title": "Design doc written",  "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": "7d3a4e5f-6b7c-4d8e-8f9a-1b2c3d4e5f60",    "family_id": "8e4b5f6a-7c8d-4e9f-9a0b-2c3d4e5f6a71",    "version": 1,    "category_id": "5b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e",    "title": "Design doc written",    "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"}