{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-create-tree-response-schema.json",
  "title": "The tree descriptor returned from the tree creation request. Might include the collection of deeply inserted nodes if were requested. If some nodes insertion failed with errors or because of throttling they are returned in `nodes.unprocessed` collection with error codes. If there were too many nodes in request to execute synchronously then asynchronous operation (changeset) is initiated and the descriptor is returned in the `nodes.async` property.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-connect-organizer-openapi.yml#/components/schemas/CreateTreeResponse",
  "required": [
    "createdAt",
    "createdBy",
    "forestId",
    "id",
    "modifiedAt",
    "modifiedBy",
    "type",
    "v"
  ],
  "type": "object",
  "properties": {
    "forestId": {
      "type": "string",
      "description": "The forest identifier."
    },
    "id": {
      "type": "string",
      "description": "The tree identifier."
    },
    "createdAt": {
      "type": "string",
      "description": "The creation timestamp.",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string",
      "description": "The identifier of the user created the tree."
    },
    "modifiedAt": {
      "type": "string",
      "description": "The last update timestamp.",
      "format": "date-time"
    },
    "modifiedBy": {
      "type": "string",
      "description": "The identifier of the user updated the tree last time."
    },
    "deleted": {
      "type": "boolean",
      "description": "The deletion flag."
    },
    "v": {
      "type": "integer",
      "description": "The version number."
    },
    "policy": {
      "type": "object",
      "properties": {},
      "description": "The access control policy document (see the Policy data model) attached to the tree. Returned only if user has rights to see the policy (org:GetTreePolicy action)."
    },
    "type": {
      "type": "string",
      "description": "The type (PBS, LBS, WPB, MBS, UBS, etc.) that affects the tree semantic and behavior."
    },
    "name": {
      "type": "string",
      "description": "The short name."
    },
    "description": {
      "type": "string",
      "description": "The description."
    },
    "metadata": {
      "type": "object",
      "properties": {},
      "description": "Application specific metadata for the tree."
    },
    "nodes": {
      "type": "array",
      "description": "The collection of nodes have been inserted as part of the request if any.",
      "items": {
        "$ref": "#/$defs/NodeResponse"
      }
    },
    "nodes.unprocessed": {
      "type": "array",
      "description": "The collection of nodes requested to be inserted but unprocessed by some reason. The typical reason in THROTTLING means the service usage capacity is exceeded and the request for these nodes should be retried.",
      "items": {
        "$ref": "#/$defs/UnprocessedCreateNode"
      }
    },
    "nodes.async": {
      "$ref": "#/$defs/OperationAccepted"
    },
    "_actions": {
      "type": "array",
      "description": "Metadata. The list of context actions caller is allowed to perform on the resource. Please see the explanation with a warning about the use of this information in the introduction section.",
      "items": {
        "type": "string",
        "description": "The action."
      }
    }
  },
  "$defs": {
    "CreateNodeRequest": {
      "title": "The node creation request.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier to assign to the new node. If not present the server will generate a random identifier."
        },
        "name": {
          "type": "string",
          "description": "The name."
        },
        "links": {
          "type": "array",
          "description": "The set of links representing the associated entities. Links cannot be empty or null. There cannot be duplicate links.",
          "items": {
            "type": "string",
            "description": "The link."
          }
        },
        "geometry": {
          "title": "The geometry data.",
          "required": [
            "data"
          ],
          "type": "object",
          "properties": {
            "data": {
              "type": "string",
              "description": "The base64 encoded geometry data."
            },
            "contentType": {
              "type": "string",
              "description": "The content type (MIME) of the geometry data."
            }
          }
        },
        "metadata": {
          "type": "object",
          "properties": {},
          "description": "Application specific metadata for the node."
        }
      }
    },
    "NodeResponse": {
      "title": "The node of the tree.",
      "required": [
        "count",
        "createdAt",
        "createdBy",
        "forestId",
        "id",
        "modifiedAt",
        "modifiedBy",
        "treeId",
        "v"
      ],
      "type": "object",
      "properties": {
        "forestId": {
          "type": "string",
          "description": "The forest identifier."
        },
        "treeId": {
          "type": "string",
          "description": "The tree identifier."
        },
        "id": {
          "type": "string",
          "description": "The node identifier."
        },
        "createdAt": {
          "type": "string",
          "description": "The creation timestamp.",
          "format": "date-time"
        },
        "createdBy": {
          "type": "string",
          "description": "The identifier of the user created the node."
        },
        "modifiedAt": {
          "type": "string",
          "description": "The last update timestamp.",
          "format": "date-time"
        },
        "modifiedBy": {
          "type": "string",
          "description": "The identifier of the user updated the node last time."
        },
        "deleted": {
          "type": "boolean",
          "description": "The deletion flag."
        },
        "v": {
          "type": "integer",
          "description": "The version number."
        },
        "name": {
          "type": "string",
          "description": "The name."
        },
        "count": {
          "type": "integer",
          "description": "The number of links associated with this node. This property returned always, even if 'nolinks' query parameter is used and links are not returned in the response."
        },
        "links": {
          "type": "array",
          "description": "The inlined set of links representing the associated entities. Each link in the linkset represents the associated entity. This set can be potentially large and can be suppressed in the response using the 'nolinks' query parameter so links can be queried later for many nodes in parallel. If there are too many links instead of inlining links service could automatically externalize linkset, in this case instead of this property, the 'linksUrl' will be returned.",
          "items": {
            "type": "string",
            "description": "The link. It is recommended to use FRN notation."
          }
        },
        "linksUrl": {
          "type": "string",
          "description": "The url to download a linkset for the node. Each link in the linkset represents the associated entity. It is recommended to use FRN notation for the link. Links are returned in the json array format (application/json) where each link is a separate element of the array. The url points to the content encoded based on the Accept-Encoding header (identity, gzip, deflate) in the original request. The url is signed and has an expiration time. When using this url to fetch links it should be used as-is and no additional headers (including Authorization) should be sent."
        },
        "geometry": {
          "title": "The geometry data.",
          "required": [
            "url"
          ],
          "type": "object",
          "properties": {
            "url": {
              "type": "string",
              "description": "The url to download geometry data for the node. The url is signed and has an expiration time. When using this url to fetch the geometry it should be used as-is and no additional headers (including Authorization) should be sent. If this property is missing then there is no geometry attached to the node."
            },
            "contentType": {
              "type": "string",
              "description": "The content type (MIME) of the geometry data."
            }
          }
        },
        "metadata": {
          "type": "object",
          "properties": {},
          "description": "Application specific metadata for the node."
        },
        "_actions": {
          "type": "array",
          "description": "Metadata. The list of context actions caller is allowed to perform on the resource. Please see the explanation with a warning about the use of this information in the introduction section.",
          "items": {
            "type": "string",
            "description": "The action."
          }
        }
      }
    },
    "OperationAccepted": {
      "title": "The descriptor for operation accepted to be executed asynchronously.",
      "required": [
        "id",
        "statusUrl"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "statusUrl": {
          "type": "string",
          "description": "Url of the status monitor resource that represents the current state of the asynchronous processing."
        }
      }
    },
    "UnprocessedCreateNode": {
      "title": "The unprocessed create node request with an error.",
      "required": [
        "code",
        "message"
      ],
      "type": "object",
      "properties": {
        "item": {
          "$ref": "#/$defs/CreateNodeRequest"
        },
        "code": {
          "type": "string",
          "description": "The error code."
        },
        "message": {
          "type": "string",
          "description": "The error message."
        }
      }
    }
  }
}