{"openapi":"3.1.0","info":{"title":"Coilinx Public API","version":"1.0.0","description":"Read-only inventory synchronization and outbound webhook events for Coilinx Pro customers.","contact":{"name":"Coilinx Support","url":"https://spoolrule.com/contact-us"}},"servers":[{"url":"https://api.spoolrule.com","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Items","description":"Inventory items and measurements."},{"name":"Material types","description":"Material definitions used by items."},{"name":"Locations","description":"Warehouses and storage locations."}],"paths":{"/inventory/items":{"get":{"tags":["Items"],"operationId":"listItems","summary":"List inventory items","description":"Returns company-scoped inventory with cursor pagination. Use updatedSince for incremental synchronization.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"warehouseId","in":"query","schema":{"type":"string"},"description":"Only return items in this location."},{"name":"materialTypeId","in":"query","schema":{"type":"string"},"description":"Only return items of this material type."},{"name":"status","in":"query","schema":{"type":"string","enum":["available","checked_out","archived"]}},{"name":"updatedSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only return items updated at or after this ISO-8601 timestamp."}],"responses":{"200":{"description":"A page of inventory items.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Item"}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/inventory/items/{itemId}":{"get":{"tags":["Items"],"operationId":"getItem","summary":"Get an inventory item","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested item.","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Item"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/inventory/types":{"get":{"tags":["Material types"],"operationId":"listMaterialTypes","summary":"List material types","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"A page of material types.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MaterialType"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/inventory/types/{typeId}":{"get":{"tags":["Material types"],"operationId":"getMaterialType","summary":"Get a material type","parameters":[{"name":"typeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested material type.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MaterialType"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/inventory/locations":{"get":{"tags":["Locations"],"operationId":"listLocations","summary":"List locations","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"A page of locations.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/inventory/locations/{locationId}":{"get":{"tags":["Locations"],"operationId":"getLocation","summary":"Get a location","parameters":[{"name":"locationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested location.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Location"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Coilinx API key","description":"Use a Pro company API key beginning with clx_live_."}},"parameters":{"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":250,"default":100}},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor returned by the previous page."}},"schemas":{"Item":{"type":"object","required":["id","name","status","locationId","materialTypeId"],"properties":{"id":{"type":"string","examples":["itm_01abc"]},"name":{"type":"string","examples":["Spool A-12"]},"status":{"type":"string","enum":["available","checked_out","archived"]},"locationId":{"type":["string","null"]},"materialTypeId":{"type":["string","null"]},"startingLength":{"type":["number","null"]},"originalLength":{"type":["number","null"]},"remainingLength":{"type":["number","null"]},"weight":{"type":["number","null"]},"weightSource":{"type":["string","null"],"enum":["scale","manual",null]},"checkedOutToUserId":{"type":["string","null"]},"checkedOutAt":{"type":["string","null"],"format":"date-time"},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}}},"MaterialType":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"width":{"type":["number","null"]},"thickness":{"type":["number","null"]},"calculatedDensity":{"type":["number","null"]},"densityDisplayUnit":{"type":["string","null"]},"densitySourceType":{"type":["string","null"]},"spoolWeight":{"type":["number","null"]},"pricePerFoot":{"type":["number","null"]},"pricePerPound":{"type":["number","null"]},"pricingBasis":{"type":["string","null"]},"currency":{"type":["string","null"]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}}},"Location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}}},"ResponseMeta":{"type":"object","required":["requestId","hasMore","nextCursor"],"properties":{"requestId":{"type":"string"},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}}},"PaginatedResponse":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}},"Error":{"type":"object","required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"retryAfter":{"type":"integer"}}},"WebhookEvent":{"type":"object","required":["eventId","type","occurredAt","companyId","data"],"properties":{"eventId":{"type":"string"},"type":{"type":"string","enum":["inventory.item.created","inventory.item.updated","inventory.item.archived","inventory.item.checked_out","inventory.item.returned","inventory.item.transferred","inventory.type.updated","inventory.location.updated"]},"occurredAt":{"type":"string","format":"date-time"},"companyId":{"type":"string"},"data":{"type":"object","additionalProperties":true}}}},"responses":{"BadRequest":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"The API key is missing, invalid, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The company is inactive, not on Pro, or the key lacks scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"The resource was not found in the authenticated company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"The per-key request limit was exceeded.","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"An unexpected error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}