Skip to content

Update User Account

Update an existing user account's details.

Request

http
PATCH /v1/admin/users/:id
Authorization: Bearer {admin_key}
Content-Type: application/json

Path Parameters

ParameterTypeDescription
idUUIDUser account ID

Body Parameters

All fields are optional - only include fields you want to update.

ParameterTypeDescription
namestringUser or company name
external_idstringYour customer ID
emailstringContact email
metadataobjectCustom key-value data (replaces existing)
billing_planstringBilling plan identifier

Example Request

bash
curl -X PATCH "https://api.insight.iagon.com/v1/admin/users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Corporation", "metadata": {"tier": "enterprise", "upgraded_at": "2026-01-26"}, "billing_plan": "enterprise"}'

Response

Success (200 OK)

json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "admin_key_id": "660e8400-e29b-41d4-a716-446655440001",
    "admin_entity_name": "YourCompany",
    "external_id": "cust_abc123",
    "name": "Acme Corporation",
    "email": "api@acme.com",
    "metadata": {
      "tier": "enterprise",
      "upgraded_at": "2026-01-26"
    },
    "created_at": "2026-01-26T12:00:00Z",
    "updated_at": "2026-01-26T15:30:00Z",
    "status": "active",
    "billing_plan": "enterprise"
  },
  "message": "User account updated successfully"
}

Error Responses

404 Not Found:

json
{
  "success": false,
  "error": "User account not found"
}

Notes

  • Only updates fields that are provided in the request
  • The metadata field is replaced entirely if provided (not merged)
  • The updated_at timestamp is automatically set
  • You can only update users created by your admin key