{
  "openapi": "3.1.0",
  "info": {
    "title": "additem.to API",
    "version": "1",
    "description": "Read and change additem.to inventories from your own systems. Comes with Business. Reference: https://additem.to/developers/api",
    "contact": {
      "email": "support@additem.to",
      "url": "https://additem.to/developers/api"
    }
  },
  "servers": [
    {
      "url": "https://api.additem.to/api/v1"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Your key"
    },
    {
      "name": "Inventories"
    },
    {
      "name": "Items"
    },
    {
      "name": "Locations"
    },
    {
      "name": "Tags, categories and fields"
    },
    {
      "name": "History"
    }
  ],
  "paths": {
    "/key": {
      "get": {
        "operationId": "getKey",
        "summary": "Check your key",
        "description": "The key making the call, who made it, what it may change and which inventories it is limited to. inventory_ids is null for a key that reaches every inventory its maker can. A quick way to check a key works before doing anything else.",
        "tags": [
          "Your key"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "name": "Shop",
                    "access": "read_write",
                    "hint": "ait_live_Scrdokg7",
                    "created_at": "2026-12-01T09:00:00.000Z",
                    "expires_at": null,
                    "made_by": {
                      "id": "0193a4f2-0000-7000-8000-000000000001",
                      "name": "Sam"
                    },
                    "actions": [
                      "move"
                    ],
                    "inventory_ids": [
                      "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70"
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Key"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories": {
      "get": {
        "operationId": "listInventories",
        "summary": "List inventories",
        "description": "Every inventory your key can reach, and what it may do in each. can lists read, and add, edit, move and delete where both your role and the key allow them.",
        "tags": [
          "Inventories"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                      "name": "Workshop",
                      "currency": "GBP",
                      "role": "manager",
                      "can": [
                        "read",
                        "add",
                        "edit",
                        "move",
                        "delete"
                      ]
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Inventory"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}": {
      "get": {
        "operationId": "getInventory",
        "summary": "Get an inventory",
        "description": "One inventory, in the same shape as the list.",
        "tags": [
          "Inventories"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Workshop",
                    "currency": "GBP",
                    "role": "manager",
                    "can": [
                      "read",
                      "add",
                      "edit",
                      "move",
                      "delete"
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Inventory"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}/items": {
      "get": {
        "operationId": "listItems",
        "summary": "List items",
        "description": "Items in an inventory, oldest first. With updated_since, everything changed at or after that time, deleted items included with deleted_at set, in the order they changed. Remember when you last asked and ask again from then to keep a copy up to date.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Words to find in the name, description, category, manufacturer, model, serial number, barcode, QR code and barcode fields. Case is ignored.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "description": "Only items in this location.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_sublocations",
            "in": "query",
            "required": false,
            "description": "With location_id, also the locations inside it.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Only items in this category.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag_id",
            "in": "query",
            "required": false,
            "description": "Only items with this tag.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "missing, sold or archived, none for items with no status that aren't checked out, or lent for items that are. Several, separated by commas.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "single or quantity.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "A time, such as 2026-12-01T09:30:00Z. Includes deleted items.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many per page, 1 to 200. 50 if left out.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the page before, exactly as it came.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                      "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                      "name": "Cordless drill",
                      "kind": "single",
                      "quantity": 1,
                      "unit": null,
                      "low_stock_level": null,
                      "status": null,
                      "description": null,
                      "notes": "Spare battery in the case",
                      "location": {
                        "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                        "path": "Garage > Shelf 2"
                      },
                      "category": {
                        "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                        "name": "Tools"
                      },
                      "tags": [
                        {
                          "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                          "name": "power tools"
                        }
                      ],
                      "fields": [
                        {
                          "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                          "name": "Warranty ends",
                          "type": "date",
                          "value": "2028-03-01"
                        }
                      ],
                      "manufacturer": "Makita",
                      "model": "DHP485",
                      "serial_number": null,
                      "codes": {
                        "barcode": "0088381647259",
                        "qr": null,
                        "nfc_tag_uid": null
                      },
                      "purchase": {
                        "date": "2026-03-01",
                        "price": "129.00",
                        "currency": "GBP"
                      },
                      "created_at": "2026-03-01T10:15:00.000Z",
                      "updated_at": "2026-11-30T16:02:11.000Z",
                      "deleted_at": null,
                      "checked_out": null
                    }
                  ],
                  "next_cursor": "WyIyMDI2LTAzLTAxIDEwOjE1OjAwLjAwMDAwMCIsIjAxOTNhNGYyIl0"
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Item"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createItems",
        "summary": "Add items",
        "description": "Send one item as the body, or {\"items\": [...]} for up to 100. A list is all or nothing. If any item is refused, none is added, and the error says which with its position, such as items.3.location_path. kind is single (the default) or quantity, for things counted in numbers. Location, category, tags and fields take ids or names, and an unknown name is refused with a list of the real ones. Nothing new is made for you. Needs a read and change key and the add permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique value. A repeat within 24 hours gets the first reply and changes nothing.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Cordless drill",
                    "kind": "single",
                    "quantity": 1,
                    "unit": null,
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "path": "Garage > Shelf 2"
                    },
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "kind": {
                    "type": "string",
                    "description": "single (the default) or quantity. Only when adding, it can't be changed later."
                  },
                  "quantity": {
                    "type": "integer",
                    "description": "0 or more. A single item is always 1."
                  },
                  "unit": {
                    "type": "string",
                    "description": "What a quantity item is counted in. Up to 50 characters."
                  },
                  "low_stock_level": {
                    "type": "integer",
                    "description": "0 or more."
                  },
                  "status": {
                    "type": "string",
                    "description": "missing, sold or archived, or null."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 2,000 characters."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Up to 5,000 characters."
                  },
                  "location_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Where it is. Or send location_path."
                  },
                  "location_path": {
                    "type": "string",
                    "description": "A location's full path, such as Garage > Shelf 2, or its name if only one location has it."
                  },
                  "category_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Its category. Or send category, the name."
                  },
                  "category": {
                    "type": "string",
                    "description": "A category's name."
                  },
                  "tags": {
                    "type": "array",
                    "description": "Tag ids or names, up to 100."
                  },
                  "fields": {
                    "type": "object",
                    "description": "Custom field values, keyed by the field's id or name, such as {\"Warranty ends\": \"2028-03-01\"}."
                  },
                  "manufacturer": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "model": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "serial_number": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "codes": {
                    "type": "object",
                    "description": "Any of barcode, qr and nfc_tag_uid."
                  },
                  "purchase": {
                    "type": "object",
                    "description": "date, such as 2026-03-01, and price, a number of 0 or more."
                  }
                }
              },
              "example": {
                "name": "Cordless drill",
                "location_path": "Garage > Shelf 2",
                "category": "Tools",
                "tags": [
                  "power tools"
                ],
                "fields": {
                  "Warranty ends": "2028-03-01"
                },
                "manufacturer": "Makita",
                "model": "DHP485",
                "codes": {
                  "barcode": "0088381647259"
                },
                "purchase": {
                  "date": "2026-03-01",
                  "price": "129.00"
                }
              }
            }
          }
        }
      }
    },
    "/items/{item_id}": {
      "get": {
        "operationId": "getItem",
        "summary": "Get an item",
        "description": "One item.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Cordless drill",
                    "kind": "single",
                    "quantity": 1,
                    "unit": null,
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "path": "Garage > Shelf 2"
                    },
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateItem",
        "summary": "Change an item",
        "description": "Changes only the fields you send. Moving it (location_id or location_path) or changing a quantity also needs move. kind can't be changed. Set status to missing, sold or archived, or null to clear it. To record stock coming in or going out with its history, use adjust instead of quantity. Needs a read and change key and the edit permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Cordless drill",
                    "kind": "single",
                    "quantity": 1,
                    "unit": null,
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "path": "Garage > Shelf 2"
                    },
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "kind": {
                    "type": "string",
                    "description": "single (the default) or quantity. Only when adding, it can't be changed later."
                  },
                  "quantity": {
                    "type": "integer",
                    "description": "0 or more. A single item is always 1."
                  },
                  "unit": {
                    "type": "string",
                    "description": "What a quantity item is counted in. Up to 50 characters."
                  },
                  "low_stock_level": {
                    "type": "integer",
                    "description": "0 or more."
                  },
                  "status": {
                    "type": "string",
                    "description": "missing, sold or archived, or null."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 2,000 characters."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Up to 5,000 characters."
                  },
                  "location_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Where it is. Or send location_path."
                  },
                  "location_path": {
                    "type": "string",
                    "description": "A location's full path, such as Garage > Shelf 2, or its name if only one location has it."
                  },
                  "category_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Its category. Or send category, the name."
                  },
                  "category": {
                    "type": "string",
                    "description": "A category's name."
                  },
                  "tags": {
                    "type": "array",
                    "description": "Tag ids or names, up to 100."
                  },
                  "fields": {
                    "type": "object",
                    "description": "Custom field values, keyed by the field's id or name, such as {\"Warranty ends\": \"2028-03-01\"}."
                  },
                  "manufacturer": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "model": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "serial_number": {
                    "type": "string",
                    "description": "Up to 255 characters."
                  },
                  "codes": {
                    "type": "object",
                    "description": "Any of barcode, qr and nfc_tag_uid."
                  },
                  "purchase": {
                    "type": "object",
                    "description": "date, such as 2026-03-01, and price, a number of 0 or more."
                  }
                }
              },
              "example": {
                "notes": "Battery replaced",
                "status": "missing"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteItem",
        "summary": "Delete an item",
        "description": "Moves it to Recently Deleted, as the app does. Deleting an item that's already deleted is fine. Returns 204 with no body. Needs a read and change key and the delete permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. No body."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}/items/by-code/{code}": {
      "get": {
        "operationId": "findByCode",
        "summary": "Find items by code",
        "description": "The items carrying this QR code, NFC tag or barcode. A list, because more than one item can carry the same code. Encode the code if it has characters a URL can't hold.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                      "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                      "name": "Cordless drill",
                      "kind": "single",
                      "quantity": 1,
                      "unit": null,
                      "low_stock_level": null,
                      "status": null,
                      "description": null,
                      "notes": "Spare battery in the case",
                      "location": {
                        "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                        "path": "Garage > Shelf 2"
                      },
                      "category": {
                        "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                        "name": "Tools"
                      },
                      "tags": [
                        {
                          "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                          "name": "power tools"
                        }
                      ],
                      "fields": [
                        {
                          "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                          "name": "Warranty ends",
                          "type": "date",
                          "value": "2028-03-01"
                        }
                      ],
                      "manufacturer": "Makita",
                      "model": "DHP485",
                      "serial_number": null,
                      "codes": {
                        "barcode": "0088381647259",
                        "qr": null,
                        "nfc_tag_uid": null
                      },
                      "purchase": {
                        "date": "2026-03-01",
                        "price": "129.00",
                        "currency": "GBP"
                      },
                      "created_at": "2026-03-01T10:15:00.000Z",
                      "updated_at": "2026-11-30T16:02:11.000Z",
                      "deleted_at": null,
                      "checked_out": null
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Item"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/items/{item_id}/move": {
      "post": {
        "operationId": "moveItem",
        "summary": "Move an item",
        "description": "Send location_id or location_path. null takes it out of any location. Needs a read and change key and the move permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique value. A repeat within 24 hours gets the first reply and changes nothing.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Cordless drill",
                    "kind": "single",
                    "quantity": 1,
                    "unit": null,
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "path": "Garage > Shelf 2"
                    },
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "location_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Where to move it. Or send location_path."
                  },
                  "location_path": {
                    "type": "string",
                    "description": "A location's full path. null for either takes it out of any location."
                  }
                }
              },
              "example": {
                "location_path": "Van"
              }
            }
          }
        }
      }
    },
    "/items/{item_id}/adjust": {
      "post": {
        "operationId": "adjustStock",
        "summary": "Record stock in or out",
        "description": "For quantity items. type is sold, used, lost or damaged to take stock away, restocked or found to add it, or correction with direction add or remove. amount is a whole number, 1 or more. Taking away more than there is gets a conflict error with the quantity in stock. Needs a read and change key and the move permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique value. A repeat within 24 hours gets the first reply and changes nothing.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Wood screws",
                    "kind": "quantity",
                    "quantity": 197,
                    "unit": "pcs",
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "path": "Garage > Shelf 2"
                    },
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "sold, used, lost, damaged, restocked, found or correction."
                  },
                  "amount": {
                    "type": "integer",
                    "description": "A whole number, 1 or more."
                  },
                  "direction": {
                    "type": "string",
                    "description": "add or remove. Needed for a correction."
                  },
                  "date": {
                    "type": "string",
                    "format": "date",
                    "description": "When it happened, such as 2026-12-01. Today if left out. Can't be in the future."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why, such as an order number. Up to 1,000 characters."
                  }
                },
                "required": [
                  "type",
                  "amount"
                ]
              },
              "example": {
                "type": "sold",
                "amount": 3,
                "reason": "Order 1042"
              }
            }
          }
        }
      }
    },
    "/items/{item_id}/check-out": {
      "post": {
        "operationId": "checkOut",
        "summary": "Check an item out",
        "description": "Lends a single item to someone. While it's out it has no location, and checked_out says who has it. Needs a read and change key and the move permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique value. A repeat within 24 hours gets the first reply and changes nothing.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Cordless drill",
                    "kind": "single",
                    "quantity": 1,
                    "unit": null,
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": null,
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": {
                      "to": "Alex",
                      "since": "2026-12-01T14:00:00.000Z",
                      "expected_back": "2026-12-20T00:00:00.000Z"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Who has it. Up to 255 characters."
                  },
                  "contact": {
                    "type": "string",
                    "description": "How to reach them. Up to 255 characters."
                  },
                  "expected_back": {
                    "type": "string",
                    "format": "date",
                    "description": "When it should come back. Must be in the future."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Up to 1,000 characters."
                  }
                },
                "required": [
                  "to"
                ]
              },
              "example": {
                "to": "Alex",
                "contact": "alex@example.com",
                "expected_back": "2026-12-20",
                "notes": "For the loft job"
              }
            }
          }
        }
      }
    },
    "/items/{item_id}/check-in": {
      "post": {
        "operationId": "checkIn",
        "summary": "Check an item in",
        "description": "Takes a checked-out item back, into location_id or location_path if you send one. Needs a read and change key and the move permission.",
        "tags": [
          "Items"
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique value. A repeat within 24 hours gets the first reply and changes nothing.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Cordless drill",
                    "kind": "single",
                    "quantity": 1,
                    "unit": null,
                    "low_stock_level": null,
                    "status": null,
                    "description": null,
                    "notes": "Spare battery in the case",
                    "location": {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "path": "Garage > Shelf 2"
                    },
                    "category": {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    },
                    "tags": [
                      {
                        "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                        "name": "power tools"
                      }
                    ],
                    "fields": [
                      {
                        "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                        "name": "Warranty ends",
                        "type": "date",
                        "value": "2028-03-01"
                      }
                    ],
                    "manufacturer": "Makita",
                    "model": "DHP485",
                    "serial_number": null,
                    "codes": {
                      "barcode": "0088381647259",
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "purchase": {
                      "date": "2026-03-01",
                      "price": "129.00",
                      "currency": "GBP"
                    },
                    "created_at": "2026-03-01T10:15:00.000Z",
                    "updated_at": "2026-11-30T16:02:11.000Z",
                    "deleted_at": null,
                    "checked_out": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Item"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "location_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Where to put it back. Or send location_path."
                  },
                  "location_path": {
                    "type": "string",
                    "description": "A location's full path."
                  }
                }
              },
              "example": {
                "location_path": "Garage > Shelf 2"
              }
            }
          }
        }
      }
    },
    "/inventories/{inventory_id}/locations": {
      "get": {
        "operationId": "listLocations",
        "summary": "List locations",
        "description": "Every location, flat, each with its full path and parent_id so you can build the tree. Paged and with updated_since, as items are. A deleted location has deleted_at set and no path.",
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "A time. Includes deleted locations.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many per page, 1 to 200. 50 if left out.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the page before, exactly as it came.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                      "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                      "name": "Shelf 2",
                      "path": "Garage > Shelf 2",
                      "parent_id": "0193a4f2-7b00-7e11-a0e3-4b5c6d7e8f90",
                      "type": "shelf",
                      "status": null,
                      "description": null,
                      "notes": null,
                      "address": null,
                      "codes": {
                        "barcode": null,
                        "qr": null,
                        "nfc_tag_uid": null
                      },
                      "created_at": "2026-02-12T09:00:00.000Z",
                      "updated_at": "2026-02-12T09:00:00.000Z",
                      "deleted_at": null
                    }
                  ],
                  "next_cursor": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Location"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createLocation",
        "summary": "Add a location",
        "description": "name is needed. Put it inside another with parent_id or parent_path. type is one of room, shelf, building, vehicle, container, drawer, box, garage, shed, warehouse, office, closet or other. Needs a read and change key and the add permission.",
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique value. A repeat within 24 hours gets the first reply and changes nothing.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Shelf 3",
                    "path": "Garage > Shelf 3",
                    "parent_id": "0193a4f2-7b00-7e11-a0e3-4b5c6d7e8f90",
                    "type": "shelf",
                    "status": null,
                    "description": null,
                    "notes": null,
                    "address": null,
                    "codes": {
                      "barcode": null,
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "created_at": "2026-02-12T09:00:00.000Z",
                    "updated_at": "2026-02-12T09:00:00.000Z",
                    "deleted_at": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Up to 255 characters. Needed when adding."
                  },
                  "parent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The location to put it inside. Or send parent_path. null for the top level."
                  },
                  "parent_path": {
                    "type": "string",
                    "description": "The full path of the location to put it inside."
                  },
                  "type": {
                    "type": "string",
                    "description": "room, shelf, building, vehicle, container, drawer, box, garage, shed, warehouse, office, closet or other."
                  },
                  "status": {
                    "type": "string",
                    "description": "active, inactive or archived."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 2,000 characters."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Up to 10,000 characters."
                  },
                  "address": {
                    "type": "string",
                    "description": "Up to 500 characters."
                  },
                  "codes": {
                    "type": "object",
                    "description": "Any of barcode, qr and nfc_tag_uid."
                  }
                }
              },
              "example": {
                "name": "Shelf 3",
                "parent_path": "Garage",
                "type": "shelf"
              }
            }
          }
        }
      }
    },
    "/locations/{location_id}": {
      "get": {
        "operationId": "getLocation",
        "summary": "Get a location",
        "description": "One location.",
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Shelf 2",
                    "path": "Garage > Shelf 2",
                    "parent_id": "0193a4f2-7b00-7e11-a0e3-4b5c6d7e8f90",
                    "type": "shelf",
                    "status": null,
                    "description": null,
                    "notes": null,
                    "address": null,
                    "codes": {
                      "barcode": null,
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "created_at": "2026-02-12T09:00:00.000Z",
                    "updated_at": "2026-02-12T09:00:00.000Z",
                    "deleted_at": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "updateLocation",
        "summary": "Change a location",
        "description": "Changes only the fields you send. Send parent_id or parent_path to move it, or null to make it top level. A location can't go inside itself or anything inside it. Needs a read and change key and the edit permission.",
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0193a4f2-7b10-7e22-a1f4-5c6d7e8f9a01",
                    "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                    "name": "Shelf 2",
                    "path": "Garage > Shelf 2",
                    "parent_id": "0193a4f2-7b00-7e11-a0e3-4b5c6d7e8f90",
                    "type": "shelf",
                    "status": null,
                    "description": null,
                    "notes": null,
                    "address": null,
                    "codes": {
                      "barcode": null,
                      "qr": null,
                      "nfc_tag_uid": null
                    },
                    "created_at": "2026-02-12T09:00:00.000Z",
                    "updated_at": "2026-02-12T09:00:00.000Z",
                    "deleted_at": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Up to 255 characters. Needed when adding."
                  },
                  "parent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The location to put it inside. Or send parent_path. null for the top level."
                  },
                  "parent_path": {
                    "type": "string",
                    "description": "The full path of the location to put it inside."
                  },
                  "type": {
                    "type": "string",
                    "description": "room, shelf, building, vehicle, container, drawer, box, garage, shed, warehouse, office, closet or other."
                  },
                  "status": {
                    "type": "string",
                    "description": "active, inactive or archived."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 2,000 characters."
                  },
                  "notes": {
                    "type": "string",
                    "description": "Up to 10,000 characters."
                  },
                  "address": {
                    "type": "string",
                    "description": "Up to 500 characters."
                  },
                  "codes": {
                    "type": "object",
                    "description": "Any of barcode, qr and nfc_tag_uid."
                  }
                }
              },
              "example": {
                "name": "Top shelf"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteLocation",
        "summary": "Delete a location",
        "description": "Moves it to Recently Deleted. Its items stay, in no location, and locations inside it show at the top level. Returns 204. Needs a read and change key and the delete permission.",
        "tags": [
          "Locations"
        ],
        "parameters": [
          {
            "name": "location_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done. No body."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}/tags": {
      "get": {
        "operationId": "listTags",
        "summary": "List tags",
        "description": "Every tag, by name.",
        "tags": [
          "Tags, categories and fields"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-7d30-7044-c3f6-7e8f9a0b1c23",
                      "name": "power tools",
                      "color": "orange"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "List categories",
        "description": "Every category, by name.",
        "tags": [
          "Tags, categories and fields"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-7c20-7f33-b2e5-6d7e8f9a0b12",
                      "name": "Tools"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}/fields": {
      "get": {
        "operationId": "listFields",
        "summary": "List custom fields",
        "description": "Every custom field, in the order the app shows them. options lists the choices of a select field.",
        "tags": [
          "Tags, categories and fields"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-7e40-7155-d407-8f9a0b1c2d34",
                      "name": "Warranty ends",
                      "type": "date",
                      "options": null,
                      "required": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inventories/{inventory_id}/history": {
      "get": {
        "operationId": "listHistory",
        "summary": "List history",
        "description": "What happened to the inventory's items, oldest first. Each entry has a type such as create, edit, move, delete, check_out or check_in, or a stock type. Moving a single item is recorded as a check_out from the old place and a check_in to the new one. A loan is told apart by lent_to, which only a loan has. New types may appear, so keep entries you don't recognise. Entries in the same second can be in either order.",
        "tags": [
          "History"
        ],
        "parameters": [
          {
            "name": "inventory_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only entries at or after this time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "query",
            "required": false,
            "description": "Only this item's entries.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many per page, 1 to 200. 50 if left out.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the page before, exactly as it came.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0193a4f2-9000-7a00-8000-000000000042",
                      "inventory_id": "0193a4f2-7a00-7c11-8e3d-2b1f0a9c8d70",
                      "item_id": "0193a4f2-8c1e-7d55-9b2a-4f6e1c2d3a10",
                      "type": "check_out",
                      "at": "2026-12-01T14:00:00.000Z",
                      "by": "Sam (via API key \"Shop\")",
                      "location_id": null,
                      "quantity_change": null,
                      "quantity_after": null,
                      "status_before": null,
                      "status_after": null,
                      "lent_to": "Alex",
                      "notes": "Lent to Alex",
                      "reason": null
                    }
                  ],
                  "next_cursor": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/History"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Item": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The item's id."
          },
          "inventory_id": {
            "type": "string",
            "format": "uuid",
            "description": "The inventory it belongs to."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its name. Items needn't have one, so this can be null."
          },
          "kind": {
            "type": "string",
            "description": "single for one thing tracked on its own, such as a drill. quantity for things counted in numbers, such as screws."
          },
          "quantity": {
            "type": "integer",
            "description": "How many there are. Always 1 for a single item."
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "What a quantity item is counted in, such as pcs."
          },
          "low_stock_level": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The quantity at which it counts as low on stock."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "missing, sold or archived, or null for none."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "A description."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes."
          },
          "location": {
            "type": [
              "object",
              "null"
            ],
            "description": "Where it is, as id and full path. null when it's in no location or checked out."
          },
          "category": {
            "type": [
              "object",
              "null"
            ],
            "description": "Its category, as id and name."
          },
          "tags": {
            "type": "array",
            "description": "Its tags, each with id and name, sorted by name."
          },
          "fields": {
            "type": "array",
            "description": "Its custom field values, each with the field's id, name and type, and the value."
          },
          "manufacturer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who made it."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its model number."
          },
          "serial_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its serial number."
          },
          "codes": {
            "type": "object",
            "description": "The codes it carries, each a string or null."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was added."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed. Use it with updated_since to keep a copy up to date."
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was deleted, or null. Only lists asked for with updated_since include deleted ones."
          },
          "checked_out": {
            "type": [
              "object",
              "null"
            ],
            "description": "Who has it while it's checked out, with to, since and expected_back. null when it isn't."
          }
        }
      },
      "Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The location's id."
          },
          "inventory_id": {
            "type": "string",
            "format": "uuid",
            "description": "The inventory it belongs to."
          },
          "name": {
            "type": "string",
            "description": "Its own name, such as Shelf 2."
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its full path from the top, such as Garage > Shelf 2. null once it's deleted."
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The location it's inside, or null at the top level."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "room, shelf, building, vehicle, container, drawer, box, garage, shed, warehouse, office, closet or other."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "active, inactive or archived."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "A description."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes."
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "A street address, for a building or site."
          },
          "codes": {
            "type": "object",
            "description": "The codes on it, each a string or null."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was added."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed. Use it with updated_since to keep a copy up to date."
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was deleted, or null. Only lists asked for with updated_since include deleted ones."
          }
        }
      },
      "Inventory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The inventory's id."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its currency, such as GBP. Prices are in this."
          },
          "role": {
            "type": "string",
            "description": "Your role there. owner, manager, editor, mover, viewer, or custom for a role the owner made."
          },
          "can": {
            "type": "array",
            "description": "What this key may do there. read, and add, edit, move and delete where both your role and the key allow them."
          }
        }
      },
      "Key": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name it was given, such as Shop."
          },
          "access": {
            "type": "string",
            "description": "read for a key that only reads, read_write for one that may change things."
          },
          "hint": {
            "type": "string",
            "description": "The start of the key, to tell keys apart. Never the whole key."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was made."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it stops working, or null if it never expires."
          },
          "made_by": {
            "type": "object",
            "description": "The person who made it, with id and name. The key acts as them."
          },
          "actions": {
            "type": "array",
            "description": "What it may change. Any of add, edit, move and delete."
          },
          "inventory_ids": {
            "type": [
              "array",
              "null"
            ],
            "description": "The inventories it's limited to, or null for every inventory its maker can reach."
          }
        }
      },
      "History": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The entry's id."
          },
          "inventory_id": {
            "type": "string",
            "format": "uuid",
            "description": "The inventory."
          },
          "item_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The item it's about."
          },
          "type": {
            "type": "string",
            "description": "What happened, such as create, edit, move, delete, check_out, check_in, or a stock type such as sold or restocked. New types may appear."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened."
          },
          "by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who did it, with the key's name for a change made through the API."
          },
          "location_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The location involved, if any."
          },
          "quantity_change": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How much the quantity changed, negative when it went down."
          },
          "quantity_after": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The quantity afterwards."
          },
          "status_before": {
            "type": [
              "string",
              "null"
            ],
            "description": "The status before."
          },
          "status_after": {
            "type": [
              "string",
              "null"
            ],
            "description": "The status after."
          },
          "lent_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who it was lent to. Only a loan has this."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes on the entry."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason given for a stock change."
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A key from the web app, Account, API keys. Starts with ait_live_."
      }
    },
    "responses": {
      "Error": {
        "description": "An error, always in this shape.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "unauthenticated",
                        "key_expired",
                        "forbidden",
                        "plan_required",
                        "not_found",
                        "validation_failed",
                        "conflict",
                        "rate_limited",
                        "server_error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
