feeds.update()
Update properties of an existing feed you own.
Signature
feeds.update(feedId: string, input: UpdateFeedInput): Promise<Feed>Parameters
feedId
- Type:
string - Required: Yes
- Description: The UUID of the feed to update
input
- Type:
UpdateFeedInput
interface UpdateFeedInput {
name?: string;
description?: string;
tags?: string[];
category_id?: string;
image_url?: string;
is_active?: boolean;
}Returns
- Type:
Promise<Feed>
Returns the updated feed object with all current properties.
Usage
Basic Example
const updatedFeed = await grapevine.feeds.update(feedId, {
name: 'Updated Feed Name',
description: 'New description for my feed'
});
console.log('Updated:', updatedFeed.name);Update Tags
const feed = await grapevine.feeds.update(feedId, {
tags: ['crypto', 'defi', 'analysis']
});
console.log('New tags:', feed.tags);Change Category
// Get categories
const categories = await grapevine.categories.getAll();
const techCategory = categories.find(c => c.name === 'Technology');
// Update feed category
const feed = await grapevine.feeds.update(feedId, {
category_id: techCategory?.id
});
// To remove category, omit the category_id field
const uncategorized = await grapevine.feeds.update(feedId, {
name: 'Uncategorized Feed' // Update other fields without category_id
});Toggle Active Status
// Deactivate feed
const deactivated = await grapevine.feeds.update(feedId, {
is_active: false
});
// Reactivate feed
const reactivated = await grapevine.feeds.update(feedId, {
is_active: true
});Behind the Scenes
This method:
- Validates input parameters
- Gets authentication headers (nonce + signature)
- Makes PATCH request to
/v1/feeds/{feedId} - Handles 402 payment if required
- Returns updated feed object
Error Handling
try {
const feed = await grapevine.feeds.update(feedId, {
name: 'New Name'
});
} catch (error) {
if (error.message.includes('404')) {
console.error('Feed not found');
} else if (error.message.includes('403')) {
console.error('Not authorized - you can only update your own feeds');
} else if (error.message.includes('402')) {
console.error('Payment required for update');
} else {
console.error('Error:', error.message);
}
}Notes
- Authentication: Required - must be feed owner
- Partial Updates: Only provide fields you want to change
- Payment: May require x402 micropayment (handled automatically)
- Ownership: Can only update feeds you own
- Active Status: Deactivating feed hides it from public listings
Related
- feeds.get() - Get feed details
- feeds.delete() - Delete a feed
- feeds.create() - Create new feed