{"openapi":"3.1.0","info":{"title":"Evictions API","version":"0.0.0","description":"Submit and track an eviction case for a rental property in any US state or DC. Evictions API is not a law firm and does not give legal advice. After a live case is submitted we engage a licensed attorney in the property's state for it; nothing is served on a tenant or filed in court until that attorney has reviewed the case, and the attorney serves and files through their own accounts while the case shows its status, documents, deadlines, messages and charges. Test mode is free, uses a fictional state (ZZ) and never touches a real tenant or court: a built-in sandbox reviewer approves test cases automatically once they enter review, and `POST /v1/cases/{id}/advance` moves a test case on one step at a time. A request in live mode on a server where live mode is off answers 403 `live_unavailable`. POST requests accept an `Idempotency-Key` header.","contact":{"email":"hello@evictionsapi.com"}},"servers":[{"url":"https://api.evictionsapi.com"}],"externalDocs":{"url":"https://evictionsapi.com/docs"},"paths":{"/v1/health":{"get":{"summary":"Liveness check","security":[],"responses":{"200":{"description":"The service is up.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}}}},"/v1/openapi.json":{"get":{"summary":"This OpenAPI document","security":[],"responses":{"200":{"description":"The OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/jurisdictions/resolve":{"get":{"summary":"Whether a jurisdiction is served, and its notice rules","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}},{"name":"county","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Served status, `handling`, jurisdiction ids and the grounds. In live mode every US state and DC is served with `handling: \"attorney_direct\"`, `action: null` and, for each ground, `notice: null` and the facts intake requires (`requiredFacts`); anything else is `served: false`. In test mode (`handling: \"automated\"`) the sandbox jurisdiction answers with its notice rules for each ground.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases":{"post":{"summary":"Create a draft case. In live mode the property must be in a US state or DC (422 `unsupported_state`) and the case is an attorney-direct case","security":[{"ApiKey":[]},{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ground":{"type":"string","enum":["nonpayment","lease_violation","holdover"]},"entryPoint":{"type":"string","enum":["notice","filing"]},"property":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":200},"unit":{"type":"string","minLength":1,"maxLength":50},"city":{"type":"string","minLength":1,"maxLength":100},"county":{"type":"string","minLength":1,"maxLength":100},"state":{"type":"string","pattern":"^[A-Za-z]{2}$"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$"},"ownerOfRecord":{"type":"string","minLength":1,"maxLength":200}},"required":["line1","city","state","zip","ownerOfRecord"],"additionalProperties":false},"parties":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["plaintiff","defendant"]},"name":{"type":"string","minLength":1,"maxLength":200},"isEntity":{"type":"boolean"}},"required":["role","name"],"additionalProperties":false}},"lease":{"type":"object","properties":{"startDate":{"type":"string"},"endDate":{"type":"string"},"monthlyRentCents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"ledger":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"type":{"type":"string","enum":["charge","payment"]},"amountCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"memo":{"type":"string","minLength":1,"maxLength":500}},"required":["date","type","amountCents"],"additionalProperties":false}},"amountOwedCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"violation":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":5000},"date":{"type":"string"}},"required":["description","date"],"additionalProperties":false},"attestations":{"type":"object","properties":{"authority":{"type":"boolean"},"notRetaliatory":{"type":"boolean"},"notDiscriminatory":{"type":"boolean"},"servicemember":{"type":"string","enum":["no","yes","unknown"]},"caresCovered":{"type":"boolean"},"subsidized":{"type":"boolean"}},"additionalProperties":false},"priorNotice":{"type":"object","properties":{"servedDate":{"type":"string"},"method":{"type":"string","enum":["personal","substitute","posting","certified_mail","first_class_mail"]},"periodDays":{"type":"integer","minimum":1,"maximum":365}},"required":["servedDate","method","periodDays"],"additionalProperties":false},"freeText":{"type":"string","maxLength":5000}},"required":["ground","entryPoint","property","parties","attestations"],"additionalProperties":false}}}},"responses":{"201":{"description":"The draft case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List the cases of the key's organization and mode","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":512}},{"name":"limit","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{1,9}$"}}],"responses":{"200":{"description":"A page of cases, newest first.","content":{"application/json":{"schema":{"type":"object","required":["items","nextCursor"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Case"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}":{"get":{"summary":"Get a case","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Change the facts of a draft case","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ground":{"type":"string","enum":["nonpayment","lease_violation","holdover"]},"entryPoint":{"type":"string","enum":["notice","filing"]},"property":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":200},"unit":{"type":"string","minLength":1,"maxLength":50},"city":{"type":"string","minLength":1,"maxLength":100},"county":{"type":"string","minLength":1,"maxLength":100},"state":{"type":"string","pattern":"^[A-Za-z]{2}$"},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$"},"ownerOfRecord":{"type":"string","minLength":1,"maxLength":200}},"required":["line1","city","state","zip","ownerOfRecord"],"additionalProperties":false},"parties":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["plaintiff","defendant"]},"name":{"type":"string","minLength":1,"maxLength":200},"isEntity":{"type":"boolean"}},"required":["role","name"],"additionalProperties":false}},"lease":{"type":"object","properties":{"startDate":{"type":"string"},"endDate":{"type":"string"},"monthlyRentCents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false},"ledger":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"type":{"type":"string","enum":["charge","payment"]},"amountCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"memo":{"type":"string","minLength":1,"maxLength":500}},"required":["date","type","amountCents"],"additionalProperties":false}},"amountOwedCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"violation":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":5000},"date":{"type":"string"}},"required":["description","date"],"additionalProperties":false},"attestations":{"type":"object","properties":{"authority":{"type":"boolean"},"notRetaliatory":{"type":"boolean"},"notDiscriminatory":{"type":"boolean"},"servicemember":{"type":"string","enum":["no","yes","unknown"]},"caresCovered":{"type":"boolean"},"subsidized":{"type":"boolean"}},"additionalProperties":false},"priorNotice":{"type":"object","properties":{"servedDate":{"type":"string"},"method":{"type":"string","enum":["personal","substitute","posting","certified_mail","first_class_mail"]},"periodDays":{"type":"integer","minimum":1,"maximum":365}},"required":["servedDate","method","periodDays"],"additionalProperties":false},"freeText":{"type":"string","maxLength":5000}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/documents":{"post":{"summary":"Upload evidence for a draft case: a PDF, JPEG or PNG, decided by the file's contents (415 `unsupported_media_type` otherwise, for a live case). For a live case, `purpose: \"other\"` files can also be added after submission, until the case is finished","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"purpose":{"type":"string","enum":["authority","prior_notice","prior_notice_proof","other"]},"contentBase64":{"type":"string","minLength":1}},"required":["filename","purpose","contentBase64"],"additionalProperties":false}}}},"responses":{"201":{"description":"The stored document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/documents/{docId}":{"get":{"summary":"Download a document of the case","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"docId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The document bytes, with the stored `Content-Type`: `application/pdf`, `image/jpeg` or `image/png`.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/validate":{"post":{"summary":"Run the submission gates on a draft","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The gate results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateResults"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/submit":{"post":{"summary":"Submit a draft that passes every gate. A live case moves to `submitted`, its platform fee becomes a due charge, and we engage a licensed attorney in the property's state; nothing is served or filed until that attorney has reviewed it. A test case enters the sandbox review","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case after submission, and the gate results.","content":{"application/json":{"schema":{"type":"object","required":["case","gates"],"properties":{"case":{"$ref":"#/components/schemas/Case"},"gates":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/events":{"get":{"summary":"Customer-visible events of the case, oldest first","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The events.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/report-cure":{"post":{"summary":"Report that the tenant has paid or cured. For a live case the report is recorded and passed on to the attorney; the case is not closed automatically","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/withdraw":{"post":{"summary":"Withdraw the case. A live case with an attorney already engaged goes `on_hold` with a `withdrawal_requested` event instead, and is withdrawn once the attorney has confirmed that all work has stopped","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case: withdrawn, or on hold while the withdrawal is confirmed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/charges":{"get":{"summary":"The charges on the case, oldest first, and whether online payment is available","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The charges. `paymentsEnabled` false: charges show as due and `checkout` answers 409 `payments_unavailable`.","content":{"application/json":{"schema":{"type":"object","required":["items","paymentsEnabled"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Charge"}},"paymentsEnabled":{"type":"boolean"}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/charges/{chargeId}/checkout":{"post":{"summary":"Open a hosted checkout for one due charge. 409 `payments_unavailable` when online payment is off; 409 `charge_not_due` when the charge is paid, void or refunded","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"chargeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The checkout URL to send the customer to. They return to the case page on the website.","content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/charges/{chargeId}/confirm":{"post":{"summary":"Check with the payment provider whether the charge's checkout was paid, and record it if so. Safe to repeat. 409 `payments_unavailable` when online payment is off","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"chargeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The charge as it now is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/notes":{"get":{"summary":"The messages on the case: the customer's own and ours, oldest first","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The messages.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Note"}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Send us a message about a live case. 409 `attorney_direct_only` for a test case. At most 20 every 10 minutes per organization (429 `rate_limited`)","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"The stored message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cases/{id}/advance":{"post":{"summary":"Sandbox only: move a test case on by one step. Runs the step the case is waiting for now (the sandbox reviewer's review, a service or filing update, or the end of the notice period on the case's own sandbox clock), or records the next court outcome as the sandbox reviewer. A live case (nothing about a real case is ever advanced automatically), or a case outside the sandbox jurisdiction, gets 409 `sandbox_only`; a draft, a case on hold or a finished case gets 409 `nothing_to_advance`, as does a step whose last try failed, until its automatic retry (`error.details.retryAt`). While the step is already being taken, the case is returned as it is. At most 60 a minute per organization (429 `rate_limited`)","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case after the step.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints":{"post":{"summary":"Register a webhook endpoint","security":[{"ApiKey":[]},{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["url"],"additionalProperties":false}}}},"responses":{"201":{"description":"The endpoint. The signing secret appears in this response only. An `Idempotency-Key` header is ignored: every request creates an endpoint, and no response is stored or replayed.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List the organization's webhook endpoints in the credential's mode. The signing secret is never shown again","security":[{"ApiKey":[]},{"SessionToken":[]}],"responses":{"200":{"description":"The endpoints, oldest first.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","mode","createdAt"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"enum":["test","live"]},"createdAt":{"type":"string","format":"date-time"}}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys":{"get":{"summary":"List the organization's API keys in the credential's mode, newest first, revoked ones included. The secret is never shown again","security":[{"ApiKey":[]},{"SessionToken":[]}],"responses":{"200":{"description":"The keys, each with the last four characters of its secret (null for a key created before they were recorded) and when it was revoked, if it was.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","mode","createdAt","lastFour","revokedAt"],"properties":{"id":{"type":"string"},"mode":{"enum":["test","live"]},"createdAt":{"type":"string","format":"date-time"},"lastFour":{"type":["string","null"]},"revokedAt":{"type":["string","null"],"format":"date-time"}}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an API key in the credential's mode. A live key can be created only by an owner of the organization, signed in with a session and `X-Evictions-Mode: live` (403 `forbidden` otherwise, also for a live API key); at most 10 active keys per mode (409 `key_limit`)","security":[{"ApiKey":[]},{"SessionToken":[]}],"responses":{"201":{"description":"The new key. The secret appears in this response only. An `Idempotency-Key` header is ignored: every request creates a key, and no response is stored or replayed.","content":{"application/json":{"schema":{"type":"object","required":["id","mode","secret"],"properties":{"id":{"type":"string"},"mode":{"enum":["test","live"]},"secret":{"type":"string","description":"The API key (`eak_test_...` or `eak_live_...`), shown here only."}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys/{id}":{"delete":{"summary":"Revoke an API key of the organization and the credential's mode. A key cannot revoke itself (409 `cannot_revoke_current_key`)","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"The key is revoked and no longer authenticates. Revoking a revoked key is also 204."},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}":{"delete":{"summary":"Delete a webhook endpoint. Deliveries still waiting to be retried for it are dropped","security":[{"ApiKey":[]},{"SessionToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"The endpoint and its delivery log are deleted."},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization":{"get":{"summary":"The caller's organization and its members","security":[{"ApiKey":[]},{"SessionToken":[]}],"responses":{"200":{"description":"The organization and its members.","content":{"application/json":{"schema":{"type":"object","required":["id","name","verified","members"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"verified":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","required":["id","name","email","role"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"enum":["owner","member","attorney","platform_admin"]}}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Rename the organization. Only an owner, signed in with a session; an API key or a plain member gets 403","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"The organization after the change.","content":{"application/json":{"schema":{"type":"object","required":["id","name","verified","members"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"verified":{"type":"boolean"},"members":{"type":"array","items":{"type":"object","required":["id","name","email","role"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"enum":["owner","member","attorney","platform_admin"]}}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attorney/queue":{"get":{"summary":"Cases awaiting the attorney's review, and assigned cases that need attention","security":[{"AttorneyToken":[]}],"responses":{"200":{"description":"Cases in notice or filing review, and open cases on hold or with a failed job, oldest first.","content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AttorneyQueueItem"}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attorney/cases/{id}":{"get":{"summary":"A case with its documents, evidence, gate results, filings, service attempts and full audit trail; the access is audited","security":[{"AttorneyToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The case in attorney detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttorneyCase"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attorney/cases/{id}/documents/{docId}":{"get":{"summary":"Download a document; the access is audited","security":[{"AttorneyToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"docId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The document bytes.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attorney/cases/{id}/reviews":{"post":{"summary":"Approve, reject or request changes, naming the document hashes reviewed","security":[{"AttorneyToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject","request_changes"]},"notes":{"type":"string","minLength":1,"maxLength":5000},"documentHashes":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"required":["decision","documentHashes"],"additionalProperties":false}}}},"responses":{"200":{"description":"The case after the decision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attorney/cases/{id}/outcomes":{"post":{"summary":"Record a court outcome","security":[{"AttorneyToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"hearing_scheduled"},"date":{"type":"string"}},"required":["type","date"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"judgment"},"outcome":{"type":"string","enum":["plaintiff","defendant","dismissed"]}},"required":["type","outcome"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"writ_requested"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"writ_issued"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"closed"}},"required":["type"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"The case after the outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Case"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/signup":{"post":{"summary":"Create an account: an unverified customer organization, its owner and a session. No credential; the website calls this from its servers","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"organizationName":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":10,"maxLength":200}},"required":["name","organizationName","email","password"],"additionalProperties":false}}}},"responses":{"201":{"description":"The new session, user and organization. An `Idempotency-Key` header is ignored.","content":{"application/json":{"schema":{"type":"object","required":["token","user","organization","modes"],"properties":{"token":{"type":"string","description":"A session token (`ess_...`), shown here only. Send it as `Authorization: Bearer`."},"user":{"type":"object","required":["id","name","email","role"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"enum":["owner","member","attorney","platform_admin"]}}},"organization":{"type":"object","required":["id","name","verified"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"verified":{"type":"boolean"}}},"modes":{"type":"object","required":["test","live"],"description":"The modes this server offers. `test` is always true.","properties":{"test":{"type":"boolean"},"live":{"type":"boolean"}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign-in only: the email or password is incorrect (one fixed answer for both).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Sign-up only: an account with that email already exists (`email_taken`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many sign-up and sign-in attempts from this address: at most 10 every 10 minutes. `Retry-After` gives the seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`busy`: too many password checks are waiting. Nothing was created or changed. `Retry-After: 5` gives the seconds to wait; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/login":{"post":{"summary":"Sign in with email and password. A wrong email and a wrong password get the identical `invalid_credentials` answer","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":254},"password":{"type":"string","minLength":1,"maxLength":200}},"required":["email","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"A new session, with the user and organization. An `Idempotency-Key` header is ignored.","content":{"application/json":{"schema":{"type":"object","required":["token","user","organization","modes"],"properties":{"token":{"type":"string","description":"A session token (`ess_...`), shown here only. Send it as `Authorization: Bearer`."},"user":{"type":"object","required":["id","name","email","role"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"enum":["owner","member","attorney","platform_admin"]}}},"organization":{"type":"object","required":["id","name","verified"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"verified":{"type":"boolean"}}},"modes":{"type":"object","required":["test","live"],"description":"The modes this server offers. `test` is always true.","properties":{"test":{"type":"boolean"},"live":{"type":"boolean"}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Sign-in only: the email or password is incorrect (one fixed answer for both).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Sign-up only: an account with that email already exists (`email_taken`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many sign-up and sign-in attempts from this address: at most 10 every 10 minutes. `Retry-After` gives the seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`busy`: too many password checks are waiting. Nothing was created or changed. `Retry-After: 5` gives the seconds to wait; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/logout":{"post":{"summary":"Revoke the session in use","security":[{"SessionToken":[]}],"responses":{"204":{"description":"The session is revoked."},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/password-reset/request":{"post":{"summary":"Ask for a password reset link by email. No credential. The answer is the same whether or not the address has an account","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":254}},"required":["email"],"additionalProperties":false}}}},"responses":{"202":{"description":"The request was accepted. If the address belongs to an account that signs in to the site, a single-use link valid for one hour was emailed to it. One account is sent at most 3 such emails an hour: a request beyond that gets this same answer and sends nothing. An `Idempotency-Key` header is ignored.","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many password reset requests from this address: at most 10 every 10 minutes, counting both reset endpoints. `Retry-After` gives the seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/password-reset/confirm":{"post":{"summary":"Set a new password with the token from a reset link. No credential. The token works once; every session of the user is revoked","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200},"password":{"type":"string","minLength":10,"maxLength":200}},"required":["token","password"],"additionalProperties":false}}}},"responses":{"200":{"description":"The password was changed and every session of the user was revoked. Sign in again with the new password. An `Idempotency-Key` header is ignored.","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"const":true}}}}}},"400":{"description":"`invalid_reset_token`: the token is unknown, already used or expired. `invalid_request`: the password is not 10 to 200 characters (`details.issues` names `password`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many password reset requests from this address: at most 10 every 10 minutes, counting both reset endpoints. `Retry-After` gives the seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`busy`: too many password checks are waiting. Nothing was changed and the token is still unused. `Retry-After: 5` gives the seconds to wait; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"summary":"The signed-in user, their organization and the modes available to it","security":[{"SessionToken":[]}],"responses":{"200":{"description":"The user with their role, the organization and the modes this server offers.","content":{"application/json":{"schema":{"type":"object","required":["user","organization","modes"],"properties":{"user":{"type":"object","required":["id","name","email","role"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"enum":["owner","member","attorney","platform_admin"]}}},"organization":{"type":"object","required":["id","name","verified"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"verified":{"type":"boolean"}}},"modes":{"type":"object","required":["test","live"],"description":"The modes this server offers. `test` is always true.","properties":{"test":{"type":"boolean"},"live":{"type":"boolean"}}}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The credential is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The credential is not allowed to do this.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current state: for a case, it is not in a state that allows this; for an API key, a limit or the key in use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The case did not pass a check.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/public/leads":{"post":{"summary":"Send a website request: access, a partner-attorney application, or a message. No credential; browser calls are allowed from the website origin only","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"access_request"},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"company":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["property_manager","landlord","developer","attorney","other"]},"states":{"minItems":1,"maxItems":51,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"message":{"type":"string","minLength":1,"maxLength":4000},"contact_url":{"description":"Honeypot: leave empty. A request with this field filled in is acknowledged and discarded.","type":"string","maxLength":0}},"required":["kind","name","email"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"attorney_application"},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"company":{"type":"string","minLength":1,"maxLength":200},"states":{"minItems":1,"maxItems":51,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"barNumber":{"type":"string","minLength":1,"maxLength":60},"message":{"type":"string","minLength":1,"maxLength":4000},"contact_url":{"description":"Honeypot: leave empty. A request with this field filled in is acknowledged and discarded.","type":"string","maxLength":0}},"required":["kind","name","email","states","barNumber"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"contact"},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"message":{"type":"string","minLength":1,"maxLength":4000},"contact_url":{"description":"Honeypot: leave empty. A request with this field filled in is acknowledged and discarded.","type":"string","maxLength":0}},"required":["kind","name","email","message"],"additionalProperties":false}]}}}},"responses":{"202":{"description":"The request was received. A request with the `contact_url` honeypot field filled in gets the same answer and is discarded.","content":{"application/json":{"schema":{"type":"object","required":["received"],"properties":{"received":{"const":true}}}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address: at most 5 every 10 minutes. `Retry-After` gives the seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","description":"An organization API key (`eak_test_...` or `eak_live_...`)."},"SessionToken":{"type":"http","scheme":"bearer","description":"A session token (`ess_...`) from `POST /v1/auth/signup` or `/v1/auth/login`, valid for 30 days. On the case, webhook, API key and organization routes it acts for the user's organization in the mode named by the `X-Evictions-Mode` header: `test` (the default) or `live`."},"AttorneyToken":{"type":"http","scheme":"bearer","description":"A user token (`eut_...`) of a verified attorney."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","details"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}},"Case":{"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"]},"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":"#/components/schemas/Document"}},"nextAction":{"type":"object","required":["by","description"],"properties":{"by":{"enum":["customer","attorney","platform","court","none"]},"description":{"type":"string"}}},"handling":{"enum":["automated","attorney_direct"],"description":"Who does the legal work. Every live case is `attorney_direct`: a licensed attorney engaged for the case reviews it, serves the notice and files in court, and the platform records each step. Every test case is `automated`: the sandbox pipeline."},"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."}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Document":{"type":"object","required":["id","kind","filename","contentHash"],"properties":{"id":{"type":"string"},"kind":{"enum":["evidence","notice","filing","proof","other"]},"specId":{"type":["string","null"]},"filename":{"type":"string"},"contentType":{"enum":["application/pdf","image/jpeg","image/png"],"description":"Decided from the file's first bytes when it was stored, never from its name."},"contentHash":{"type":"string","description":"SHA-256 of the document bytes. An attorney approval names these."},"createdAt":{"type":"string","format":"date-time"}}},"Charge":{"type":"object","description":"An amount owed to the platform for a case: the platform fee, or court or service costs passed on at cost. The attorney's legal fee is never a charge here: it is quoted separately and paid to the attorney.","required":["id","kind","description","amountCents","status","paidAt","createdAt"],"properties":{"id":{"type":"string"},"kind":{"enum":["platform_fee","court_costs","service_costs","other"]},"description":{"type":"string"},"amountCents":{"type":"integer","description":"US cents."},"status":{"enum":["due","paid","void","refunded"]},"paidAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"Note":{"type":"object","description":"A message on a case, between the customer and the platform.","required":["id","author","body","createdAt"],"properties":{"id":{"type":"string"},"author":{"enum":["operator","customer"]},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"GateResults":{"type":"object","required":["results","passed"],"properties":{"passed":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["gate","status"],"properties":{"gate":{"type":"string"},"status":{"type":"string"},"reason":{"type":"string"}}}}}},"Event":{"type":"object","required":["id","action","actorType","fromState","toState","createdAt"],"properties":{"id":{"type":"string"},"action":{"type":"string"},"actorType":{"type":"string"},"fromState":{"type":["string","null"]},"toState":{"type":["string","null"]},"detail":{},"createdAt":{"type":"string","format":"date-time"}}},"Filing":{"type":"object","description":"A submission to the court. Attorney-only.","required":["id","status","envelopeId","courtCaseNumber","rejectionReasons","createdAt"],"properties":{"id":{"type":"string"},"status":{"type":"string","description":"`submitted`, `accepted` or `rejected`."},"envelopeId":{"type":["string","null"]},"courtCaseNumber":{"type":["string","null"]},"rejectionReasons":{"type":["array","null"],"items":{"type":"string"},"description":"The court's reasons, when it rejected the filing."},"createdAt":{"type":"string","format":"date-time"}}},"ServiceAttempt":{"type":"object","description":"One request to serve a document on one defendant. Attorney-only.","required":["id","stage","method","status","servedDate","failureReason","createdAt"],"properties":{"id":{"type":"string"},"stage":{"enum":["notice","summons"]},"method":{"type":"string"},"status":{"type":"string","description":"`pending`, `served` or `failed`."},"servedDate":{"type":["string","null"],"format":"date"},"failureReason":{"type":["string","null"],"description":"The process server's reason, when service failed."},"createdAt":{"type":"string","format":"date-time"}}},"Attention":{"type":"object","description":"Whether the case needs the attorney: it is on hold, or a job for it failed for good after its last state change.","required":["needed","reasons"],"properties":{"needed":{"type":"boolean"},"reasons":{"type":"array","items":{"enum":["on_hold","job_failed"]}}}},"AttorneyQueueItem":{"type":"object","required":["id","mode","state","ground","entryPoint","jurisdiction","attention","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"mode":{"enum":["test","live"]},"state":{"type":"string"},"ground":{"type":"string"},"entryPoint":{"enum":["notice","filing"]},"jurisdiction":{"type":"object","required":["state"],"properties":{"state":{"type":"string"},"county":{"type":"string"}}},"attention":{"$ref":"#/components/schemas/Attention"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"AttorneyCase":{"description":"The case as its assigned attorney sees it. Each read is recorded in the audit log as `tenant_data_viewed`.","allOf":[{"$ref":"#/components/schemas/Case"},{"type":"object","required":["gates","evidence","filings","serviceAttempts","attention","events"],"properties":{"gates":{"$ref":"#/components/schemas/GateResults"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"filings":{"type":"array","items":{"$ref":"#/components/schemas/Filing"},"description":"Every court filing, oldest first."},"serviceAttempts":{"type":"array","items":{"$ref":"#/components/schemas/ServiceAttempt"},"description":"Every service attempt, oldest first."},"attention":{"$ref":"#/components/schemas/Attention"},"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"},"description":"The full audit trail, including internal events."}}}]}}}}