{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/buildertrend/json-schema/buildertrend-job-details-schema.json",
  "title": "JobDetails",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/buildertrend-openapi.yml#/components/schemas/JobDetails",
  "type": "object",
  "required": [
    "id",
    "name",
    "status",
    "jobType",
    "templateId",
    "contractType",
    "address",
    "clients",
    "contractPrice",
    "projectManagers",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The job's ID. Send it as `jobId` to the job-scoped routes and filters."
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "Open",
        "Presale",
        "Warranty",
        "Closed",
        "Unknown"
      ],
      "description": "`Unknown` if Buildertrend returns a status this API doesn't recognise yet."
    },
    "jobType": {
      "type": [
        "string",
        "null"
      ],
      "description": "The job type as Buildertrend names it."
    },
    "templateId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The `id` of the template the job was created from, if any."
    },
    "contractType": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "FixedPrice",
        "OpenBook"
      ],
      "description": "How the job is priced. `null` if Buildertrend returns a contract type this API doesn't recognise yet."
    },
    "address": {
      "$ref": "#/$defs/JobAddress"
    },
    "clients": {
      "type": "array",
      "description": "The job's clients. Empty if it has none.",
      "items": {
        "$ref": "#/$defs/JobClient"
      }
    },
    "contractPrice": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^-?(0|[1-9]\\d{0,13})(\\.\\d{1,2})?$",
      "description": "A decimal string with two decimal places, in the account's own currency exactly as entered in Buildertrend. There's no currency code. `null` when the linked user can't view job prices. Parse it as a decimal, not a float."
    },
    "projectManagers": {
      "type": "array",
      "description": "Empty if the job has none.",
      "items": {
        "$ref": "#/$defs/JobProjectManager"
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "UTC."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "UTC. For now, it doesn't change for edits to the job's status, project managers, job groups or custom fields."
    }
  },
  "$defs": {
    "JobAddress": {
      "type": "object",
      "description": "Always present. Each part is `null` when it's blank in Buildertrend. There is no country: Buildertrend stores none for a job.",
      "required": [
        "street",
        "suburb",
        "city",
        "state",
        "zip"
      ],
      "properties": {
        "street": {
          "type": [
            "string",
            "null"
          ]
        },
        "suburb": {
          "type": [
            "string",
            "null"
          ]
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "zip": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "JobClient": {
      "type": "object",
      "required": [
        "id",
        "firstName",
        "lastName",
        "displayName"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The client's user ID. `GET /api/v1/jobs/{jobId}/users` lists the same ID, except for the placeholder client Buildertrend creates for a job that has no named client."
        },
        "firstName": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ]
        },
        "displayName": {
          "type": "string",
          "description": "The client's full name as Buildertrend shows it."
        }
      }
    },
    "JobProjectManager": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The user's ID, as `GET /v1/jobs/{jobId}/users` lists it."
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}