openapi: 3.0.0
info:
  title: Unified.to LEGAL API
  version: "1.0"
  description: One API to Rule Them All
  contact:
    email: hello@unified.to
    url: https://unified.to/contact
  termsOfService: https://unified.to/tos
externalDocs:
  description: API Documentation
  url: https://docs.unified.to
tags:
  - name: unifiedapi
    description: Unified.to API
  - name: legal
  - name: matter
  - name: practicearea
  - name: timeentry
  - name: expense
security:
  - jwt: []
servers:
  - url: https://api.unified.to
    description: North American data region
  - url: https://api-eu.unified.to
    description: European data region
  - url: https://api-au.unified.to
    description: Australian data region
components:
  securitySchemes:
    jwt:
      type: apiKey
      name: authorization
      in: header
  requestBodies:
    LegalMatter:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/LegalMatter"
          examples:
            legal_matter:
              summary: Sample LegalMatter
              value:
                id: 98adc845-e64c-4374-9922-05bd48f2c4cf
                created_at: "2023-05-28T04:10:42.375Z"
                updated_at: "2023-07-19T04:45:16.673Z"
                name: Spinka v. Dickinson Inc
                number: 2023-3062
                description: Arma currus curiositas utilis decor color summa peior occaecati.
                status: OPEN
                billing_method: OTHER
                stage: recusandae
                contact_ids: []
                company_ids: []
                parties:
                  - role: EXPERT
                    description: Tremayne Spinka
                client_reference: 7eNvWdA5
                currency: CRC
                opened_at: "2023-07-06T14:39:13.356Z"
                statute_of_limitations_at: "2029-09-23T05:53:17.967Z"
                metadata: []
    LegalPracticearea:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/LegalPracticearea"
          examples:
            legal_practicearea:
              summary: Sample LegalPracticearea
              value:
                id: 33a88ea2-6e14-4898-a080-274433074d30
                created_at: "2023-01-28T21:00:26.264Z"
                updated_at: "2025-09-27T02:46:27.683Z"
                name: advanced Law
                type: EDUCATION
                code: TLV
                metadata: []
    LegalTimeentry:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/LegalTimeentry"
          examples:
            legal_timeentry:
              summary: Sample LegalTimeentry
              value:
                id: 2ad9e7be-a808-4145-9328-c9a4193ba08b
                created_at: "2022-05-06T03:26:03.756Z"
                updated_at: "2022-07-01T13:23:05.640Z"
                description: Torrens volaticus comburo.
                worked_at: "2022-05-06T03:26:03.756Z"
                minutes: 390
                billable_minutes: 390
                rate_amount: 637
                total_amount: 4140.5
                currency: JOD
                is_billable: true
                metadata: []
    LegalExpense:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/LegalExpense"
          examples:
            legal_expense:
              summary: Sample LegalExpense
              value:
                id: 7ddc62f1-5a11-4478-9a13-c6f87294b3cc
                created_at: "2020-11-08T00:41:42.356Z"
                updated_at: "2024-04-25T00:33:15.049Z"
                description: Nihil sono villa voluptate cohibeo quas volo succurro.
                incurred_at: "2020-11-08T00:41:42.356Z"
                quantity: 3
                price_amount: 100
                total_amount: 300
                currency: GBP
                type: OTHER
                category: Baby
                is_billed: false
                metadata: []
  schemas:
    property_LegalMatter_contact_ids:
      type: array
      items:
        type: string
      description: CRM Contacts that are clients on this matter
    property_LegalMatter_company_ids:
      type: array
      items:
        type: string
      description: CRM Companies that are clients on this matter
    LegalParty:
      type: object
      properties:
        contact_id:
          type: string
          description: pointer to a CRM Contact
        company_id:
          type: string
          description: pointer to a CRM Company
        role:
          type: string
          description: the party role on the matter
          enum:
            - CLIENT
            - OPPOSING_PARTY
            - OPPOSING_COUNSEL
            - CO_COUNSEL
            - WITNESS
            - EXPERT
            - JUDGE
            - REFERRER
            - OTHER
          x-speakeasy-unknown-values: allow
        description:
          type: string
          description: the vendor's free-text relationship description
    property_LegalMatter_parties:
      type: array
      items:
        $ref: "#/components/schemas/LegalParty"
      description: all people and organizations related to this matter, with their role
    property_LegalMatter_user_ids:
      type: array
      items:
        type: string
      description: other HR Employees assigned to this matter
    LegalMetadata:
      type: object
      properties:
        id:
          type: string
          description: the custom field identifier
        slug:
          type: string
          description: the custom field key
        value:
          description: the custom field value
          additionalProperties: true
          anyOf:
            - type: object
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                anyOf:
                  - type: object
                  - type: string
                  - type: number
                  - type: boolean
        namespace:
          type: string
          description: the scope or origin of the custom field
        format:
          type: string
          description: the data type of the value
          enum:
            - TEXT
            - NUMBER
            - DATE
            - BOOLEAN
            - FILE
            - TEXTAREA
            - SINGLE_SELECT
            - MULTIPLE_SELECT
            - MEASUREMENT
            - PRICE
            - YES_NO
            - CURRENCY
            - URL
          x-speakeasy-unknown-values: allow
        extra_data:
          description: additional data about the custom field
          additionalProperties: true
          anyOf:
            - type: object
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                anyOf:
                  - type: object
                  - type: string
                  - type: number
                  - type: boolean
    property_LegalMatter_metadata:
      type: array
      items:
        $ref: "#/components/schemas/LegalMetadata"
      description: custom field values
    LegalMatter:
      type: object
      properties:
        id:
          type: string
          description: unique identifier for the matter
        created_at:
          type: string
          format: date-time
          description: when the matter was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        updated_at:
          type: string
          format: date-time
          description: when the matter was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        name:
          type: string
          description: the matter name
        number:
          type: string
          description: the firm's display/matter number
        description:
          type: string
          description: free-text description of the matter
        status:
          type: string
          description: the matter status
          enum:
            - PENDING
            - OPEN
            - CLOSED
            - OTHER
          x-speakeasy-unknown-values: allow
        billing_method:
          type: string
          description: how the matter is billed
          enum:
            - HOURLY
            - FLAT_FEE
            - CONTINGENCY
            - OTHER
          x-speakeasy-unknown-values: allow
        practicearea_id:
          type: string
          description: pointer to the Legal Practicearea object
        stage:
          type: string
          description: the matter stage name
        contact_ids:
          $ref: "#/components/schemas/property_LegalMatter_contact_ids"
          description: CRM Contacts that are clients on this matter
        company_ids:
          $ref: "#/components/schemas/property_LegalMatter_company_ids"
          description: CRM Companies that are clients on this matter
        parties:
          $ref: "#/components/schemas/property_LegalMatter_parties"
          description: all people and organizations related to this matter, with their role
        user_id:
          type: string
          description: HR Employee who is the responsible attorney (reference to HrisEmployee)
        originating_user_id:
          type: string
          description: HR Employee who is the originating attorney (reference to HrisEmployee)
        user_ids:
          $ref: "#/components/schemas/property_LegalMatter_user_ids"
          description: other HR Employees assigned to this matter (reference to HrisEmployee)
        client_reference:
          type: string
          description: the client's own reference number for this matter
        currency:
          type: string
          description: ISO 4217 currency code
        is_billable:
          type: boolean
          description: whether the matter is billable
        opened_at:
          type: string
          format: date-time
          description: when the matter was opened (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        closed_at:
          type: string
          format: date-time
          description: when the matter was closed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        pending_at:
          type: string
          format: date-time
          description: when the matter became pending (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        statute_of_limitations_at:
          type: string
          format: date-time
          description: statute of limitations deadline for the matter (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        metadata:
          $ref: "#/components/schemas/property_LegalMatter_metadata"
          description: custom field values
        raw:
          type: object
          description: raw data from the integration
          additionalProperties: true
    LegalMatters:
      type: array
      items:
        $ref: "#/components/schemas/LegalMatter"
    property_LegalPracticearea_metadata:
      type: array
      items:
        $ref: "#/components/schemas/LegalMetadata"
      description: custom field values
    LegalPracticearea:
      type: object
      properties:
        id:
          type: string
          description: unique identifier for the practice area
        created_at:
          type: string
          format: date-time
          description: when the practice area was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        updated_at:
          type: string
          format: date-time
          description: when the practice area was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        name:
          type: string
          description: the practice area name
        type:
          type: string
          description: the normalized practice area type
          enum:
            - ADMINISTRATIVE
            - ADMIRALTY_AND_MARITIME
            - ANTI_TRUST_AND_COMPETITION
            - APPELLATE
            - BANKING_AND_FINANCE
            - BANKRUPTCY
            - BUSINESS_FORMATION_AND_COMPLIANCE
            - CIVIL_LITIGATION
            - CIVIL_RIGHTS_AND_CONSTITUTIONAL
            - COLLECTIONS_AND_DEBT
            - COMMERCIAL_AND_SALE_OF_GOODS
            - COMMERCIAL_LITIGATION
            - CONSTRUCTION
            - CONSUMER_PROTECTION
            - CONTRACTS
            - CORPORATE_LITIGATION
            - CRIMINAL
            - DISABILITY_AND_SOCIAL_SECURITY
            - EDUCATION
            - ELDER
            - EMPLOYMENT_AND_LABOR
            - ENERGY_AND_ENVIRONMENTAL
            - ETHICS
            - FAMILY
            - FOOD_AND_DRUG
            - GENERAL_PRACTICE
            - GOVERNMENT
            - HEALTHCARE
            - IMMIGRATION
            - IN_HOUSE_COUNSEL
            - INSURANCE
            - INTELLECTUAL_PROPERTY
            - INTERNATIONAL
            - JUVENILE
            - LEGAL_AID
            - MEDIATION_AND_ARBITRATION
            - MEDICAL_MALPRACTICE
            - MILITARY
            - MULTI_PRACTICE
            - NON_PROFIT_AND_PRO_BONO
            - OTHER
            - PERSONAL_INJURY
            - PRIVACY_AND_INFORMATION_SECURITY
            - PRIVATE_CLIENT
            - PRODUCT_LIABILITY
            - REAL_ESTATE
            - SCIENCE_AND_TECHNOLOGY
            - SECURITIES_AND_MERGERS_AND_ACQUISITIONS
            - SMALL_CLAIMS
            - SPORTS_AND_ENTERTAINMENT_AND_GAMING
            - TAX
            - TELECOMMUNICATIONS
            - TRAFFIC_OFFENSES
            - TRANSPORTATION
            - TRIBAL
            - TRUSTS
            - WILLS_AND_ESTATES
            - WORKERS_COMPENSATION
          x-speakeasy-unknown-values: allow
        code:
          type: string
          description: the practice area code
        is_active:
          type: boolean
          description: whether the practice area is active
        metadata:
          $ref: "#/components/schemas/property_LegalPracticearea_metadata"
          description: custom field values
        raw:
          type: object
          description: raw data from the integration
          additionalProperties: true
    LegalPracticeareas:
      type: array
      items:
        $ref: "#/components/schemas/LegalPracticearea"
    property_LegalTimeentry_metadata:
      type: array
      items:
        $ref: "#/components/schemas/LegalMetadata"
      description: custom field values
    LegalTimeentry:
      type: object
      properties:
        id:
          type: string
          description: unique identifier for the time entry
        created_at:
          type: string
          format: date-time
          description: when the time entry was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        updated_at:
          type: string
          format: date-time
          description: when the time entry was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        matter_id:
          type: string
          description: pointer to the Legal Matter this time is recorded against
        user_id:
          type: string
          description: HR Employee who is the timekeeper (reference to HrisEmployee)
        description:
          type: string
          description: description of the work performed
        worked_at:
          type: string
          format: date-time
          description: date the work was performed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        minutes:
          type: number
          description: duration worked, in minutes
        billable_minutes:
          type: number
          description: billable duration after rounding, in minutes
        rate_amount:
          type: number
          description: hourly rate, or the flat amount for flat-rate entries
        total_amount:
          type: number
          description: total amount of the time entry
        currency:
          type: string
          description: ISO 4217 currency code
        is_billable:
          type: boolean
          description: whether the time entry is billable
        is_billed:
          type: boolean
          description: whether the time entry has been billed
        invoice_id:
          type: string
          description: pointer to the Accounting Invoice this time was billed on (reference to AccountingInvoice)
        activity_code:
          type: string
          description: UTBMS/LEDES activity code
        task_code:
          type: string
          description: UTBMS/LEDES task code
        metadata:
          $ref: "#/components/schemas/property_LegalTimeentry_metadata"
          description: custom field values
        raw:
          type: object
          description: raw data from the integration
          additionalProperties: true
    LegalTimeentries:
      type: array
      items:
        $ref: "#/components/schemas/LegalTimeentry"
    property_LegalExpense_metadata:
      type: array
      items:
        $ref: "#/components/schemas/LegalMetadata"
      description: custom field values
    LegalExpense:
      type: object
      properties:
        id:
          type: string
          description: unique identifier for the expense
        created_at:
          type: string
          format: date-time
          description: when the expense was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        updated_at:
          type: string
          format: date-time
          description: when the expense was last updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        matter_id:
          type: string
          description: pointer to the Legal Matter this expense is recorded against
        user_id:
          type: string
          description: HR Employee who incurred or recorded the expense (reference to HrisEmployee)
        description:
          type: string
          description: free-text description of the expense
        incurred_at:
          type: string
          format: date-time
          description: date the expense was incurred (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        quantity:
          type: number
          description: number of units
        price_amount:
          type: number
          description: unit price
        total_amount:
          type: number
          description: total amount of the expense
        currency:
          type: string
          description: ISO 4217 currency code
        type:
          type: string
          description: hard cost, soft cost or other
          enum:
            - HARD_COST
            - SOFT_COST
            - OTHER
          x-speakeasy-unknown-values: allow
        category:
          type: string
          description: the vendor's expense category name
        is_billable:
          type: boolean
          description: whether the expense is billable
        is_billed:
          type: boolean
          description: whether the expense has been billed
        invoice_id:
          type: string
          description: pointer to the Accounting Invoice this expense was billed on (reference to AccountingInvoice)
        expense_code:
          type: string
          description: UTBMS/LEDES expense code
        metadata:
          $ref: "#/components/schemas/property_LegalExpense_metadata"
          description: custom field values
        raw:
          type: object
          description: raw data from the integration
          additionalProperties: true
    LegalExpenses:
      type: array
      items:
        $ref: "#/components/schemas/LegalExpense"
paths:
  /legal/{connection_id}/matter:
    post:
      summary: Create a matter
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - number
                - description
                - status
                - billing_method
                - practicearea_id
                - stage
                - contact_ids
                - company_ids
                - parties
                - user_id
                - originating_user_id
                - user_ids
                - client_reference
                - currency
                - is_billable
                - opened_at
                - closed_at
                - pending_at
                - statute_of_limitations_at
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - matter
      description: Creates a LegalMatter. Provide the unified LegalMatter fields in the request body; they are mapped to the provider's API. Returns the created LegalMatter.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalMatter"
            examples:
              legal_matter:
                summary: Sample LegalMatter
                value:
                  id: ea298461-a83b-4e26-a787-b0f6c6676e9b
                  created_at: "2023-05-28T04:10:42.375Z"
                  updated_at: "2023-07-19T04:45:16.673Z"
                  name: Spinka v. Dickinson Inc
                  number: 2023-3062
                  description: Arma currus curiositas utilis decor color summa peior occaecati.
                  status: OPEN
                  billing_method: OTHER
                  stage: recusandae
                  contact_ids: []
                  company_ids: []
                  parties:
                    - role: EXPERT
                      description: Tremayne Spinka
                  client_reference: 7eNvWdA5
                  currency: CRC
                  opened_at: "2023-07-06T14:39:13.356Z"
                  statute_of_limitations_at: "2029-09-23T05:53:17.954Z"
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalMatter"
          description: Successful
      security:
        - jwt: []
      operationId: createLegalMatter
    get:
      summary: List all matters
      parameters:
        - schema:
            type: number
          name: limit
          in: query
          required: false
        - schema:
            type: number
          name: offset
          in: query
          required: false
        - schema:
            type: string
          name: updated_gte
          in: query
          required: false
          description: Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        - schema:
            type: string
          name: sort
          in: query
          required: false
        - schema:
            type: string
          name: order
          in: query
          required: false
        - schema:
            type: string
          name: query
          in: query
          required: false
          description: Query string to search. eg. email address or name
        - schema:
            type: string
          name: user_id
          in: query
          required: false
          description: The user/employee ID to filter by (reference to HrisEmployee)
        - schema:
            type: string
          name: contact_id
          in: query
          required: false
          description: The contact ID to filter by
        - schema:
            type: string
          name: company_id
          in: query
          required: false
          description: The company ID to filter by
        - schema:
            type: string
          name: practicearea_id
          in: query
          required: false
          description: The practice area ID to filter by
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - number
                - description
                - status
                - billing_method
                - practicearea_id
                - stage
                - contact_ids
                - company_ids
                - parties
                - user_id
                - originating_user_id
                - user_ids
                - client_reference
                - currency
                - is_billable
                - opened_at
                - closed_at
                - pending_at
                - statute_of_limitations_at
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - matter
      description: Returns a list of LegalMatters. Narrow the results with the query parameters before paging, then page through them with `limit` and `offset` (the default and maximum page size depend on the integration). Use `fields` to return only the fields you need and reduce the response size. When the integration supports a total count, it is returned in the `X-Total-Count` response header. Use each item's `id` to retrieve, update, or delete it where those operations are supported.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalMatters"
          description: Successful
      security:
        - jwt: []
      operationId: listLegalMatters
  /legal/{connection_id}/matter/{id}:
    get:
      summary: Retrieve a matter
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - number
                - description
                - status
                - billing_method
                - practicearea_id
                - stage
                - contact_ids
                - company_ids
                - parties
                - user_id
                - originating_user_id
                - user_ids
                - client_reference
                - currency
                - is_billable
                - opened_at
                - closed_at
                - pending_at
                - statute_of_limitations_at
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Matter
          name: id
          in: path
          required: true
      tags:
        - legal
        - matter
      description: Retrieves a single LegalMatter by its `id`. Obtain `id` values from the corresponding list endpoint. Use `fields` to return only the fields you need.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalMatter"
          description: Successful
      security:
        - jwt: []
      operationId: getLegalMatter
    put:
      summary: Update a matter
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - number
                - description
                - status
                - billing_method
                - practicearea_id
                - stage
                - contact_ids
                - company_ids
                - parties
                - user_id
                - originating_user_id
                - user_ids
                - client_reference
                - currency
                - is_billable
                - opened_at
                - closed_at
                - pending_at
                - statute_of_limitations_at
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Matter
          name: id
          in: path
          required: true
      tags:
        - legal
        - matter
      description: Updates the LegalMatter identified by `id`. Provide the unified LegalMatter fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalMatter"
            examples:
              legal_matter:
                summary: Sample LegalMatter
                value:
                  id: 98adc845-e64c-4374-9922-05bd48f2c4cf
                  created_at: "2023-05-28T04:10:42.375Z"
                  updated_at: "2023-07-19T04:45:16.673Z"
                  name: Spinka v. Dickinson Inc
                  number: 2023-3062
                  description: Arma currus curiositas utilis decor color summa peior occaecati.
                  status: OPEN
                  billing_method: OTHER
                  stage: recusandae
                  contact_ids: []
                  company_ids: []
                  parties:
                    - role: EXPERT
                      description: Tremayne Spinka
                  client_reference: 7eNvWdA5
                  currency: CRC
                  opened_at: "2023-07-06T14:39:13.356Z"
                  statute_of_limitations_at: "2029-09-23T05:53:17.967Z"
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalMatter"
          description: Successful
      security:
        - jwt: []
      operationId: updateLegalMatter
    patch:
      summary: Update a matter
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - number
                - description
                - status
                - billing_method
                - practicearea_id
                - stage
                - contact_ids
                - company_ids
                - parties
                - user_id
                - originating_user_id
                - user_ids
                - client_reference
                - currency
                - is_billable
                - opened_at
                - closed_at
                - pending_at
                - statute_of_limitations_at
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Matter
          name: id
          in: path
          required: true
      tags:
        - legal
        - matter
      description: Updates the LegalMatter identified by `id`. Provide the unified LegalMatter fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalMatter"
            examples:
              legal_matter:
                summary: Sample LegalMatter
                value:
                  id: 98adc845-e64c-4374-9922-05bd48f2c4cf
                  created_at: "2023-05-28T04:10:42.375Z"
                  updated_at: "2023-07-19T04:45:16.673Z"
                  name: Spinka v. Dickinson Inc
                  number: 2023-3062
                  description: Arma currus curiositas utilis decor color summa peior occaecati.
                  status: OPEN
                  billing_method: OTHER
                  stage: recusandae
                  contact_ids: []
                  company_ids: []
                  parties:
                    - role: EXPERT
                      description: Tremayne Spinka
                  client_reference: 7eNvWdA5
                  currency: CRC
                  opened_at: "2023-07-06T14:39:13.356Z"
                  statute_of_limitations_at: "2029-09-23T05:53:17.967Z"
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalMatter"
          description: Successful
      security:
        - jwt: []
      operationId: patchLegalMatter
    delete:
      summary: Remove a matter
      parameters:
        - schema:
            type: boolean
          name: notify
          in: query
          required: false
          description: Whether to notify the people or systems attached to this resource (e.g. a calendar event's attendees) about its deletion. Only applies where the integration supports it; ignored otherwise. When omitted, the integration's default applies.
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Matter
          name: id
          in: path
          required: true
      tags:
        - legal
        - matter
      description: Deletes the LegalMatter identified by `id`.
      responses:
        "200":
          description: Successful
        default:
          headers:
            Content-Type:
              required: false
              schema:
                type: string
          content: {}
          description: Successful
      security:
        - jwt: []
      operationId: removeLegalMatter
  /legal/{connection_id}/practicearea:
    post:
      summary: Create a practicearea
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - type
                - code
                - is_active
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - practicearea
      description: Creates a LegalPracticearea. Provide the unified LegalPracticearea fields in the request body; they are mapped to the provider's API. Returns the created LegalPracticearea.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalPracticearea"
            examples:
              legal_practicearea:
                summary: Sample LegalPracticearea
                value:
                  id: 2c2bf415-68c1-49c9-96c8-16668a82e485
                  created_at: "2023-01-28T21:00:26.264Z"
                  updated_at: "2025-09-27T02:46:27.679Z"
                  name: advanced Law
                  type: EDUCATION
                  code: TLV
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalPracticearea"
          description: Successful
      security:
        - jwt: []
      operationId: createLegalPracticearea
    get:
      summary: List all practiceareas
      parameters:
        - schema:
            type: number
          name: limit
          in: query
          required: false
        - schema:
            type: number
          name: offset
          in: query
          required: false
        - schema:
            type: string
          name: updated_gte
          in: query
          required: false
          description: Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        - schema:
            type: string
          name: sort
          in: query
          required: false
        - schema:
            type: string
          name: order
          in: query
          required: false
        - schema:
            type: string
          name: query
          in: query
          required: false
          description: Query string to search. eg. email address or name
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - type
                - code
                - is_active
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - practicearea
      description: Returns a list of LegalPracticeareas. Narrow the results with the query parameters before paging, then page through them with `limit` and `offset` (the default and maximum page size depend on the integration). Use `fields` to return only the fields you need and reduce the response size. When the integration supports a total count, it is returned in the `X-Total-Count` response header. Use each item's `id` to retrieve, update, or delete it where those operations are supported.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalPracticeareas"
          description: Successful
      security:
        - jwt: []
      operationId: listLegalPracticeareas
  /legal/{connection_id}/practicearea/{id}:
    get:
      summary: Retrieve a practicearea
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - type
                - code
                - is_active
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Practicearea
          name: id
          in: path
          required: true
      tags:
        - legal
        - practicearea
      description: Retrieves a single LegalPracticearea by its `id`. Obtain `id` values from the corresponding list endpoint. Use `fields` to return only the fields you need.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalPracticearea"
          description: Successful
      security:
        - jwt: []
      operationId: getLegalPracticearea
    put:
      summary: Update a practicearea
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - type
                - code
                - is_active
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Practicearea
          name: id
          in: path
          required: true
      tags:
        - legal
        - practicearea
      description: Updates the LegalPracticearea identified by `id`. Provide the unified LegalPracticearea fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalPracticearea"
            examples:
              legal_practicearea:
                summary: Sample LegalPracticearea
                value:
                  id: 33a88ea2-6e14-4898-a080-274433074d30
                  created_at: "2023-01-28T21:00:26.264Z"
                  updated_at: "2025-09-27T02:46:27.683Z"
                  name: advanced Law
                  type: EDUCATION
                  code: TLV
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalPracticearea"
          description: Successful
      security:
        - jwt: []
      operationId: updateLegalPracticearea
    patch:
      summary: Update a practicearea
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - name
                - type
                - code
                - is_active
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Practicearea
          name: id
          in: path
          required: true
      tags:
        - legal
        - practicearea
      description: Updates the LegalPracticearea identified by `id`. Provide the unified LegalPracticearea fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalPracticearea"
            examples:
              legal_practicearea:
                summary: Sample LegalPracticearea
                value:
                  id: 33a88ea2-6e14-4898-a080-274433074d30
                  created_at: "2023-01-28T21:00:26.264Z"
                  updated_at: "2025-09-27T02:46:27.683Z"
                  name: advanced Law
                  type: EDUCATION
                  code: TLV
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalPracticearea"
          description: Successful
      security:
        - jwt: []
      operationId: patchLegalPracticearea
    delete:
      summary: Remove a practicearea
      parameters:
        - schema:
            type: boolean
          name: notify
          in: query
          required: false
          description: Whether to notify the people or systems attached to this resource (e.g. a calendar event's attendees) about its deletion. Only applies where the integration supports it; ignored otherwise. When omitted, the integration's default applies.
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Practicearea
          name: id
          in: path
          required: true
      tags:
        - legal
        - practicearea
      description: Deletes the LegalPracticearea identified by `id`.
      responses:
        "200":
          description: Successful
        default:
          headers:
            Content-Type:
              required: false
              schema:
                type: string
          content: {}
          description: Successful
      security:
        - jwt: []
      operationId: removeLegalPracticearea
  /legal/{connection_id}/timeentry:
    post:
      summary: Create a timeentry
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - worked_at
                - minutes
                - billable_minutes
                - rate_amount
                - total_amount
                - currency
                - is_billable
                - is_billed
                - invoice_id
                - activity_code
                - task_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - timeentry
      description: Creates a LegalTimeentry. Provide the unified LegalTimeentry fields in the request body; they are mapped to the provider's API. Returns the created LegalTimeentry.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalTimeentry"
            examples:
              legal_timeentry:
                summary: Sample LegalTimeentry
                value:
                  id: 3cac460d-33bf-419b-b58f-d96ae6712133
                  created_at: "2022-05-06T03:26:03.756Z"
                  updated_at: "2022-07-01T13:23:05.640Z"
                  description: Torrens volaticus comburo.
                  worked_at: "2022-05-06T03:26:03.756Z"
                  minutes: 390
                  billable_minutes: 390
                  rate_amount: 637
                  total_amount: 4140.5
                  currency: JOD
                  is_billable: true
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalTimeentry"
          description: Successful
      security:
        - jwt: []
      operationId: createLegalTimeentry
    get:
      summary: List all timeentries
      parameters:
        - schema:
            type: number
          name: limit
          in: query
          required: false
        - schema:
            type: number
          name: offset
          in: query
          required: false
        - schema:
            type: string
          name: updated_gte
          in: query
          required: false
          description: Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        - schema:
            type: string
          name: sort
          in: query
          required: false
        - schema:
            type: string
          name: order
          in: query
          required: false
        - schema:
            type: string
          name: query
          in: query
          required: false
          description: Query string to search. eg. email address or name
        - schema:
            type: string
          name: matter_id
          in: query
          required: false
          description: The matter ID to filter by
        - schema:
            type: string
          name: user_id
          in: query
          required: false
          description: The user/employee ID to filter by (reference to HrisEmployee)
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - worked_at
                - minutes
                - billable_minutes
                - rate_amount
                - total_amount
                - currency
                - is_billable
                - is_billed
                - invoice_id
                - activity_code
                - task_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - timeentry
      description: Returns a list of LegalTimeentries. Narrow the results with the query parameters before paging, then page through them with `limit` and `offset` (the default and maximum page size depend on the integration). Use `fields` to return only the fields you need and reduce the response size. When the integration supports a total count, it is returned in the `X-Total-Count` response header. Use each item's `id` to retrieve, update, or delete it where those operations are supported.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalTimeentries"
          description: Successful
      security:
        - jwt: []
      operationId: listLegalTimeentries
  /legal/{connection_id}/timeentry/{id}:
    get:
      summary: Retrieve a timeentry
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - worked_at
                - minutes
                - billable_minutes
                - rate_amount
                - total_amount
                - currency
                - is_billable
                - is_billed
                - invoice_id
                - activity_code
                - task_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Timeentry
          name: id
          in: path
          required: true
      tags:
        - legal
        - timeentry
      description: Retrieves a single LegalTimeentry by its `id`. Obtain `id` values from the corresponding list endpoint. Use `fields` to return only the fields you need.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalTimeentry"
          description: Successful
      security:
        - jwt: []
      operationId: getLegalTimeentry
    put:
      summary: Update a timeentry
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - worked_at
                - minutes
                - billable_minutes
                - rate_amount
                - total_amount
                - currency
                - is_billable
                - is_billed
                - invoice_id
                - activity_code
                - task_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Timeentry
          name: id
          in: path
          required: true
      tags:
        - legal
        - timeentry
      description: Updates the LegalTimeentry identified by `id`. Provide the unified LegalTimeentry fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalTimeentry"
            examples:
              legal_timeentry:
                summary: Sample LegalTimeentry
                value:
                  id: 2ad9e7be-a808-4145-9328-c9a4193ba08b
                  created_at: "2022-05-06T03:26:03.756Z"
                  updated_at: "2022-07-01T13:23:05.640Z"
                  description: Torrens volaticus comburo.
                  worked_at: "2022-05-06T03:26:03.756Z"
                  minutes: 390
                  billable_minutes: 390
                  rate_amount: 637
                  total_amount: 4140.5
                  currency: JOD
                  is_billable: true
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalTimeentry"
          description: Successful
      security:
        - jwt: []
      operationId: updateLegalTimeentry
    patch:
      summary: Update a timeentry
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - worked_at
                - minutes
                - billable_minutes
                - rate_amount
                - total_amount
                - currency
                - is_billable
                - is_billed
                - invoice_id
                - activity_code
                - task_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Timeentry
          name: id
          in: path
          required: true
      tags:
        - legal
        - timeentry
      description: Updates the LegalTimeentry identified by `id`. Provide the unified LegalTimeentry fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalTimeentry"
            examples:
              legal_timeentry:
                summary: Sample LegalTimeentry
                value:
                  id: 2ad9e7be-a808-4145-9328-c9a4193ba08b
                  created_at: "2022-05-06T03:26:03.756Z"
                  updated_at: "2022-07-01T13:23:05.640Z"
                  description: Torrens volaticus comburo.
                  worked_at: "2022-05-06T03:26:03.756Z"
                  minutes: 390
                  billable_minutes: 390
                  rate_amount: 637
                  total_amount: 4140.5
                  currency: JOD
                  is_billable: true
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalTimeentry"
          description: Successful
      security:
        - jwt: []
      operationId: patchLegalTimeentry
    delete:
      summary: Remove a timeentry
      parameters:
        - schema:
            type: boolean
          name: notify
          in: query
          required: false
          description: Whether to notify the people or systems attached to this resource (e.g. a calendar event's attendees) about its deletion. Only applies where the integration supports it; ignored otherwise. When omitted, the integration's default applies.
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Timeentry
          name: id
          in: path
          required: true
      tags:
        - legal
        - timeentry
      description: Deletes the LegalTimeentry identified by `id`.
      responses:
        "200":
          description: Successful
        default:
          headers:
            Content-Type:
              required: false
              schema:
                type: string
          content: {}
          description: Successful
      security:
        - jwt: []
      operationId: removeLegalTimeentry
  /legal/{connection_id}/expense:
    post:
      summary: Create an expense
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - incurred_at
                - quantity
                - price_amount
                - total_amount
                - currency
                - type
                - category
                - is_billable
                - is_billed
                - invoice_id
                - expense_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - expense
      description: Creates a LegalExpense. Provide the unified LegalExpense fields in the request body; they are mapped to the provider's API. Returns the created LegalExpense.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalExpense"
            examples:
              legal_expense:
                summary: Sample LegalExpense
                value:
                  id: ca10fbd8-ce89-4001-89e4-d78cb254226c
                  created_at: "2020-11-08T00:41:42.356Z"
                  updated_at: "2024-04-25T00:33:15.045Z"
                  description: Nihil sono villa voluptate cohibeo quas volo succurro.
                  incurred_at: "2020-11-08T00:41:42.356Z"
                  quantity: 3
                  price_amount: 100
                  total_amount: 300
                  currency: GBP
                  type: OTHER
                  category: Baby
                  is_billed: false
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalExpense"
          description: Successful
      security:
        - jwt: []
      operationId: createLegalExpense
    get:
      summary: List all expenses
      parameters:
        - schema:
            type: number
          name: limit
          in: query
          required: false
        - schema:
            type: number
          name: offset
          in: query
          required: false
        - schema:
            type: string
          name: updated_gte
          in: query
          required: false
          description: Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
        - schema:
            type: string
          name: sort
          in: query
          required: false
        - schema:
            type: string
          name: order
          in: query
          required: false
        - schema:
            type: string
          name: query
          in: query
          required: false
          description: Query string to search. eg. email address or name
        - schema:
            type: string
          name: matter_id
          in: query
          required: false
          description: The matter ID to filter by
        - schema:
            type: string
          name: user_id
          in: query
          required: false
          description: The user/employee ID to filter by (reference to HrisEmployee)
        - schema:
            type: string
          name: type
          in: query
          required: false
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - incurred_at
                - quantity
                - price_amount
                - total_amount
                - currency
                - type
                - category
                - is_billable
                - is_billed
                - invoice_id
                - expense_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
      tags:
        - legal
        - expense
      description: Returns a list of LegalExpenses. Narrow the results with the query parameters before paging, then page through them with `limit` and `offset` (the default and maximum page size depend on the integration). Use `fields` to return only the fields you need and reduce the response size. When the integration supports a total count, it is returned in the `X-Total-Count` response header. Use each item's `id` to retrieve, update, or delete it where those operations are supported.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalExpenses"
          description: Successful
      security:
        - jwt: []
      operationId: listLegalExpenses
  /legal/{connection_id}/expense/{id}:
    get:
      summary: Retrieve an expense
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - incurred_at
                - quantity
                - price_amount
                - total_amount
                - currency
                - type
                - category
                - is_billable
                - is_billed
                - invoice_id
                - expense_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Expense
          name: id
          in: path
          required: true
      tags:
        - legal
        - expense
      description: Retrieves a single LegalExpense by its `id`. Obtain `id` values from the corresponding list endpoint. Use `fields` to return only the fields you need.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalExpense"
          description: Successful
      security:
        - jwt: []
      operationId: getLegalExpense
    put:
      summary: Update an expense
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - incurred_at
                - quantity
                - price_amount
                - total_amount
                - currency
                - type
                - category
                - is_billable
                - is_billed
                - invoice_id
                - expense_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Expense
          name: id
          in: path
          required: true
      tags:
        - legal
        - expense
      description: Updates the LegalExpense identified by `id`. Provide the unified LegalExpense fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalExpense"
            examples:
              legal_expense:
                summary: Sample LegalExpense
                value:
                  id: 7ddc62f1-5a11-4478-9a13-c6f87294b3cc
                  created_at: "2020-11-08T00:41:42.356Z"
                  updated_at: "2024-04-25T00:33:15.049Z"
                  description: Nihil sono villa voluptate cohibeo quas volo succurro.
                  incurred_at: "2020-11-08T00:41:42.356Z"
                  quantity: 3
                  price_amount: 100
                  total_amount: 300
                  currency: GBP
                  type: OTHER
                  category: Baby
                  is_billed: false
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalExpense"
          description: Successful
      security:
        - jwt: []
      operationId: updateLegalExpense
    patch:
      summary: Update an expense
      parameters:
        - schema:
            type: array
            items:
              type: string
              enum:
                - id
                - created_at
                - updated_at
                - matter_id
                - user_id
                - description
                - incurred_at
                - quantity
                - price_amount
                - total_amount
                - currency
                - type
                - category
                - is_billable
                - is_billed
                - invoice_id
                - expense_code
                - metadata
                - raw
          name: fields
          in: query
          required: false
          description: Fields to return
        - schema:
            type: string
          name: raw
          in: query
          required: false
          description: "Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar"
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Expense
          name: id
          in: path
          required: true
      tags:
        - legal
        - expense
      description: Updates the LegalExpense identified by `id`. Provide the unified LegalExpense fields to change in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegalExpense"
            examples:
              legal_expense:
                summary: Sample LegalExpense
                value:
                  id: 7ddc62f1-5a11-4478-9a13-c6f87294b3cc
                  created_at: "2020-11-08T00:41:42.356Z"
                  updated_at: "2024-04-25T00:33:15.049Z"
                  description: Nihil sono villa voluptate cohibeo quas volo succurro.
                  incurred_at: "2020-11-08T00:41:42.356Z"
                  quantity: 3
                  price_amount: 100
                  total_amount: 300
                  currency: GBP
                  type: OTHER
                  category: Baby
                  is_billed: false
                  metadata: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LegalExpense"
          description: Successful
      security:
        - jwt: []
      operationId: patchLegalExpense
    delete:
      summary: Remove an expense
      parameters:
        - schema:
            type: boolean
          name: notify
          in: query
          required: false
          description: Whether to notify the people or systems attached to this resource (e.g. a calendar event's attendees) about its deletion. Only applies where the integration supports it; ignored otherwise. When omitted, the integration's default applies.
        - schema:
            type: string
          description: ID of the connection
          name: connection_id
          in: path
          required: true
        - schema:
            type: string
          description: ID of the Expense
          name: id
          in: path
          required: true
      tags:
        - legal
        - expense
      description: Deletes the LegalExpense identified by `id`.
      responses:
        "200":
          description: Successful
        default:
          headers:
            Content-Type:
              required: false
              schema:
                type: string
          content: {}
          description: Successful
      security:
        - jwt: []
      operationId: removeLegalExpense
