Update existing items in a specific list. This endpoint allows you to modify and delete items that already exist in the item set. All fields will be overwritten.

Take the list id from the url on the Make a List page for your list. Your topic id can be taken from the url on your lists page. It will look something like “oliver-user”.

curl -X POST "<https://unduel.com/api/v1/list/update-items?user=><user name>" \\
  -H "X-API-Key: <api key>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "listId": "<list id>",
    "topicId": "<topic id>",
    "items": [
      {
        "id": "<existing item id>",
        "name": "Updated Item Name",
        "subtitle": "Updated Subtitle",
        "nameRef": "updated-item-name",
        "imageUrl": "<https://example.com/new-image.jpg>",
        "imageWidth": 400,
        "imageHeight": 400,
        "pixelated": false,
        "description": "Updated description",
        "tags": ["updated-tag1", "updated-tag2"],
        "properties": {"updated-key": "updated-value"},
        "source": "<https://new-source.com>",
        "wikiUrl": "<https://wiki.com/updated-item>",
        "isEdited": true,
        "isArchived": false,
        "shouldDelete": false,
        "shouldResetRankings": false,
        "isImageUrlChanged": true,
        "isTagsChanged": true,
        "isWikiUrlChanged": true
      }
    ]
  }'
interface UpdateItemsRequestBody {
  listId: string;
  topicId: string;
  items: EditableItemForChanging[];
}

interface EditableItemForChanging extends EditableItem {
  /** Whether the image URL has been changed */
  isImageUrlChanged: boolean;

  /** Whether the tags have been changed */
  isTagsChanged: boolean;

  /** Whether the wiki URL has been changed */
  isWikiUrlChanged: boolean;
}

interface EditableItem {
  /** Item ID
  Item ID is recommended for making item edits.
  However, you can exclude the id and instead look up items by nameRef 
  as long as there are no duplicate nameRefs on the list / item set. 
  */
  id: string;
  
  /** Item name */
  name: string;
  
  /** Optional subtitle */
  subtitle: string | null;
  
  /** URL-safe slug */
  nameRef: string;
  
  /** Image URL */
  imageUrl: string | null;
  
  /** Image dimensions */
  imageWidth: number | null;
  imageHeight: number | null;
  
  /** Is the image pixel art? */
  pixelated: boolean | null;
  
  /** Item description */
  description: string | null;
  
  /** Array of tag names to apply for filtering */
  tags: string[];
  
  /** Custom properties as key-value pairs */
  properties: { [key: string]: string };
  
  /** Source of information for item */
  source: string | null;
  
  /** Wiki url for more info on item */
  wikiUrl: string | null;
  
  /** Set to true to update item */
  isEdited: boolean;
  
  /** Set to true to archive item */
  isArchived: boolean;
  
  /** Set to true to delete item */
  shouldDelete: boolean;
  
  /** Set to true to reset item rankings */
  shouldResetRankings: boolean;
}
interface UpdateItemsResponse {
  success: boolean;
  message?: string;
  error?: string;
}