Skip to content

Update Ghost Settings

Use the following endpoint to update Ghost integration settings. Ensure you send the parameters nested under a settings key in the JSON body.

PATCH /api/v1/public/integrations/ghost/update-settings

Include your API key in the Authorization header:

Terminal window
Authorization: Bearer YOUR_API_KEY
// Example: Update Ghost integration status and website URL
const settingsToUpdate = {
"isIntegrated": true,
"autoPublish": "false",
"credentials": {
"websiteUrl": "https://myblog.example.com",
"apiKey": "siteApiKeyPlaceholder"
}
};
// Endpoint: {API_ENDPOINTS.INTEGRATIONS.GHOST.UPDATE_SETTINGS}
fetch('https://api.blogz.ai/api/v1/public/integrations/ghost/update-settings', {
method: 'PATCH', // Use PATCH for partial updates
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ settings: settingsToUpdate}) // Send only the settings to update
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json(); // Expecting JSON like { success: true, integration: { ... } }
})
.then(data => console.log('Ghost settings updated:', data))
.catch(error => console.error('Error updating Ghost settings:', error));