{"skill":{"slug":"snipeit-skill","displayName":"Snipeit Skill","summary":"Interact with Snipe-IT asset management via REST API. Use when working with assets (hardware), users, licenses, accessories, consumables, components, locatio...","description":"---\nname: snipeit\ndescription: >\n  Interact with Snipe-IT asset management via REST API.\n  Use when working with assets (hardware), users, licenses, accessories,\n  consumables, components, locations, departments, models, manufacturers,\n  status labels, categories, suppliers, maintenances, reports.\n  Trigger on: \"snipe\", \"asset\", \"hardware\", \"license\", \"inventory\",\n  \"check out\", \"check in\", \"IT assets\", \"equipment\".\nmetadata:\n  clawdbot:\n    env:\n      - SNIPEIT_URL        # e.g. https://assets.w-w.top\n      - SNIPEIT_API_TOKEN  # Bearer token from your profile → API keys\n    requires:\n      - curl\n      - jq\n---\n\n# Snipe-IT Skill\n\n## Overview\n\nSnipe-IT REST API returns **200 OK** for all valid HTTP requests.\nCheck `.status` field in response — `\"success\"` or `\"error\"`.\n\nBase URL: `$SNIPEIT_URL/api/v1`\n\n---\n\n## Core Helper\n\n```bash\nsnipe() {\n  local method=\"${1:-GET}\"\n  local endpoint=\"$2\"\n  local data=\"${3:-}\"\n\n  local args=(\n    -s -X \"$method\"\n    -H \"Authorization: Bearer $SNIPEIT_API_TOKEN\"\n    -H \"Accept: application/json\"\n    -H \"Content-Type: application/json\"\n  )\n\n  [ -n \"$data\" ] && args+=(-d \"$data\")\n\n  curl \"${args[@]}\" \"${SNIPEIT_URL}/api/v1${endpoint}\" | jq .\n}\n\n# Shortcuts\nsnipe_get()    { snipe GET    \"$1\"; }\nsnipe_post()   { snipe POST   \"$1\" \"$2\"; }\nsnipe_patch()  { snipe PATCH  \"$1\" \"$2\"; }\nsnipe_put()    { snipe PUT    \"$1\" \"$2\"; }\nsnipe_delete() { snipe DELETE \"$1\"; }\n```\n\n---\n\n## Assets (Hardware)\n\n```bash\n# List all assets (with pagination)\nsnipe_get \"/hardware?limit=50&offset=0\"\n\n# Search assets\nsnipe_get \"/hardware?search=MacBook&limit=20\"\n\n# Filter by status label\nsnipe_get \"/hardware?status_id=2&limit=50\"\n\n# Get asset by ID\nsnipe_get \"/hardware/42\"\n\n# Get asset by asset tag\nsnipe_get \"/hardware/bytag/ASSET-001\"\n\n# Get asset by serial number\nsnipe_get \"/hardware/byserial/SN123456\"\n\n# Create asset\nsnipe_post \"/hardware\" '{\n  \"asset_tag\":   \"ASSET-001\",\n  \"model_id\":    5,\n  \"status_id\":   2,\n  \"name\":        \"MacBook Pro 16\",\n  \"serial\":      \"SN123456\",\n  \"location_id\": 1,\n  \"notes\":       \"Assigned to dev team\"\n}'\n\n# Update asset (PATCH = partial update)\nsnipe_patch \"/hardware/42\" '{\n  \"name\":      \"MacBook Pro 16 (updated)\",\n  \"status_id\": 3,\n  \"notes\":     \"Screen replaced\"\n}'\n\n# Full update (PUT = replace all fields)\nsnipe_put \"/hardware/42\" '{\n  \"asset_tag\":  \"ASSET-001\",\n  \"model_id\":   5,\n  \"status_id\":  2,\n  \"name\":       \"MacBook Pro 16\",\n  \"serial\":     \"SN123456\"\n}'\n\n# Delete asset\nsnipe_delete \"/hardware/42\"\n\n# Checkout asset to user\nsnipe_post \"/hardware/42/checkout\" '{\n  \"checkout_to_type\": \"user\",\n  \"assigned_user\":    7,\n  \"note\":             \"Assigned for remote work\",\n  \"checkout_at\":      \"2025-01-15\",\n  \"expected_checkin\": \"2025-12-31\"\n}'\n\n# Checkout asset to location\nsnipe_post \"/hardware/42/checkout\" '{\n  \"checkout_to_type\":  \"location\",\n  \"assigned_location\": 3,\n  \"note\":              \"Conference room setup\"\n}'\n\n# Checkout asset to another asset\nsnipe_post \"/hardware/42/checkout\" '{\n  \"checkout_to_type\": \"asset\",\n  \"assigned_asset\":   15\n}'\n\n# Checkin asset\nsnipe_post \"/hardware/42/checkin\" '{\n  \"note\":       \"Returned after use\",\n  \"checkin_at\": \"2025-06-01\"\n}'\n\n# Audit asset (confirm location)\nsnipe_post \"/hardware/audit\" '{\n  \"asset_tag\":   \"ASSET-001\",\n  \"location_id\": 2,\n  \"note\":        \"Verified during quarterly audit\"\n}'\n\n# Get audit history\nsnipe_get \"/hardware/audit/due\"\nsnipe_get \"/hardware/audit/overdue\"\n\n# List assets checked out to a user\nsnipe_get \"/users/7/assets\"\n\n# Restore deleted asset\nsnipe_post \"/hardware/42/restore\" '{}'\n```\n\n---\n\n## Users\n\n```bash\n# List all users\nsnipe_get \"/users?limit=50\"\n\n# Search users\nsnipe_get \"/users?search=john&limit=20\"\n\n# Get user by ID\nsnipe_get \"/users/7\"\n\n# Get current API user\nsnipe_get \"/users/me\"\n\n# Create user\nsnipe_post \"/users\" '{\n  \"first_name\":  \"John\",\n  \"last_name\":   \"Doe\",\n  \"username\":    \"john.doe\",\n  \"email\":       \"john.doe@example.com\",\n  \"password\":    \"SecurePass123!\",\n  \"password_confirmation\": \"SecurePass123!\",\n  \"department_id\": 2,\n  \"location_id\":   1,\n  \"employee_num\":  \"EMP-001\",\n  \"jobtitle\":      \"Developer\",\n  \"activated\":     true\n}'\n\n# Update user\nsnipe_patch \"/users/7\" '{\n  \"department_id\": 3,\n  \"jobtitle\":      \"Senior Developer\"\n}'\n\n# Delete user\nsnipe_delete \"/users/7\"\n\n# Get user's assets\nsnipe_get \"/users/7/assets\"\n\n# Get user's licenses\nsnipe_get \"/users/7/licenses\"\n\n# Get user's accessories\nsnipe_get \"/users/7/accessories\"\n\n# Get user's consumables\nsnipe_get \"/users/7/consumables\"\n```\n\n---\n\n## Licenses\n\n```bash\n# List all licenses\nsnipe_get \"/licenses?limit=50\"\n\n# Search licenses\nsnipe_get \"/licenses?search=Office&limit=20\"\n\n# Get license by ID\nsnipe_get \"/licenses/3\"\n\n# Create license\nsnipe_post \"/licenses\" '{\n  \"name\":            \"Microsoft Office 365\",\n  \"serial\":          \"XXXXX-XXXXX-XXXXX\",\n  \"seats\":           25,\n  \"category_id\":     4,\n  \"manufacturer_id\": 2,\n  \"license_email\":   \"it@example.com\",\n  \"purchase_date\":   \"2025-01-01\",\n  \"expiration_date\": \"2026-01-01\",\n  \"purchase_cost\":   \"299.99\",\n  \"notes\":           \"Annual subscription\"\n}'\n\n# Update license\nsnipe_patch \"/licenses/3\" '{\n  \"seats\": 30,\n  \"notes\": \"Seats increased\"\n}'\n\n# Delete license\nsnipe_delete \"/licenses/3\"\n\n# List license seats (who has it checked out)\nsnipe_get \"/licenses/3/seats\"\n\n# Checkout license seat to user\nsnipe_post \"/licenses/3/seats/12/checkout\" '{\n  \"assigned_to\": 7,\n  \"note\":        \"Developer license\"\n}'\n\n# Checkin license seat\nsnipe_delete \"/licenses/3/seats/12/checkin\"\n```\n\n---\n\n## Accessories\n\n```bash\n# List all accessories\nsnipe_get \"/accessories?limit=50\"\n\n# Get accessory by ID\nsnipe_get \"/accessories/8\"\n\n# Create accessory\nsnipe_post \"/accessories\" '{\n  \"name\":            \"USB-C Hub\",\n  \"category_id\":     5,\n  \"manufacturer_id\": 3,\n  \"qty\":             10,\n  \"purchase_date\":   \"2025-01-01\",\n  \"purchase_cost\":   \"49.99\",\n  \"location_id\":     1\n}'\n\n# Update accessory\nsnipe_patch \"/accessories/8\" '{\"qty\": 15}'\n\n# Delete accessory\nsnipe_delete \"/accessories/8\"\n\n# Checkout accessory to user\nsnipe_post \"/accessories/8/checkout\" '{\n  \"assigned_to\": 7,\n  \"note\":        \"For home office\"\n}'\n\n# Checkin accessory\nsnipe_post \"/accessories/8/checkin\" '{\n  \"note\": \"Returned\"\n}'\n\n# List checked-out accessories\nsnipe_get \"/accessories/8/checkedout\"\n```\n\n---\n\n## Consumables\n\n```bash\n# List consumables\nsnipe_get \"/consumables?limit=50\"\n\n# Get consumable by ID\nsnipe_get \"/consumables/5\"\n\n# Create consumable\nsnipe_post \"/consumables\" '{\n  \"name\":        \"Printer Paper A4\",\n  \"category_id\": 6,\n  \"qty\":         500,\n  \"item_no\":     \"PP-A4-500\",\n  \"purchase_cost\": \"9.99\",\n  \"location_id\": 1\n}'\n\n# Checkout consumable (decrements qty)\nsnipe_post \"/consumables/5/checkout\" '{\n  \"assigned_to\": 7,\n  \"note\":        \"For printer\"\n}'\n```\n\n---\n\n## Components\n\n```bash\n# List components\nsnipe_get \"/components?limit=50\"\n\n# Get component by ID\nsnipe_get \"/components/12\"\n\n# Create component\nsnipe_post \"/components\" '{\n  \"name\":        \"RAM 16GB DDR4\",\n  \"category_id\": 7,\n  \"qty\":         20,\n  \"serial\":      \"RAM-SN-001\",\n  \"purchase_cost\": \"89.99\",\n  \"location_id\": 1\n}'\n\n# Checkout component to asset\nsnipe_post \"/components/12/checkout\" '{\n  \"assigned_to\": 42,\n  \"assigned_qty\": 2,\n  \"note\":        \"Upgrade\"\n}'\n\n# Checkin component\nsnipe_post \"/components/12/checkin\" '{\n  \"checkin_qty\": 2\n}'\n```\n\n---\n\n## Locations\n\n```bash\n# List locations\nsnipe_get \"/locations?limit=50\"\n\n# Get location by ID\nsnipe_get \"/locations/1\"\n\n# Create location\nsnipe_post \"/locations\" '{\n  \"name\":     \"Kyiv Office\",\n  \"address\":  \"Khreschatyk 1\",\n  \"city\":     \"Kyiv\",\n  \"country\":  \"UA\",\n  \"currency\": \"UAH\"\n}'\n\n# Update location\nsnipe_patch \"/locations/1\" '{\"name\": \"Kyiv HQ\"}'\n\n# Delete location\nsnipe_delete \"/locations/1\"\n\n# Get assets at location\nsnipe_get \"/locations/1/assets\"\n\n# Get users at location\nsnipe_get \"/locations/1/users\"\n```\n\n---\n\n## Departments\n\n```bash\n# List departments\nsnipe_get \"/departments?limit=50\"\n\n# Get department by ID\nsnipe_get \"/departments/2\"\n\n# Create department\nsnipe_post \"/departments\" '{\n  \"name\":        \"Engineering\",\n  \"location_id\": 1,\n  \"manager_id\":  5\n}'\n\n# Update / Delete\nsnipe_patch  \"/departments/2\" '{\"name\": \"Engineering & DevOps\"}'\nsnipe_delete \"/departments/2\"\n```\n\n---\n\n## Models\n\n```bash\n# List models\nsnipe_get \"/models?limit=50\"\n\n# Get model by ID\nsnipe_get \"/models/5\"\n\n# Create model\nsnipe_post \"/models\" '{\n  \"name\":             \"MacBook Pro 16 M3\",\n  \"manufacturer_id\":  1,\n  \"category_id\":      1,\n  \"model_number\":     \"MBP16-M3-2024\",\n  \"depreciation_id\":  1,\n  \"eol\":              36\n}'\n```\n\n---\n\n## Status Labels\n\n```bash\n# List all status labels\nsnipe_get \"/statuslabels\"\n\n# Get status label by ID\nsnipe_get \"/statuslabels/2\"\n\n# Create status label\nsnipe_post \"/statuslabels\" '{\n  \"name\":          \"In Repair\",\n  \"type\":          \"undeployable\",\n  \"color\":         \"#ff6600\",\n  \"show_in_nav\":   true,\n  \"default_label\": false\n}'\n# Types: deployable | pending | undeployable | archived\n```\n\n---\n\n## Categories\n\n```bash\n# List categories\nsnipe_get \"/categories?limit=50\"\n\n# Create category\nsnipe_post \"/categories\" '{\n  \"name\":          \"Laptops\",\n  \"category_type\": \"asset\",\n  \"eula\":          false,\n  \"require_acceptance\": false\n}'\n# category_type: asset | accessory | consumable | component | license\n```\n\n---\n\n## Manufacturers & Suppliers\n\n```bash\n# Manufacturers\nsnipe_get \"/manufacturers?limit=50\"\nsnipe_post \"/manufacturers\" '{\"name\": \"Apple\", \"url\": \"https://apple.com\"}'\nsnipe_patch \"/manufacturers/1\" '{\"support_email\": \"support@apple.com\"}'\n\n# Suppliers\nsnipe_get \"/suppliers?limit=50\"\nsnipe_post \"/suppliers\" '{\n  \"name\":    \"Tech Distributor LLC\",\n  \"email\":   \"orders@techdist.com\",\n  \"phone\":   \"+380441234567\",\n  \"address\": \"Kyiv, Ukraine\"\n}'\n```\n\n---\n\n## Asset Maintenances\n\n```bash\n# List maintenances\nsnipe_get \"/maintenances?limit=50\"\n\n# Get maintenance by ID\nsnipe_get \"/maintenances/3\"\n\n# Create maintenance record\nsnipe_post \"/maintenances\" '{\n  \"asset_id\":          42,\n  \"supplier_id\":       2,\n  \"asset_maintenance_type\": \"Repair\",\n  \"title\":             \"Screen replacement\",\n  \"start_date\":        \"2025-06-01\",\n  \"completion_date\":   \"2025-06-05\",\n  \"cost\":              \"150.00\",\n  \"notes\":             \"Cracked screen replaced under warranty\",\n  \"is_warranty\":       true\n}'\n\n# Update maintenance\nsnipe_patch \"/maintenances/3\" '{\"completion_date\": \"2025-06-04\", \"cost\": \"120.00\"}'\n\n# Delete maintenance\nsnipe_delete \"/maintenances/3\"\n```\n\n---\n\n## Reports & Activity\n\n```bash\n# Activity log (recent actions)\nsnipe_get \"/reports/activity?limit=50\"\n\n# Filter activity by item type\nsnipe_get \"/reports/activity?item_type=App%5CModels%5CAsset&limit=20\"\n\n# Filter by action type\nsnipe_get \"/reports/activity?action_type=checkout&limit=20\"\n\n# Filter by user\nsnipe_get \"/reports/activity?user_id=7&limit=20\"\n```\n\n---\n\n## Custom Fields\n\n```bash\n# List all custom fields\nsnipe_get \"/fields\"\n\n# List fieldsets\nsnipe_get \"/fieldsets\"\n\n# Get fieldset by ID (includes its fields)\nsnipe_get \"/fieldsets/2\"\n\n# Update custom field value on asset (use field's db_column_name)\nsnipe_patch \"/hardware/42\" '{\n  \"custom_fields\": {\n    \"_snipeit_purchase_order_1\": \"PO-2025-001\",\n    \"_snipeit_warranty_months_2\": \"36\"\n  }\n}'\n```\n\n---\n\n## Settings\n\n```bash\n# Get app settings\nsnipe_get \"/settings\"\n\n# List backup files\nsnipe_get \"/settings/backups\"\n\n# Download backup\nsnipe_get \"/settings/backups/download/backup-2025-06-01.zip\"\n\n# Get app version\nsnipe_get \"/version\"\n```\n\n---\n\n## Common Workflows\n\n### Full asset onboarding\n```bash\n# 1. Get or create model\nmodel_id=$(snipe_get \"/models?search=MacBook+Pro+16\" | jq '.rows[0].id // empty')\n\n# 2. Create asset\nasset_id=$(snipe_post \"/hardware\" \"{\n  \\\"asset_tag\\\":   \\\"ASSET-$(date +%Y%m%d-%H%M)\\\",\n  \\\"model_id\\\":    $model_id,\n  \\\"status_id\\\":   2,\n  \\\"name\\\":        \\\"MacBook Pro 16\\\",\n  \\\"location_id\\\": 1\n}\" | jq '.payload.id')\n\necho \"Created asset ID: $asset_id\"\n\n# 3. Checkout to user\nsnipe_post \"/hardware/$asset_id/checkout\" \"{\n  \\\"checkout_to_type\\\": \\\"user\\\",\n  \\\"assigned_user\\\":    7,\n  \\\"note\\\":             \\\"New hire onboarding\\\"\n}\"\n```\n\n### Quarterly audit\n```bash\n# Get all assets overdue for audit\nsnipe_get \"/hardware/audit/overdue\" | jq '.rows[] | {id, asset_tag, name, last_audit_date}'\n\n# Confirm each asset location\nwhile IFS= read -r asset_tag; do\n  snipe_post \"/hardware/audit\" \"{\n    \\\"asset_tag\\\":   \\\"$asset_tag\\\",\n    \\\"location_id\\\": 1\n  }\" | jq '{status, messages}'\ndone < asset_tags.txt\n```\n\n### License compliance check\n```bash\n# For each license, compare seats vs checked out\nsnipe_get \"/licenses?limit=100\" | jq '.rows[] | {\n  name,\n  total_seats:     .seats,\n  available_seats: .free_seats_count,\n  checked_out:     (.seats - .free_seats_count)\n}'\n```\n\n### User offboarding\n```bash\nuser_id=7\n\n# Get all assets\nsnipe_get \"/users/$user_id/assets\" | jq '.rows[] | .id' | while read asset_id; do\n  snipe_post \"/hardware/$asset_id/checkin\" '{\"note\": \"User offboarding\"}'\n  echo \"Checked in asset $asset_id\"\ndone\n\n# Get all accessories\nsnipe_get \"/users/$user_id/accessories\" | jq '.rows[] | .id' | while read acc_id; do\n  snipe_post \"/accessories/$acc_id/checkin\" '{\"note\": \"User offboarding\"}'\ndone\n\n# Deactivate user\nsnipe_patch \"/users/$user_id\" '{\"activated\": false}'\necho \"User $user_id deactivated\"\n```\n\n---\n\n## Error Handling\n\n```bash\nsnipe_safe() {\n  local result\n  result=$(snipe \"$@\")\n  local status=$(echo \"$result\" | jq -r '.status // \"success\"')\n\n  if [ \"$status\" = \"error\" ]; then\n    echo \"❌ Error: $(echo \"$result\" | jq -r '.messages')\" >&2\n    return 1\n  fi\n\n  echo \"$result\"\n}\n\n# Usage\nsnipe_safe GET \"/hardware/42\"\nsnipe_safe POST \"/hardware/42/checkout\" '{\"checkout_to_type\":\"user\",\"assigned_user\":7}'\n```\n\n---\n\n## Setup\n\n```bash\nexport SNIPEIT_URL=\"https://assets.w-w.top\"\nexport SNIPEIT_API_TOKEN=\"your_token_here\"\n```\n\n**Getting API token:**\n1. Log in → click your avatar (top right)\n2. **Manage API Keys** → **Create New Token**\n3. Give it a name → copy the token\n\n**Important notes:**\n- Always send both `Content-Type: application/json` AND `Accept: application/json`\n- API always returns `200 OK` — check `.status` field for `\"success\"` / `\"error\"`\n- Use `?limit=` and `?offset=` for pagination (max 500 per request)\n- Dates format: `YYYY-MM-DD`\n- Monetary values: string `\"99.99\"` not number","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":862,"installsAllTime":2,"installsCurrent":2,"stars":0,"versions":1},"createdAt":1771809257300,"updatedAt":1778491612653},"latestVersion":{"version":"1.0.0","createdAt":1771809257300,"changelog":"Initial release of snipeit-skill.\n\n- Provides shell helpers for Snipe-IT asset management via REST API.\n- Supports operations for assets, users, licenses, accessories, consumables, components, locations, and departments.\n- Includes detailed bash examples for listing, searching, creating, updating, deleting, and checking in/out entities.\n- Uses environment variables for API configuration; requires curl and jq.","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"bivex","userId":"s17cqbtses1324y0fqmwtcq5hd884k12","displayName":"bivex","image":"https://avatars.githubusercontent.com/u/209128140?v=4"},"moderation":null}