> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.incaseof.law/llms.txt
> Use this file to discover all available pages before exploring further.

# Decide on the judicial step

> The creditor's decision at `dunning_action_recommended`: `sue` takes the claim to court (a Mahnbescheid in
Germany, a Mahnklage in Austria), `decline` does not. One decision per claim — a second one answers `400`.

- The decision is recorded against your API key.
- After `sue`, incaseof.law invoices the court fee to the **creditor** — to the e-mail address of the claim's
  customer — never to you as the partner. The court step itself is taken by the incaseof.law team.
- A decision does not change the collection stage by itself; the answer is your receipt. The stage moves on as
  the court step progresses (webhook `claim.collection_stage_changed`).

`400` when the claim is not at `dunning_action_recommended`, a decision already exists, a lawyer is required
but not named, a lawyer is named on a German claim, the amount exceeds the Austrian Mahnklage limit, or no
Mahnverfahren is available for the debtor.




## OpenAPI

````yaml post /openapi/claims/{claim_id}/lawsuit-decision
openapi: 3.0.3
info:
  title: incaseof.law API
  version: 0.1.0
  description: >
    Draft OpenAPI blueprint for future implementation. Update paths as endpoints
    evolve.


    ## Webhooks


    incaseof.law can push events to a partner-controlled HTTPS endpoint

    whenever a claim's lifecycle changes. Today the single supported event

    type is `claim.collection_stage_changed`. See the **Webhooks** section

    at the bottom of this document for the payload shape, header reference,

    signature scheme and retry policy.
servers:
  - url: https://service.incaseof.law
    description: Production API
  - url: https://ico-app-staging.up.railway.app
    description: Partner sandbox (test data only, sandbox keys — see "Partner sandbox")
security:
  - bearerAuth: []
paths:
  /openapi/claims/{claim_id}/lawsuit-decision:
    post:
      tags:
        - Claims
      summary: Decide on the judicial step
      description: >
        The creditor's decision at `dunning_action_recommended`: `sue` takes the
        claim to court (a Mahnbescheid in

        Germany, a Mahnklage in Austria), `decline` does not. One decision per
        claim — a second one answers `400`.


        - The decision is recorded against your API key.

        - After `sue`, incaseof.law invoices the court fee to the **creditor** —
        to the e-mail address of the claim's
          customer — never to you as the partner. The court step itself is taken by the incaseof.law team.
        - A decision does not change the collection stage by itself; the answer
        is your receipt. The stage moves on as
          the court step progresses (webhook `claim.collection_stage_changed`).

        `400` when the claim is not at `dunning_action_recommended`, a decision
        already exists, a lawyer is required

        but not named, a lawyer is named on a German claim, the amount exceeds
        the Austrian Mahnklage limit, or no

        Mahnverfahren is available for the debtor.
      parameters:
        - in: path
          name: claim_id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LawsuitDecisionInput'
            examples:
              sue:
                summary: Take the claim to court (Germany)
                value:
                  decision: sue
              sueWithLawyer:
                summary: >-
                  Take the claim to court with a lawyer from the incaseof.law
                  network (Austria)
                value:
                  decision: sue
                  wants_lawyer: true
                  lawyer_type: ico_network
              decline:
                summary: Do not take the claim to court
                value:
                  decision: decline
      responses:
        '201':
          description: Decision recorded
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/LawsuitDecision'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    LawsuitDecisionInput:
      type: object
      required:
        - decision
      properties:
        decision:
          type: string
          enum:
            - sue
            - decline
        wants_lawyer:
          type: boolean
          description: >-
            Austria only. Required (true) when the estimate says
            `lawyer_required`; not allowed on German claims.
        lawyer_type:
          type: string
          enum:
            - ico_network
            - wunschanwalt
          description: >-
            `ico_network`: incaseof.law assigns a lawyer. `wunschanwalt`: the
            creditor's own lawyer (name and location required).
        wunschanwalt_first_name:
          type: string
          maxLength: 100
        wunschanwalt_last_name:
          type: string
          maxLength: 100
        wunschanwalt_location:
          type: string
          maxLength: 200
        wunschanwalt_email:
          type: string
          format: email
    LawsuitDecision:
      type: object
      properties:
        claim_id:
          type: string
          format: uuid
        decision:
          type: string
          enum:
            - sue
            - decline
        decided_at:
          type: string
          format: date-time
        decided_via:
          type: string
          enum:
            - api
            - portal
          description: >-
            `api`: through an API key; `portal`: by the creditor in the
            incaseof.law portal.
        wants_lawyer:
          type: boolean
          nullable: true
        lawyer_type:
          type: string
          enum:
            - ico_network
            - wunschanwalt
          nullable: true
        streitwert:
          type: number
          description: Amount in dispute (sum of the claim's invoices), EUR
        court_fees:
          type: number
          nullable: true
          description: Estimated court fee, EUR
        lawyer_fees_net:
          type: number
          nullable: true
        lawyer_fees_gross:
          type: number
          nullable: true
  responses:
    BadRequest:
      description: Bad Request - Invalid input data
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Bad Request
              message:
                type: string
                example: Invalid request data
              details:
                type: array
                items:
                  type: object
                  properties:
                    field:
                      type: string
                    message:
                      type: string
          examples:
            validationError:
              value:
                success: false
                error: VALIDATION_ERROR
                message: Validation failed
                details:
                  - field: amount
                    message: Amount must be positive
    Unauthorized:
      description: Unauthorized - Missing or invalid authentication
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Unauthorized
              message:
                type: string
                example: Invalid or expired token
          examples:
            missingToken:
              value:
                success: false
                error: Unauthorized
                message: Missing or invalid authorization header
            expiredToken:
              value:
                success: false
                error: Unauthorized
                message: Invalid or expired token
    NotFound:
      description: Not Found - Resource does not exist
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Not Found
              message:
                type: string
                example: Resource not found
    TooManyRequests:
      description: >
        The key's hourly limit is used up — every `/openapi` request can answer
        this. Requests are counted per key and

        clock hour (UTC); the limit is agreed per key (default 1 000 per hour).
        Retry after `Retry-After` seconds.

        Every answer — not only this one — carries `X-RateLimit-Limit`,
        `X-RateLimit-Remaining` and `X-RateLimit-Reset`.
      headers:
        Retry-After:
          description: Seconds until the next hour starts and requests are admitted again.
          schema:
            type: integer
            example: 1260
        X-RateLimit-Limit:
          description: Requests allowed per hour for this key.
          schema:
            type: integer
            example: 1000
        X-RateLimit-Remaining:
          description: Requests left in the current hour (0 here).
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Unix time (seconds) at which the count starts again.
          schema:
            type: integer
            example: 1790002800
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: Too Many Requests
              message:
                type: string
                example: >-
                  Rate limit exceeded. Your limit is 1000 requests per hour.
                  Please try again later.
              details:
                type: object
                properties:
                  limit:
                    type: integer
                    example: 1000
                  window:
                    type: string
                    example: 1 hour
                  resets_at:
                    type: string
                    format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````