openapi: 3.1.0
info:
  title: Tango Asset Details Outbound API
  version: "1.0"
  description: |
    Async **delta** REST API: client GETs asset detail records that were
    updated in Tango since the last integration run. Two-call pattern with
    `gu_id` and pagination. Null fields are omitted from the JSON.

    NOTE: source data-mapping table uses the typo `purchage_value` for the
    purchase-value field. Preserved verbatim in the schema; the matching
    inbound API spec uses the correctly-spelled `purchase_value`. Confirm
    which spelling is the actual wire format.
  x-direction: outbound
  x-source: Tango
  x-destination: Client System
servers:
  - url: https://api.tangoanalytics.com
    description: Production
  - url: https://testapi.tangoanalytics.com
    description: Test (SIT/UAT)
tags:
  - name: Assets (Delta)
  - name: Status
paths:
  /v1/assetmgmt/delta/assetdetails:
    get:
      summary: Initiate delta asset export (async)
      operationId: getAssetsDelta
      tags: [Assets (Delta)]
      parameters:
        - $ref: "#/components/parameters/XClient"
        - $ref: "#/components/parameters/XApiKey"
      responses:
        "200":
          description: Async ack with gu_id.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AcceptedResponse"
  /v1/batch/status:
    get:
      summary: Retrieve asset records by gu_id
      operationId: getAssetsByGuId
      tags: [Status]
      parameters:
        - $ref: "#/components/parameters/XClient"
        - $ref: "#/components/parameters/XApiKey"
        - in: query
          name: gu_id
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: Asset records (delta).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssetBatchResponse"
components:
  securitySchemes:
    xClientHeader: { type: apiKey, in: header, name: x-client }
    xApiKeyHeader: { type: apiKey, in: header, name: x-api-key }
  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:
    AcceptedResponse:
      type: object
      required: [status]
      properties:
        status: { type: string, enum: [OK, Error] }
        status_message: { type: string }
        gu_id: { type: string, format: uuid }
    AssetBatchResponse:
      type: object
      required: [records]
      properties:
        records:
          type: array
          items:
            $ref: "#/components/schemas/AssetRecord"
    AssetRecord:
      type: object
      description: |
        Outbound asset detail. Null fields are omitted from the JSON entirely.
        The source data-mapping table does not annotate required fields for
        the outbound direction.
      properties:
        asset_instance_id: { type: number }
        asset_instance_number: { type: string }
        asset_instance_name: { type: string }
        asset_master_number: { type: string }
        description: { type: string }
        serial_number: { type: string }
        Tag_number:
          type: string
          description: |
            NOTE: source uses inconsistent casing — `Tag_number` (mapping table)
            vs `tag_number` (sample JSON). Mapping table preserved verbatim.
        manufacturer: { type: string }
        Model_no:
          type: string
          description: |
            NOTE: source uses inconsistent casing — `Model_no` (mapping table)
            vs `model_no` (sample JSON). Preserved verbatim.
        date_in_service: { type: string, description: "MM/DD/YYYY." }
        warranty_exp_date: { type: string, description: "MM/DD/YYYY." }
        purchage_value:
          type: number
          description: |
            Typo in source — should likely be `purchase_value` (matches inbound).
            Preserved verbatim. Confirm wire format.
        net_book_value: { type: number }
        comments: { type: string }
        date_of_purchase: { type: string, description: "MM/DD/YYYY." }
        vendor: { type: string }
        warranty_start_date: { type: string, description: "MM/DD/YYYY." }
        lease_begin_date: { type: string, description: "MM/DD/YYYY." }
        lease_end_date: { type: string, description: "MM/DD/YYYY." }
        leasing_company:
          type: string
          description: "Source types as DATE; treated as string (see Open Questions)."
        monthly_lease_payment: { type: number }
        status: { type: string }
        asset_type: { type: string }
        model_name: { type: string }
        useful_life: { type: number }
        depreciation: { type: number }
        asset_owner: { type: string }
        warranty_period: { type: number }
        associated_entity_type: { type: string }
        used_by_entity_type: { type: string }
        used_by_entity_id: { type: number }
        used_by_entity_number: { type: string }
        associated_entity_number: { type: string }
        property_number:
          type: string
          description: |
            Source typed as `VARCAHR` (typo for VARCHAR); preserved
            as string in the schema.
        building_number:
          type: string
          description: "Source typed as `VARCAHR` (typo for VARCHAR)."
        floor_number: { type: string }
        last_update_date:
          type: string
          description: "TIMESTAMP — date the record was updated."
        last_updated_by:
          type: string
          description: "The process or individual who updated the record."
        c_ext_attr1:  { type: string }
        c_ext_attr2:  { type: string }
        c_ext_attr3:  { type: string }
        c_ext_attr4:  { type: string }
        c_ext_attr5:  { type: string }
        c_ext_attr6:  { type: string }
        c_ext_attr7:  { type: string }
        c_ext_attr8:  { type: string }
        c_ext_attr9:  { type: string }
        c_ext_attr10: { type: string }
        c_ext_attr11: { type: string }
        c_ext_attr12: { type: string }
        c_ext_attr13: { type: string }
        c_ext_attr14: { type: string }
        c_ext_attr15: { type: string }
        c_ext_attr16: { type: string }
        c_ext_attr17: { type: string }
        c_ext_attr18: { type: string }
        c_ext_attr19: { type: string }
        c_ext_attr20: { type: string }
        c_ext_attr21: { type: string }
        c_ext_attr22: { type: string }
        c_ext_attr23: { type: string }
        c_ext_attr24: { type: string }
        c_ext_attr25: { type: string }
        c_ext_attr26: { type: string }
        c_ext_attr27: { type: string }
        n_ext_attr1:  { type: number }
        n_ext_attr2:  { type: number }
        n_ext_attr3:  { type: number }
        n_ext_attr4:  { type: number }
        n_ext_attr5:  { type: number }
        n_ext_attr6:  { type: number }
        n_ext_attr7:  { type: number }
        n_ext_attr8:  { type: number }
        n_ext_attr9:  { type: number }
        n_ext_attr10: { type: number }
        d_ext_attr1: { type: string, description: "MM/DD/YYYY." }
        d_ext_attr2: { type: string, description: "MM/DD/YYYY." }
        d_ext_attr3: { type: string, description: "MM/DD/YYYY." }
        d_ext_attr4: { type: string, description: "MM/DD/YYYY." }
        d_ext_attr5: { type: string, description: "MM/DD/YYYY." }
security:
  - xClientHeader: []
    xApiKeyHeader: []
