openapi: 3.0.1
info:
  title: LawVu API
  description: The next generation of the LawVu API.
  termsOfService: https://developer.lawvu.com/developer-terms
  contact:
    name: LawVu Developer Support Team
    url: https://developer.lawvu.com
    email: developer@lawvu.com
  version: ''
servers:
  - url: https://api-sandbox.lawvu.com
    description: Sandbox API
  - url: https://api.lawvu.com
    description: Production API
paths:
  /v2/contracts/{contractId}:
    get:
      tags:
        - Contracts
      summary: Get contract
      description: Retrieve a contract by its identifier
      operationId: get-v2-contracts-contractid
      parameters:
        - name: contractId
          in: path
          description: The system identifier for the contract
          required: true
          schema:
            type: integer
            description: The system identifier for the contract
            format: int32
            example: 5348
          example: 5348
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contract'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /contracts/5348
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
    patch:
      tags:
        - Contracts
      summary: Update contract
      description: Updates a contracts details
      operationId: patch-v2-contracts-contractid
      parameters:
        - name: contractId
          in: path
          description: The system identifier for the contract
          required: true
          schema:
            type: integer
            description: The system identifier for the contract
            format: int32
            example: 5348
          example: 5348
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UpdateContract'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/HttpValidationProblemDetails'
              example:
                detail: The request was invalid and could not be processed
                errors:
                  Name: Is Required
                instance: /contracts/5348
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: You do not have permission to update this contract
                instance: /contracts/5348
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 403
                title: Forbidden
                type: https://api-docs.lawvu.com/errors/forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /contracts/5348
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: Provided ExternalId already in use
                instance: /contracts/5348
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 409
                title: Conflict
                type: https://api-docs.lawvu.com/errors/conflict
  /v2/contracts:
    post:
      tags:
        - Contracts
      summary: Create contract
      description: Creates a contract based on the provided contract type.
      operationId: post-v2-contracts
      requestBody:
        content:
          application/json:
            schema:
              required:
                - type
              allOf:
                - $ref: '#/components/schemas/CreateContract'
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: Location to retrieve the created contract
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedContract'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The request was invalid and could not be processed
                errors:
                  Name: Is Required
                instance: /contracts/
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: Provided ExternalId already in use
                instance: /contracts/
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 409
                title: Conflict
                type: https://api-docs.lawvu.com/errors/conflict
  /v2/contracts/{contractId}/files/{fileId}:
    get:
      tags:
        - Contracts
      summary: Get contract file
      description: Retrieve information about a file on a contract
      operationId: get-v2-contracts-contractid-files-fileid
      parameters:
        - name: contractId
          in: path
          description: The system identifier for the contract
          required: true
          schema:
            type: integer
            description: The system identifier for the contract
            format: int32
            example: 5348
          example: 5348
        - name: fileId
          in: path
          description: The system identifier for the file
          required: true
          schema:
            type: integer
            description: The system identifier for the file
            format: int32
            example: 9456
          example: 9456
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /contracts/5348/files/9456
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
  /v2/contractTypes:
    get:
      tags:
        - Contracts
      summary: Get contract types
      description: Retrieve a list of contract types
      operationId: get-v2-contracttypes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractTypeCollectionResponse'
  /v2/fields:
    get:
      tags:
        - Fields
      summary: Get fields
      description: Retrieve a list of available fields
      operationId: get-v2-fields
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldCollectionResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
  /v2/fields/{fieldId}/options:
    get:
      tags:
        - Fields
      summary: Get field options
      description: |-
        Retrieve a list of available options for a field.

        Supported field types: MultiOption, Option
      operationId: get-v2-fields-fieldid-options
      parameters:
        - name: fieldId
          in: path
          description: The API name for the field
          required: true
          schema:
            type: string
            description: The API name for the field
            example: my_field
          example: my_field
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldOptionCollectionResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: 'Options not supported for field type: Text'
                instance: /fields/my_field
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: >-
                  Cannot retrieve options as the requested field could not be
                  found
                instance: /fields/my_field
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
    post:
      tags:
        - Fields
      summary: Add an option to a field
      description: |-
        Add a an option for a field.

        Supported field types: MultiOption, Option
      operationId: post-v2-fields-fieldid-options
      parameters:
        - name: fieldId
          in: path
          description: The API name for the field
          required: true
          schema:
            type: string
            description: The API name for the field
            example: my_field
          example: my_field
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateFieldOption'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedFieldOption'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: Field does not support adding options
                instance: /fields/my_field
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: Cannot add option as the requested field could not be found
                instance: /fields/my_field
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
  /v2/files/{fileId}:
    delete:
      tags:
        - Files
      summary: Delete file
      description: Delete a file
      operationId: delete-v2-files-fileid
      parameters:
        - name: fileId
          in: path
          description: The system identifier for the file
          required: true
          schema:
            type: integer
            description: The system identifier for the file
            format: int32
            example: 9456
          example: 9456
      responses:
        '204':
          description: No Content
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: You do not have permission to delete this file
                instance: /files/9456
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 403
                title: Forbidden
                type: https://api-docs.lawvu.com/errors/forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /files/9456
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
    post:
      tags:
        - Files
      summary: Upload file version
      description: Upload a new version of a file
      operationId: post-v2-files-fileid
      parameters:
        - name: fileId
          in: path
          description: The system identifier for the file
          required: true
          schema:
            type: integer
            description: The system identifier for the file
            format: int32
            example: 9456
          example: 9456
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - form
              type: object
              properties:
                form:
                  allOf:
                    - $ref: '#/components/schemas/UploadFileVersionForm'
            encoding:
              form:
                style: form
        required: true
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: Relative location to retrieve the new version of the file
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedFile'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The request was invalid and could not be processed
                errors:
                  File: File size exceeds the 50 MB limit
                instance: /files
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /files/9456
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: A file with the same name already exists in this location
                instance: /files
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 409
                title: Conflict
                type: https://api-docs.lawvu.com/errors/conflict
  /v2/files/{fileId}/content:
    get:
      tags:
        - Files
      summary: Get file content
      description: Retrieve the content of a file
      operationId: get-v2-files-fileid-content
      parameters:
        - name: fileId
          in: path
          description: The system identifier for the file
          required: true
          schema:
            type: integer
            description: The system identifier for the file
            format: int32
            example: 9456
          example: 9456
      responses:
        '200':
          description: The binary content of the file.
          headers:
            Content-Type:
              description: The content type of the file content
              schema:
                type: string
            Content-Length:
              description: The length in bytes of the file content
              schema:
                type: integer
            Content-MD5:
              description: The MD5 hash of the file content
              schema:
                type: string
            Content-Disposition:
              description: The content disposition of the file content
              schema:
                type: string
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /files/9456/content
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
  /v2/files:
    post:
      tags:
        - Files
      summary: Upload file
      description: Upload a file
      operationId: post-v2-files
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - form
              type: object
              properties:
                form:
                  required:
                    - targetResourceType
                  allOf:
                    - $ref: '#/components/schemas/UploadFileForm'
            encoding:
              form:
                style: form
        required: true
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: Relative location to retrieve the created file
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedFile'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The request was invalid and could not be processed
                errors:
                  TargetResourceId: Is required when adding a file to a matter
                instance: /files
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: >-
                  A file with the same name already exists in the target
                  location
                instance: /files
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 409
                title: Conflict
                type: https://api-docs.lawvu.com/errors/conflict
  /v2/matters/{matterId}:
    get:
      tags:
        - Matters
      summary: Get matter
      description: Retrieve a matter by its identifier
      operationId: get-v2-matters-matterid
      parameters:
        - name: matterId
          in: path
          description: The system identifier for the matter
          required: true
          schema:
            type: integer
            description: The system identifier for the matter
            format: int32
            example: 1056
          example: 1056
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Matter'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /matters/1056
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
    patch:
      tags:
        - Matters
      summary: Update matter
      description: Updates a matters details
      operationId: patch-v2-matters-matterid
      parameters:
        - name: matterId
          in: path
          description: The system identifier for the matter
          required: true
          schema:
            type: integer
            description: The system identifier for the matter
            format: int32
            example: 1056
          example: 1056
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UpdateMatter'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/HttpValidationProblemDetails'
              example:
                detail: The request was invalid and could not be processed
                errors:
                  Name: Is Required
                instance: /matters/1056
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: You do not have permission to update this matter
                instance: /matters/1056
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 403
                title: Forbidden
                type: https://api-docs.lawvu.com/errors/forbidden
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /matters/1056
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: Provided ExternalId already in use
                instance: /matters/1056
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 409
                title: Conflict
                type: https://api-docs.lawvu.com/errors/conflict
  /v2/matters:
    post:
      tags:
        - Matters
      summary: Create matter
      description: Creates a matter based on the provided matter type.
      operationId: post-v2-matters
      requestBody:
        content:
          application/json:
            schema:
              required:
                - type
              allOf:
                - $ref: '#/components/schemas/CreateMatter'
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: Location to retrieve the created matter
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedMatter'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The request was invalid and could not be processed
                errors:
                  Name: Is Required
                instance: /matters
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 400
                title: Invalid request
                type: https://api-docs.lawvu.com/errors/invalid_request
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: Provided ExternalId already in use
                instance: /matters
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 409
                title: Conflict
                type: https://api-docs.lawvu.com/errors/conflict
  /v2/matters/{matterId}/files/{fileId}:
    get:
      tags:
        - Matters
      summary: Get matter file
      description: Retrieve information about a file on a matter
      operationId: get-v2-matters-matterid-files-fileid
      parameters:
        - name: matterId
          in: path
          description: The system identifier for the matter
          required: true
          schema:
            type: integer
            description: The system identifier for the matter
            format: int32
            example: 1056
          example: 1056
        - name: fileId
          in: path
          description: The system identifier for the file
          required: true
          schema:
            type: integer
            description: The system identifier for the file
            format: int32
            example: 9456
          example: 9456
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              example:
                detail: The requested resource could not be found
                instance: /matters/1056/files/9456
                operationId: 7edb5d62-f5bf-463b-9410-cdd8b3293d89
                status: 404
                title: Resource not found
                type: https://api-docs.lawvu.com/errors/resource_not_found
  /v2/matterTypes:
    get:
      tags:
        - Matters
      summary: Get matter types
      description: Retrieve a list of matter types
      operationId: get-v2-mattertypes
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MatterTypeCollectionResponse'
components:
  schemas:
    AuditableReference:
      type: object
      properties:
        dateUtc:
          type: string
          description: >-
            The date and time the action was performed. The date and time uses
            the ISO-8601 format and will be in UTC
          format: date-time
          readOnly: true
          example: '2024-12-25T00:00:00Z'
        userName:
          type: string
          description: The username of who performed the action
          readOnly: true
          example: api.developer@lawvu.com
      additionalProperties: false
    AuditableUserReference:
      type: object
      properties:
        dateUtc:
          type: string
          description: >-
            The date and time the action was performed. The date and time uses
            the ISO-8601 format and will be in UTC
          format: date-time
          readOnly: true
          example: '2024-12-25T00:00:00Z'
        user:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user who performed the action
          nullable: true
          readOnly: true
        userName:
          type: string
          description: The username of who performed the action
          readOnly: true
          example: api.developer@lawvu.com
      additionalProperties: false
    Contract:
      type: object
      properties:
        created:
          allOf:
            - $ref: '#/components/schemas/AuditableUserReference'
          description: The user who created the contract and when
          nullable: true
          readOnly: true
        document:
          allOf:
            - $ref: '#/components/schemas/FileReference'
          description: The contract document
          nullable: true
          readOnly: true
        expiry:
          type: string
          description: >-
            The expiry date of the contract. The date and time uses the ISO-8601
            format and will be in the Local timezone of the organization
          format: date-time
          nullable: true
          example: '2024-12-25T00:00:00'
        externalId:
          type: string
          description: >-
            A unique user defined identifier that can be used to reference
            another system
          nullable: true
          example: external-01
        fields:
          type: object
          additionalProperties:
            oneOf:
              - title: 'null'
              - title: Text
                type: string
                example: my text value
              - title: Decimal
                type: number
                example: 78659.84
              - title: Boolean
                type: boolean
                example: true
              - title: Date
                type: string
                example: '2025-05-06'
              - $ref: '#/components/schemas/OptionFieldValue'
              - title: MultiOption
                type: array
                items:
                  $ref: '#/components/schemas/OptionFieldValue'
              - $ref: '#/components/schemas/UserFieldValue'
            x-additionalPropertiesName: fieldApiName
          description: The collection of fields associated with the contract
          nullable: true
          example:
            my_text_field: my text value
            my_decimal_field: 78659.84
            my_boolean_field: true
            my_date_field: '2025-05-06'
            my_option_field:
              label: Option 1
              value: option_1
            my_multioption_field:
              - label: Option A
                value: option_a
              - label: Option D
                value: option_d
            my_user_field:
              email: api.developer@lawvu.com
              firstName: Api
              id: f0f1e06e-3005-4093-af7f-1934d55617e1
              lastName: Developer
              organizationId: 8134
        id:
          type: integer
          description: The system identifier for the contract
          format: int32
          nullable: true
          readOnly: true
          example: 5348
        name:
          type: string
          description: The user defined name of the contract
          nullable: true
          example: My contract
        owner:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user assigned as the owner of the contract
          nullable: true
        restricted:
          type: boolean
          description: "Is the contract only available to members.\r\nAn indicator where the contract requires membership to access"
          default: false
          nullable: true
          example: false
        status:
          allOf:
            - $ref: '#/components/schemas/ContractStatus'
          description: The current status of the contract
          nullable: true
          example: Active
        teamAssigned:
          allOf:
            - $ref: '#/components/schemas/TeamReference'
          description: The team which this contract is assigned to
          nullable: true
        type:
          allOf:
            - $ref: '#/components/schemas/ContractTypeReference'
          description: The type of the contract
          nullable: true
          readOnly: true
      additionalProperties: false
    ContractGroupReference:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the contract group
          format: int32
          example: 5002
        name:
          type: string
          description: The name of the contract type
          readOnly: true
          example: Employment
      additionalProperties: false
    ContractStatus:
      enum:
        - Draft
        - Negotiating
        - Approval
        - Signing
        - Executed
        - Expired
        - Void
      type: string
    ContractType:
      type: object
      properties:
        hasWizard:
          type: boolean
          description: The contract type has a wizard in place.
          nullable: true
          example: false
        id:
          type: integer
          description: The system identifier for the contract type
          format: int32
          nullable: true
          readOnly: true
          example: 1234
        name:
          type: string
          description: The user defined name of the contract type
          nullable: true
          example: Contractor Agreement
        parent:
          allOf:
            - $ref: '#/components/schemas/ContractGroupReference'
          description: The parent contract type
          nullable: true
        teamAssignmentRequired:
          type: boolean
          description: The contract type has a team assignment required.
          nullable: true
          example: false
      additionalProperties: false
    ContractTypeCollectionResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ContractType'
          description: The collection of items
      additionalProperties: false
      description: Response wrapper of a collection of items
    ContractTypeReference:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the contract type
          format: int32
          example: 1234
        name:
          type: string
          description: The name of the contract type
          readOnly: true
          example: NDA
      additionalProperties: false
    CreateContract:
      required:
        - type
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/ContractTypeReference'
          description: The type of the contract
        created:
          allOf:
            - $ref: '#/components/schemas/AuditableUserReference'
          description: The user who created the contract and when
          nullable: true
          readOnly: true
        document:
          allOf:
            - $ref: '#/components/schemas/FileReference'
          description: "The contract document.\r\nThis is only optional if the contract type has a wizard"
          nullable: true
        expiry:
          type: string
          description: >-
            The expiry date of the contract. The date and time uses the ISO-8601
            format and will be in the Local timezone of the organization
          format: date-time
          nullable: true
          example: '2024-12-25T00:00:00'
        externalId:
          type: string
          description: >-
            A unique user defined identifier that can be used to reference
            another system
          nullable: true
          example: external-01
        fields:
          type: object
          additionalProperties:
            oneOf:
              - title: 'null'
              - title: Text
                type: string
                example: my text value
              - title: Decimal
                type: number
                example: 78659.84
              - title: Boolean
                type: boolean
                example: true
              - title: Date
                type: string
                example: '2025-05-06'
              - $ref: '#/components/schemas/OptionFieldValue'
              - title: MultiOption
                type: array
                items:
                  $ref: '#/components/schemas/OptionFieldValue'
              - $ref: '#/components/schemas/UserFieldValue'
            x-additionalPropertiesName: fieldApiName
          description: The collection of fields associated with the contract
          nullable: true
          example:
            my_text_field: my text value
            my_decimal_field: 78659.84
            my_boolean_field: true
            my_date_field: '2025-05-06'
            my_option_field:
              value: option_1
            my_multioption_field:
              - value: option_a
              - value: option_d
            my_user_field:
              id: f0f1e06e-3005-4093-af7f-1934d55617e1
        id:
          type: integer
          description: The system identifier for the contract
          format: int32
          nullable: true
          readOnly: true
          example: 5348
        name:
          type: string
          description: The user defined name of the contract
          nullable: true
          example: My contract
        owner:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user assigned as the owner of the contract
          nullable: true
        restricted:
          type: boolean
          description: "Is the contract only available to members.\r\nAn indicator where the contract requires membership to access"
          default: false
          nullable: true
          example: false
        teamAssigned:
          allOf:
            - $ref: '#/components/schemas/TeamReference'
          description: The team which this contract is assigned to
          nullable: true
      additionalProperties: false
    CreateFieldOption:
      required:
        - label
      type: object
      properties:
        label:
          type: string
          description: The user defined label of the field option
          nullable: true
          example: Option A
      additionalProperties: false
    CreateMatter:
      required:
        - type
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/MatterTypeReference'
          description: The type of the matter
        created:
          allOf:
            - $ref: '#/components/schemas/AuditableUserReference'
          description: The user who created the matter and when
          nullable: true
          readOnly: true
        displayId:
          type: string
          description: "A system generated identifier of the matter.\r\nAlso known as \"LawVu ID\" or \"Matter Number\""
          nullable: true
          readOnly: true
          example: LV0001-0001
        externalId:
          type: string
          description: >-
            A unique user defined identifier that can be used to reference
            another system
          nullable: true
          example: external-01
        fields:
          type: object
          additionalProperties:
            oneOf:
              - title: 'null'
              - title: Text
                type: string
                example: my text value
              - title: Decimal
                type: number
                example: 78659.84
              - title: Boolean
                type: boolean
                example: true
              - title: Date
                type: string
                example: '2025-05-06'
              - $ref: '#/components/schemas/OptionFieldValue'
              - title: MultiOption
                type: array
                items:
                  $ref: '#/components/schemas/OptionFieldValue'
              - $ref: '#/components/schemas/UserFieldValue'
            x-additionalPropertiesName: fieldApiName
          description: The collection of fields associated with the matter
          nullable: true
          example:
            my_text_field: my text value
            my_decimal_field: 78659.84
            my_boolean_field: true
            my_date_field: '2025-05-06'
            my_option_field:
              value: option_1
            my_multioption_field:
              - value: option_a
              - value: option_d
            my_user_field:
              id: f0f1e06e-3005-4093-af7f-1934d55617e1
        id:
          type: integer
          description: The system identifier for the matter
          format: int32
          nullable: true
          readOnly: true
          example: 1056
        name:
          type: string
          description: "The user defined name of the matter\r\n\r\nWhen simple ticketing is enabled for the organization then the Name is going to be optional and will default to simple ticketing rules, otherwise is required."
          nullable: true
          example: My matter
        owner:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user assigned as the owner of the matter
          nullable: true
        restricted:
          type: boolean
          description: "Is the matter only available to members\r\nAn indicator where the matter requires membership to access"
          default: false
          nullable: true
          example: false
        teamAssigned:
          allOf:
            - $ref: '#/components/schemas/TeamReference'
          description: The team which this matter is assigned to
          nullable: true
      additionalProperties: false
    CreatedContract:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the contract
          format: int32
          readOnly: true
          example: 5348
      additionalProperties: false
      description: Represents a contract that has been created
    CreatedFieldOption:
      required:
        - value
      type: object
      properties:
        value:
          type: string
          nullable: true
          example: '75467'
      additionalProperties: false
      description: Represents a field option that has been created
    CreatedMatter:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 1056
      additionalProperties: false
      description: Represents a matter that has been created
    Field:
      type: object
      properties:
        created:
          allOf:
            - $ref: '#/components/schemas/AuditableReference'
          description: The username who created the field and when
          nullable: true
          readOnly: true
        id:
          type: string
          description: The API name for the field
          nullable: true
          readOnly: true
          example: my_field
        modified:
          allOf:
            - $ref: '#/components/schemas/AuditableReference'
          description: The username who modified the field and when
          nullable: true
          readOnly: true
        name:
          type: string
          description: The user defined name of the field
          nullable: true
          example: My dropdown field
        properties:
          oneOf:
            - $ref: '#/components/schemas/MultiOptionFieldProperties'
            - $ref: '#/components/schemas/OptionFieldProperties'
          description: Specific properties for the field, varies by type
          nullable: true
          readOnly: true
        type:
          allOf:
            - $ref: '#/components/schemas/FieldType'
          description: The type of the field
          nullable: true
          example: text
      additionalProperties: false
    FieldCollectionResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Field'
          description: The collection of items
      additionalProperties: false
      description: Response wrapper of a collection of items
    FieldOption:
      required:
        - label
        - value
      type: object
      properties:
        label:
          type: string
          description: The user defined label of the field option
          nullable: true
          example: Option A
        value:
          type: string
          description: The system generated value for the field option
          nullable: true
          example: '1492'
      additionalProperties: false
    FieldOptionCollectionResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/FieldOption'
          description: The collection of items
      additionalProperties: false
      description: Response wrapper of a collection of items
    FieldType:
      enum:
        - Text
        - Decimal
        - Boolean
        - Date
        - Option
        - MultiOption
        - User
      type: string
    File:
      type: object
      properties:
        contentType:
          type: string
          description: The content type of the file binary
          nullable: true
          example: text/plain
        created:
          allOf:
            - $ref: '#/components/schemas/AuditableUserReference'
          description: The user who created the file and when
          nullable: true
          readOnly: true
        displayId:
          type: string
          description: "A system generated identifier of the file.\r\nAlso known as \"Document ID\""
          nullable: true
          example: LV0001-0000123.1
        folder:
          allOf:
            - $ref: '#/components/schemas/FolderReference'
          description: "The folder where the file is located\r\n\r\nFolder is null when the file is located at the root of the resource"
          nullable: true
        id:
          type: integer
          description: The system identifier for the file
          format: int32
          nullable: true
          readOnly: true
          example: 9456
        modified:
          allOf:
            - $ref: '#/components/schemas/AuditableReference'
          description: The username who modified the file and when
          nullable: true
          readOnly: true
        name:
          type: string
          description: The user defined name of the file including extension
          nullable: true
          example: document.txt
        resource:
          allOf:
            - $ref: '#/components/schemas/ResourceReference'
          description: The resouce where the file is located
          nullable: true
        restricted:
          type: boolean
          description: Is the file access restricted
          default: false
          nullable: true
          example: false
        size:
          type: integer
          description: The size of the file binary in bytes
          format: int64
          nullable: true
          example: 18139
        version:
          type: integer
          description: The version number of the file
          format: int32
          nullable: true
          example: 3
      additionalProperties: false
    FileReference:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the file
          format: int32
          example: 9456
        name:
          type: string
          description: The name of the file
          readOnly: true
          example: Standard NDA.docx
        version:
          type: integer
          description: The version of the file
          format: int32
          readOnly: true
          example: 3
      additionalProperties: false
    FileUploadResourceType:
      enum:
        - Matter
        - Contract
        - ContractCreation
      type: string
    FolderReference:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the folder
          format: int32
          example: 786
        name:
          type: string
          description: The name of the folder
          readOnly: true
          example: Drafts
      additionalProperties: false
    HttpValidationProblemDetails:
      type: object
      properties:
        detail:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        instance:
          type: string
        operationId:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
      additionalProperties: {}
    Matter:
      type: object
      properties:
        created:
          allOf:
            - $ref: '#/components/schemas/AuditableUserReference'
          description: The user who created the matter and when
          nullable: true
          readOnly: true
        displayId:
          type: string
          description: "A system generated identifier of the matter.\r\nAlso known as \"LawVu ID\" or \"Matter Number\""
          nullable: true
          readOnly: true
          example: LV0001-0001
        externalId:
          type: string
          description: >-
            A unique user defined identifier that can be used to reference
            another system
          nullable: true
          example: external-01
        fields:
          type: object
          additionalProperties:
            oneOf:
              - title: 'null'
              - title: Text
                type: string
                example: my text value
              - title: Decimal
                type: number
                example: 78659.84
              - title: Boolean
                type: boolean
                example: true
              - title: Date
                type: string
                example: '2025-05-06'
              - $ref: '#/components/schemas/OptionFieldValue'
              - title: MultiOption
                type: array
                items:
                  $ref: '#/components/schemas/OptionFieldValue'
              - $ref: '#/components/schemas/UserFieldValue'
            x-additionalPropertiesName: fieldApiName
          description: The collection of fields associated with the matter
          nullable: true
          example:
            my_text_field: my text value
            my_decimal_field: 78659.84
            my_boolean_field: true
            my_date_field: '2025-05-06'
            my_option_field:
              label: Option 1
              value: option_1
            my_multioption_field:
              - label: Option A
                value: option_a
              - label: Option D
                value: option_d
            my_user_field:
              email: api.developer@lawvu.com
              firstName: Api
              id: f0f1e06e-3005-4093-af7f-1934d55617e1
              lastName: Developer
              organizationId: 8134
        id:
          type: integer
          description: The system identifier for the matter
          format: int32
          nullable: true
          readOnly: true
          example: 1056
        name:
          type: string
          description: "The user defined name of the matter\r\n\r\nWhen simple ticketing is enabled for the organization then the Name is going to be optional and will default to simple ticketing rules, otherwise is required."
          nullable: true
          example: My matter
        owner:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user assigned as the owner of the matter
          nullable: true
        restricted:
          type: boolean
          description: "Is the matter only available to members\r\nAn indicator where the matter requires membership to access"
          default: false
          nullable: true
          example: false
        status:
          allOf:
            - $ref: '#/components/schemas/MatterStatus'
          description: The current status of the matter
          nullable: true
          example: Active
        teamAssigned:
          allOf:
            - $ref: '#/components/schemas/TeamReference'
          description: The team which this matter is assigned to
          nullable: true
        type:
          allOf:
            - $ref: '#/components/schemas/MatterTypeReference'
          description: The type of the matter
          nullable: true
          readOnly: true
      additionalProperties: false
    MatterManager:
      type: object
      properties:
        intakeOrganization:
          allOf:
            - $ref: '#/components/schemas/OrganizationReference'
          description: TODO
          nullable: true
        user:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: TODO
          nullable: true
      additionalProperties: false
      description: 'TODO: Needs more thought on how we distinguish the intakes and user'
    MatterStatus:
      enum:
        - Draft
        - Scoping
        - Review
        - Active
        - TasksLate
        - MilestonesLate
        - TasksAndMilestonesLate
        - AwaitingManagerAcceptance
        - AwaitingOwnerAcceptance
        - Complete
        - Archived
        - OnHold
      type: string
    MatterType:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the matter type
          format: int32
          nullable: true
          readOnly: true
          example: 7492
        name:
          type: string
          description: The user defined name of the matter type
          nullable: true
          example: My matter type
        parent:
          allOf:
            - $ref: '#/components/schemas/MatterTypeReference'
          description: The parent matter type
          nullable: true
      additionalProperties: false
    MatterTypeCollectionResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/MatterType'
          description: The collection of items
      additionalProperties: false
      description: Response wrapper of a collection of items
    MatterTypeReference:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the matter type
          format: int32
          example: 7492
        name:
          type: string
          description: The name of the matter type
          readOnly: true
          example: NDA
      additionalProperties: false
    MultiOptionFieldProperties:
      type: object
      properties:
        userCanAddOption:
          type: boolean
          description: >-
            Indicates if an option can be added without the user having access
            to further manage the field options
          nullable: true
          example: true
      additionalProperties: false
    OptionFieldProperties:
      type: object
      properties:
        userCanAddOption:
          type: boolean
          description: >-
            Indicates if an option can be added without the user having access
            to further manage the field options
          nullable: true
          example: true
      additionalProperties: false
    OptionFieldValue:
      title: Option
      type: object
      properties:
        label:
          type: string
          readOnly: true
          example: Option 1
        value:
          type: string
          example: option_1
    OrganizationReference:
      type: object
      properties:
        id:
          type: integer
          description: The organization the user belongs to
          format: int32
          example: 8134
        name:
          type: string
          description: The name of the organization
          readOnly: true
          example: Api Development Organization
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        operationId:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
      additionalProperties: {}
    ResourceReference:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the resource
          format: int32
          example: 78914
        type:
          allOf:
            - $ref: '#/components/schemas/ResourceType'
          description: The type of the resource
          readOnly: true
          example: Contract
      additionalProperties: false
    ResourceType:
      enum:
        - Contract
        - Matter
      type: string
    TeamReference:
      type: object
      properties:
        id:
          type: integer
          description: The identifier of the team
          format: int32
          example: 469
        name:
          type: string
          description: The full name of the team
          readOnly: true
          example: Legal - Commercial
      additionalProperties: false
    UpdateContract:
      type: object
      properties:
        expiry:
          type: string
          description: >-
            The expiry date of the contract. The date and time uses the ISO-8601
            format and will be in the Local timezone of the organization
          format: date-time
          nullable: true
        externalId:
          type: string
          description: >-
            A unique user defined identifier that can be used to reference
            another system
          nullable: true
        fields:
          type: object
          additionalProperties:
            oneOf:
              - title: 'null'
              - title: Text
                type: string
                example: my text value
              - title: Decimal
                type: number
                example: 78659.84
              - title: Boolean
                type: boolean
                example: true
              - title: Date
                type: string
                example: '2025-05-06'
              - $ref: '#/components/schemas/OptionFieldValue'
              - title: MultiOption
                type: array
                items:
                  $ref: '#/components/schemas/OptionFieldValue'
              - $ref: '#/components/schemas/UserFieldValue'
            x-additionalPropertiesName: fieldApiName
          description: The collection of fields associated with the contract
          nullable: true
          example:
            my_text_field: my text value
            my_decimal_field: 78659.84
            my_boolean_field: true
            my_date_field: '2025-05-06'
            my_option_field:
              value: option_1
            my_multioption_field:
              - value: option_a
              - value: option_d
            my_user_field:
              id: f0f1e06e-3005-4093-af7f-1934d55617e1
        name:
          type: string
          description: The user defined name of the contract
          nullable: true
        owner:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user assigned as the owner of the contract
          nullable: true
        restricted:
          type: boolean
          description: "Is the contract only available to members.\r\nAn indicator where the contract requires membership to access"
          nullable: true
          example: false
        status:
          allOf:
            - $ref: '#/components/schemas/ContractStatus'
          description: The current status of the contract
          nullable: true
        teamAssigned:
          allOf:
            - $ref: '#/components/schemas/TeamReference'
          description: The team which this contract is assigned to
          nullable: true
      additionalProperties: false
    UpdateMatter:
      type: object
      properties:
        externalId:
          type: string
          description: >-
            A unique user defined identifier that can be used to reference
            another system
          nullable: true
        fields:
          type: object
          additionalProperties:
            oneOf:
              - title: 'null'
              - title: Text
                type: string
                example: my text value
              - title: Decimal
                type: number
                example: 78659.84
              - title: Boolean
                type: boolean
                example: true
              - title: Date
                type: string
                example: '2025-05-06'
              - $ref: '#/components/schemas/OptionFieldValue'
              - title: MultiOption
                type: array
                items:
                  $ref: '#/components/schemas/OptionFieldValue'
              - $ref: '#/components/schemas/UserFieldValue'
            x-additionalPropertiesName: fieldApiName
          description: The collection of fields associated with the matter
          nullable: true
          example:
            my_text_field: my text value
            my_decimal_field: 78659.84
            my_boolean_field: true
            my_date_field: '2025-05-06'
            my_option_field:
              value: option_1
            my_multioption_field:
              - value: option_a
              - value: option_d
            my_user_field:
              id: f0f1e06e-3005-4093-af7f-1934d55617e1
        manager:
          allOf:
            - $ref: '#/components/schemas/MatterManager'
          description: The user or organization managing the matter
          nullable: true
        name:
          type: string
          description: "The user defined name of the matter\r\n\r\nWhen simple ticketing is enabled for the organization then the Name is going to be optional and will default to simple ticketing rules, otherwise is required."
          nullable: true
        owner:
          allOf:
            - $ref: '#/components/schemas/UserReference'
          description: The user assigned as the owner of the matter
          nullable: true
        restricted:
          type: boolean
          description: "Is the matter only available to members\r\nAn indicator where the matter requires membership to access"
          nullable: true
          example: false
        status:
          allOf:
            - $ref: '#/components/schemas/MatterStatus'
          description: The current status of the matter
          nullable: true
        teamAssigned:
          allOf:
            - $ref: '#/components/schemas/TeamReference'
          description: The team which this matter is assigned to
          nullable: true
      additionalProperties: false
    UploadFileForm:
      required:
        - targetResourceType
      type: object
      properties:
        targetResourceType:
          allOf:
            - $ref: '#/components/schemas/FileUploadResourceType'
          description: The type of the resource the file will be uploaded to
          example: Matter
        file:
          type: string
          description: The file to be uploaded
          format: binary
          nullable: true
        folderId:
          type: integer
          description: >-
            The parent folder id of the file. Leave null if the file is not in a
            folder
          format: int32
          nullable: true
          example: 32535
        targetResourceId:
          type: integer
          description: >-
            The id of the resource the file will be uploaded to. Required unless
            TargetResourceType is ContractCreation
          format: int32
          nullable: true
          example: 65436
      additionalProperties: false
    UploadFileVersionForm:
      type: object
      properties:
        file:
          type: string
          description: The file to be uploaded
          format: binary
          nullable: true
      additionalProperties: false
    UploadedFile:
      type: object
      properties:
        id:
          type: integer
          description: The system identifier for the file
          format: int32
          readOnly: true
          example: 9456
      additionalProperties: false
      description: Represents a file that has been uploaded
    UserFieldValue:
      title: User
      type: object
      allOf:
        - $ref: '#/components/schemas/UserReference'
    UserReference:
      type: object
      properties:
        email:
          type: string
          description: The email of the user
          readOnly: true
          example: api.developer@lawvu.com
        firstName:
          type: string
          description: The first name of the user
          readOnly: true
          example: Api
        id:
          type: string
          description: The identifier of the user
          example: f0f1e06e-3005-4093-af7f-1934d55617e1
        lastName:
          type: string
          description: The last name of the user
          readOnly: true
          example: Developer
        organizationId:
          type: integer
          description: The organization the user belongs to
          format: int32
          readOnly: true
          example: 8134
      additionalProperties: false
