{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/evictionsapi-com/json-schema/evictionsapi-com-case-for-attorney-schema.json",
  "title": "CaseForAttorney",
  "description": "The case as an attorney sees it: the same as `Case`, without `openedBy` and `landlord`.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/evictionsapi-com-api-evictions-openapi.json#/components/schemas/CaseForAttorney",
  "type": "object",
  "required": [
    "id",
    "mode",
    "state",
    "ground",
    "entryPoint",
    "data",
    "deadlines",
    "documents",
    "nextAction"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "mode": {
      "enum": [
        "test",
        "live"
      ]
    },
    "state": {
      "type": "string",
      "description": "Position in the case lifecycle, for example `notice_review` or `filing_submitted`."
    },
    "heldFrom": {
      "type": [
        "string",
        "null"
      ]
    },
    "ground": {
      "type": "string"
    },
    "entryPoint": {
      "enum": [
        "notice",
        "filing"
      ]
    },
    "courtCaseNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "court": {
      "type": [
        "string",
        "null"
      ],
      "description": "The court the case goes to, in words, where the rules for its place say which, with the county: for example \"Magistrate court of Henry County\". `null` where no rule pack covers the place, and for an erased case."
    },
    "packVersions": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      }
    },
    "data": {
      "type": "object",
      "additionalProperties": true
    },
    "deadlines": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "date",
          "citation"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "citation": {
            "type": "string"
          }
        }
      }
    },
    "documents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Document"
      }
    },
    "nextAction": {
      "type": "object",
      "required": [
        "by",
        "description"
      ],
      "properties": {
        "by": {
          "enum": [
            "customer",
            "attorney",
            "platform",
            "court",
            "none"
          ]
        },
        "description": {
          "type": "string"
        }
      }
    },
    "handling": {
      "enum": [
        "automated",
        "attorney_direct",
        "agent_filed"
      ],
      "description": "Who does the legal work. `attorney_direct`: a licensed attorney engaged for the case reviews it, serves the notice and files in court, and the platform records each step; it is what a live case is unless the full-service path is open for its property. `automated`: the built-in test pipeline of a test case. `agent_filed`, the full-service path, as we describe it to the owner: We act as your authorized agent. No attorney reviews the case. We are not a law firm and do not give legal advice. Full service is available only in test mode for now; a case is created with it only when `POST /v1/cases` asks for `service: \"full\"` and that path is open for the property, and it needs the owner's signed authorization (`/v1/cases/{id}/authorization`)."
    },
    "attorney": {
      "type": [
        "object",
        "null"
      ],
      "description": "The attorney engaged for an attorney-direct case, once recorded. Null until then, and always null for a test case.",
      "required": [
        "name",
        "firm",
        "state",
        "barNumber"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "firm": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "description": "The property's state."
        },
        "barNumber": {
          "type": [
            "string",
            "null"
          ],
          "description": "The attorney's bar number in that state."
        }
      }
    },
    "erased": {
      "type": "boolean",
      "description": "Whether the details of the case were erased, which we do case by case on request. An erased case keeps its id, state, dates, deadline names and charges. In `data` the names and the address read `[erased]` (the state and county are kept) and every other fact is gone; `courtCaseNumber` is null; each document keeps its id and `contentHash`, its `filename` reads `[erased]` and downloading it answers 410 `erased`; messages read `[erased]`. Any request that would change the case answers 409 `erased`."
    },
    "erasedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the details were erased. Null for a case that was not erased."
    },
    "sources": {
      "type": "object",
      "description": "Where each answer came from, by field path (`property.line1`, `lease.monthlyRentCents`, `parties.0`, `ledger`): the kind of source, and for a file read the id of the case document it was read from. An answer with no entry was typed. Empty when no answer came from a source. Never holds a value. Send `sources` with `POST /v1/cases` or `PATCH /v1/cases/{id}` to set it (a patch replaces the whole map); a patch that changes an answer without sending `sources` removes that answer's entry.",
      "propertyNames": {
        "pattern": "^(?:property\\.state|property\\.county|property\\.city|property\\.line1|property\\.unit|property\\.zip|property\\.ownerOfRecord|lease\\.startDate|lease\\.endDate|lease\\.monthlyRentCents|lease\\.noticePeriodDays|ledger|amountOwedCents|rentOwedCents|violation\\.description|violation\\.date|priorNotice\\.servedDate|priorNotice\\.method|priorNotice\\.periodDays|plaintiffContact\\.address|plaintiffContact\\.phone|plaintiffContact\\.email|managedContext\\.plaintiffType|parties\\.1?\\d)$"
      },
      "additionalProperties": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "enum": [
              "lease_file",
              "buildium",
              "doorloop",
              "address",
              "ledger_file",
              "messages",
              "agent",
              "email",
              "draft_file",
              "ledger_rows",
              "landlord",
              "organization"
            ]
          },
          "documentId": {
            "type": "string",
            "description": "The case document the answer was read from (`lease_file`, `ledger_file` and `messages` only)."
          }
        }
      }
    },
    "agent": {
      "const": true,
      "description": "Present, and true, only for an agent-filed case (`handling: \"agent_filed\"`): we act as your authorized agent, no attorney reviews the case, and we are not a law firm and do not give legal advice. Every field below appears only with it."
    },
    "authorization": {
      "type": "object",
      "required": [
        "signed",
        "stale"
      ],
      "description": "Whether your authorization for us to act as your agent is signed, and whether the facts changed after it was signed (then nothing more is done until you sign again).",
      "properties": {
        "signed": {
          "type": "boolean"
        },
        "stale": {
          "type": "boolean"
        }
      }
    },
    "complaintSignature": {
      "type": "object",
      "required": [
        "required",
        "signed"
      ],
      "description": "Whether the court requires the owner to sign the complaint, and whether the current complaint is signed. While it is required and unsigned, the case waits in `filing_approved`. `sworn` (true when present): the filing is an affidavit your named person swears under oath by electronic verification in the app. `signer`: the member the case names to sign it, by user id and the name the filing prints; only that person can sign.",
      "properties": {
        "required": {
          "type": "boolean"
        },
        "signed": {
          "type": "boolean"
        },
        "sworn": {
          "const": true
        },
        "signer": {
          "type": "object",
          "required": [
            "userId",
            "name"
          ],
          "properties": {
            "userId": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        }
      }
    },
    "paymentMethodId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The organization's saved card (`GET /v1/payment-methods`) this case's costs are charged to, or null for the default card. Choose it with `PATCH /v1/cases/{id}`. A chosen card that is removed or declined is not charged: the default card is used instead."
    },
    "tasks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Task"
      },
      "description": "Each outward step of the case, oldest first (as `GET /v1/cases/{id}/tasks`)."
    },
    "checking": {
      "type": "object",
      "required": [
        "stage",
        "since"
      ],
      "description": "Present while we check what the next step sends before it is sent (we check every notice, filing and summons for now): `notice` (the notice to the tenant), `filing` (the court filing) or `summons`. Nothing is sent, and nothing is charged for that step, until it is checked.",
      "properties": {
        "stage": {
          "enum": [
            "notice",
            "filing",
            "summons"
          ]
        },
        "since": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "sentBack": {
      "type": "object",
      "required": [
        "stage",
        "note",
        "at"
      ],
      "description": "Present while the case is on hold because we checked a step before sending it and sent the case back to you: nothing was sent. `note` says why; reply by email, or withdraw the case.",
      "properties": {
        "stage": {
          "enum": [
            "notice",
            "filing",
            "summons"
          ]
        },
        "note": {
          "type": "string"
        },
        "at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "claim": {
      "type": "object",
      "required": [
        "claimRent",
        "amountClaimedCents"
      ],
      "description": "What the complaint asks the court for besides possession: unpaid rent, where the court lets us claim it as your agent, up to the court's limit where it has one.",
      "properties": {
        "claimRent": {
          "type": "boolean"
        },
        "amountClaimedCents": {
          "type": "integer",
          "description": "US cents. Zero when no rent is claimed."
        }
      }
    },
    "hearing": {
      "type": "object",
      "required": [
        "date",
        "time",
        "place",
        "court",
        "clientAttends"
      ],
      "description": "The hearing, once the court has set one (or moved it): where the court requires the owner to attend in person (`clientAttends`), you must attend it yourself.",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "time": {
          "type": [
            "string",
            "null"
          ],
          "description": "The court's local time, HH:MM, when known."
        },
        "place": {
          "type": [
            "string",
            "null"
          ],
          "description": "Where the court sits for the hearing, when known."
        },
        "court": {
          "type": [
            "string",
            "null"
          ]
        },
        "clientAttends": {
          "type": "boolean"
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "Document": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "filename",
        "contentHash"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "evidence",
            "notice",
            "filing",
            "proof",
            "other"
          ]
        },
        "specId": {
          "type": [
            "string",
            "null"
          ]
        },
        "purpose": {
          "enum": [
            "authority",
            "prior_notice",
            "prior_notice_proof",
            "other",
            "lease",
            "ledger",
            "correspondence",
            null
          ],
          "description": "What an uploaded file (`kind: \"evidence\"`) is for, as given with the upload. Null for documents the platform or the attorney adds, and for files uploaded before purposes were kept."
        },
        "filename": {
          "type": "string"
        },
        "contentType": {
          "enum": [
            "application/pdf",
            "image/jpeg",
            "image/png",
            "text/plain"
          ],
          "description": "Decided from the file's first bytes when it was stored, never from its name. `text/plain` only for a `correspondence` document that is plain text (the body of a forwarded email)."
        },
        "contentHash": {
          "type": "string",
          "description": "SHA-256 of the document bytes. An attorney approval names these."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Task": {
      "type": "object",
      "description": "One outward step of a full-service case (`handling: \"agent_filed\"`): delivering the notice, filing, ordering the summons, attending the hearing, a signature from the owner, or mail from the court.",
      "required": [
        "kind",
        "status",
        "dueAt",
        "completedAt"
      ],
      "properties": {
        "kind": {
          "enum": [
            "notice_delivery",
            "filing",
            "summons_order",
            "hearing_appearance",
            "client_signature",
            "court_mail"
          ]
        },
        "status": {
          "enum": [
            "pending",
            "in_progress",
            "done",
            "failed",
            "cancelled"
          ]
        },
        "dueAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the step must be done by, when there is a deadline."
        },
        "completedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}