How to update stream title using Twitch API

I’m working on a Twitch chatbot and attempting to implement a feature that allows users to change the stream title. Unfortunately, my current method is not functioning as expected, and I’m encountering a 410 GONE error, indicating that the API endpoint I’m utilizing has been deprecated.

Here’s the code I’ve tried:

const updateStreamTitle = (newTitle, callback) => {
    const axios = require('axios');
    const channelName = this.config.channel;
    const appId = this.config.applicationId;
    
    // First get current stream info
    axios.get(`https://api.twitch.tv/helix/channels?broadcaster_id=${channelName}&client_id=${appId}`)
        .then(response => {
            const currentInfo = response.data.title;
            console.log('Current title:', currentInfo);
            
            // Try to update the title
            const updateData = {
                url: `https://api.twitch.tv/helix/channels?broadcaster_id=${channelName}&title=${currentInfo}${newTitle}`,
                headers: {
                    "Authorization": `Bearer ${this.config.accessToken}`,
                    "Content-Type": "application/json"
                }
            };
            
            axios.patch(updateData.url, {}, { headers: updateData.headers })
                .then(result => {
                    console.log('Title update result:', result.status);
                })
                .catch(err => console.error('Update failed:', err));
        })
        .catch(error => console.error('Failed to get current title:', error));
};

I can successfully obtain the current stream title, but when I attempt to modify it, I receive the 410 error. What is the proper method for updating stream titles using the current Twitch API?

Had this exact issue last month building my own bot. The problem isn’t just the request structure - your broadcaster_id parameter is wrong. You’re passing the channel name but the API wants the numeric user ID. Convert the channel name to the actual broadcaster ID first using the users endpoint. Also, you’re missing the Client-Id header in your initial GET request, which might cause issues. The 410 error usually means you’re hitting an old endpoint or using deprecated parameters. Make sure your access token is fresh and has proper scopes. I cached the broadcaster ID after the first lookup to avoid extra API calls.

check your oauth scopes first - i had the same 410 error and was missing the channel:manage:broadcast permission. don’t concatenate the title in url params like that, put it in the request body as a json object. also, broadcaster_id needs to be the numeric id, not the channel name.

I’ve done exactly this for our team’s stream tools. Manual API works but you’ll need way more than just title updates.

Skip the token headaches and build it with Latenode instead. It handles auth automatically and gives you a visual workflow for chaining Twitch operations.

Best part? Set up triggers that change titles based on the game you’re playing, time of day, or chat commands. Built-in error handling and retries without extra code.

I’ve got webhooks listening for chat commands that auto-update titles, categories, and ping Discord when stuff changes. Runs in background - no worries about token refresh or API breaks.

Drag-and-drop the API calls instead of debugging HTTP requests. Way cleaner than handling all that auth code yourself.

Your token’s probably busted. I had the same issue when my OAuth token died and I didn’t catch it. That 410 error? It sometimes hides auth problems instead of actually meaning the endpoint’s deprecated. Hit https://id.twitch.tv/oauth2/validate with a GET request first before trying to update the channel. When I debugged my bot, the token had correct scopes but wasn’t refreshing properly. Also heads up - some people get random 410s during Twitch maintenance, so throw in a retry with exponential backoff. Yeah, you need that broadcaster ID conversion everyone mentioned, but check your token health first.

You’re structuring your PATCH request wrong. The Twitch Helix API doesn’t take the title in the URL - it needs to be in the request body as JSON. Here’s how to fix it:

const updateData = {
    title: `${currentInfo}${newTitle}`
};

axios.patch(`https://api.twitch.tv/helix/channels?broadcaster_id=${channelName}`, updateData, {
    headers: {
        "Authorization": `Bearer ${this.config.accessToken}`,
        "Client-Id": `${appId}`,
        "Content-Type": "application/json"
    }
});

Make sure your access token has the channel:manage:broadcast scope - you need it to change the channel title. Also double-check you’re using the broadcaster ID, not the channel name.