LoguDocs
Open Logu

Rules · listRules

List rules

GET /v1/rules

The workspace's rules, newest first, each with its uses and status (active, expired, used_up, or inactive once its creator is no longer an Owner). Owners only.

Who may call it
humans: Owners and up
Server
https://api.logu.dev

Parameters#

NameInTypeRequiredDescription
Logu-WorkspaceheaderstringoptionalHumans only: the workspace to act in (default: your personal workspace). Agents always act in their API key's workspace. · e.g. wsp_01K7D7Y8Z0B2D4F6H8K0M2P4R6

Example#

curl -s "https://api.logu.dev/v1/rules" \
  -H "Authorization: Bearer $LOGU_SESSION_TOKEN"

Responses#

200

Rules.

{
  "rules": [
    {
      "id": "rul_01K7DC7G9J1L3N5Q7S9U1W3Y5A",
      "projectId": "prj_01K7D9A1C3E5G7J9L1N3Q5S7U9",
      "project": "shop",
      "agent": {
        "id": "agt_01K7D8F2H4K6M8P0R2T4V6X8Z0",
        "name": "deploy-bot"
      },
      "title": "Deploy v1.4 to staging?",
      "optionId": "approve",
      "expiresAt": "2026-11-12T14:00:00.000Z",
      "maxUses": 20,
      "uses": 3,
      "lastUsedAt": "2026-10-12T14:05:42.000Z",
      "status": "active",
      "createdBy": {
        "id": "Xq3bY7tLmN2pR8sV",
        "name": "Ana"
      },
      "createdAt": "2026-10-12T14:03:11.000Z"
    }
  ]
}
Response fields
FieldTypeRequiredNotes
rulesobject[]required
rules[].idstringrequired
rules[].projectIdstringrequired
rules[].projectstringrequired
rules[].agentAgentRefrequired
rules[].agent.idstringrequired
rules[].agent.namestringrequired
rules[].titlestring | nullrequired
rules[].optionIdstringrequired
rules[].expiresAtstring | nullrequireddate-time
rules[].maxUsesinteger | nullrequired
rules[].usesintegerrequired
rules[].lastUsedAtstring | nullrequireddate-time
rules[].status"active" | "expired" | "used_up" | "inactive"required
rules[].createdByMemberRef | nullrequired
rules[].createdBy.idstringrequired
rules[].createdBy.namestringrequired
rules[].createdAtstringrequireddate-time

Errors#

Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.

StatusCodeMeaning
401unauthorizedNo credentials, or the API key or session is invalid or revoked.
403forbiddenThe caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint).
404not_foundNo such route, or the resource doesn't exist in your workspace.
500internal_errorSomething went wrong on Logu's side.