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

# Insert/update lease records (async)



## OpenAPI

````yaml /tango_lease/integrations/guides/lease-inbound.yaml put /v1/leasemgmt/batch/leases
openapi: 3.1.0
info:
  title: Tango Lease Inbound API
  version: '0.5'
  description: |
    Async REST API: client inserts / updates lease records (and child entities:
    Basic Info, Options & Terms, Contacts, Recurring Costs, Allocations,
    Obligations, Clauses) in Tango. Async pattern: PUT returns gu_id; client
    polls /v1/batch/status.

    Identification key: either `lease_id` (Tango internal) or the combination
    of `lease_number` + `country` + `brand_id`. If the lease does not exist,
    an error is returned (this integration updates only).

    The source design doc does NOT include the request-body schema — the field
    list lives in tab-specific child entities and is referenced indirectly via
    validations. The YAML defines the request shape generically with
    `additionalProperties: true` and captures the validations explicitly.
  x-direction: inbound
  x-source: Client System
  x-destination: Tango
servers:
  - url: https://api.tangoanalytics.com
    description: Production
  - url: https://testapi.tangoanalytics.com
    description: Test (SIT/UAT)
security:
  - xClientHeader: []
    xApiKeyHeader: []
tags:
  - name: Leases
  - name: Status
paths:
  /v1/leasemgmt/batch/leases:
    put:
      tags:
        - Leases
      summary: Insert/update lease records (async)
      operationId: putLeasesBatch
      parameters:
        - $ref: '#/components/parameters/XClient'
        - $ref: '#/components/parameters/XApiKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeaseBatchRequest'
      responses:
        '200':
          description: Accepted for async processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AcceptedResponse'
components:
  parameters:
    XClient:
      name: x-client
      in: header
      required: true
      schema:
        type: string
    XApiKey:
      name: x-api-key
      in: header
      required: true
      schema:
        type: string
  schemas:
    LeaseBatchRequest:
      type: object
      required:
        - records
      properties:
        records:
          type: array
          items:
            $ref: '#/components/schemas/LeaseRecord'
    AcceptedResponse:
      type: object
      required:
        - status
        - gu_id
      properties:
        status:
          type: string
          enum:
            - OK
            - Error
        status_message:
          type: string
        gu_id:
          type: string
          format: uuid
    LeaseRecord:
      type: object
      description: |
        Lease record. The source design doc does not define a full field
        schema — only validations. Treat this as a permissive document
        envelope; runtime validation rules (see Markdown) enforce the contract.
      additionalProperties: true
      properties:
        lease_id:
          type: string
          description: >-
            Tango-internal lease identifier (one of lease_id /
            lease_number+country+brand_id required).
        lease_number:
          type: string
          description: Client-defined lease number.
        country:
          type: string
          description: Required if identifying via lease_number.
        brand_id:
          type: string
          description: Required if identifying via lease_number.
        legal_entity:
          type: string
        lease_type_code:
          type: string
        lease_financials_group:
          type: string
        lease_acct_classification:
          type: string
        disposition_type:
          type: string
        lease_portfolio_type:
          type: string
        currency_code:
          type: string
        tenancy_type:
          type: string
        area_measure:
          type: string
        rent_prorate_method:
          type: string
        term_status:
          type: string
        options:
          type: array
          description: |
            When present, each entry must include `option_term` and
            `option_status`. Other fields validated per the Markdown.
          items:
            type: object
            additionalProperties: true
        contacts:
          type: array
          items:
            type: object
            additionalProperties: true
        recurring_costs:
          type: array
          items:
            type: object
            additionalProperties: true
        allocations:
          type: array
          items:
            type: object
            additionalProperties: true
            required:
              - alloc_supplier_site_number
              - allocation_percentage
            properties:
              alloc_supplier_site_number:
                type: string
              allocation_percentage:
                type: number
        obligations:
          type: array
          items:
            type: object
            additionalProperties: true
            required:
              - obl_type
            properties:
              obl_type:
                type: string
        clauses:
          type: array
          items:
            type: object
            additionalProperties: true
            required:
              - clause_type
            properties:
              clause_type:
                type: string
  securitySchemes:
    xClientHeader:
      type: apiKey
      in: header
      name: x-client
    xApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````