Skip to main content
The “Update Blog Post” API allows you update blog post for any given blog site. Please use blogs/post-update.write
PUT https://services.leadconnectorhq.com/blogs/posts/{postId}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Body

title
string
default:"Your blog title"
required
locationId
string
default:"Account ID"
required
blogId
string
default:"Blog ID"
required
You can find the blog id from blog site dashboard link
imageUrl
string
default:"Image URl"
required
description
string
default:"A short description"
required
rawHTML
string
default:"<h1>Your blog content</h1>"
required
status
string
default:"PUBLISHED"
required
Posibles valores: ‘DRAFT’, ‘PUBLISHED’, ‘SCHEDULED’, ‘ARCHIVED’
imageAltText
string
default:"Alt text for your blog image"
required
categories
string[]
required
This needs to be array of category ids, which you can get from the category get api call.
tags
string[]
author
string
default:"6683abde331c041f32c07aea"
required
This needs to be author id, which you can get from the author get api call.
urlSlug
string
default:"any-blog-post-url"
required
publishedAt
string
default:"2025-02-05T18:30:47.000Z"
required
Provide ISO timestamp

Respuestas

updatedBlogPost
object
required
{
  "updatedBlogPost": {
    "categories": [
      "659ecabc4a37969a2b7cc370",
      "6683abde331c041f32c07aee"
    ],
    "tags": [
      "Apple",
      "Banana"
    ],
    "archived": false,
    "_id": "66c381b38be80858b9af62b6",
    "title": "Banana is good source of energy",
    "description": "Description",
    "imageUrl": "https://storage.googleapis.com/ghl-test/fACm0Ojm5oC70G3DcFmE/media/66b5aa3b1745b2713a8d033f.jpeg",
    "status": "PUBLISHED",
    "imageAltText": "alt",
    "urlSlug": "banana-good-energy",
    "canonicalLink": "https://blog.chatgpts.agency/post/test-8384",
    "author": "659ec9634a3796e4e47cc360",
    "publishedAt": "2024-08-19T17:14:57.000Z",
    "updatedAt": "2024-08-19T17:32:36.182Z"
  }
}
{}
{}
{}

Ejemplo

curl -X PUT 'https://services.leadconnectorhq.com/blogs/posts/YOUR_postId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Your blog title",
  "locationId": "Account ID",
  "blogId": "Blog ID",
  "imageUrl": "Image URl",
  "description": "A short description",
  "rawHTML": "<h1>Your blog content</h1>",
  "status": "PUBLISHED",
  "imageAltText": "Alt text for your blog image",
  "categories": [
    "9c48df2694a849b6089f9d0d3513efe",
    "6683abde331c041f32c07aee"
  ],
  "tags": [
    "blog",
    "seo"
  ],
  "author": "6683abde331c041f32c07aea",
  "urlSlug": "any-blog-post-url",
  "canonicalLink": "https://tryghl.blog/post/testing-unsplash",
  "publishedAt": "2025-02-05T18:30:47.000Z"
}'
const response = await fetch('https://services.leadconnectorhq.com/blogs/posts/YOUR_postId', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"title": "Your blog title", "locationId": "Account ID", "blogId": "Blog ID", "imageUrl": "Image URl", "description": "A short description", "rawHTML": "<h1>Your blog content</h1>", "status": "PUBLISHED", "imageAltText": "Alt text for your blog image", "categories": ["9c48df2694a849b6089f9d0d3513efe", "6683abde331c041f32c07aee"], "tags": ["blog", "seo"], "author": "6683abde331c041f32c07aea", "urlSlug": "any-blog-post-url", "canonicalLink": "https://tryghl.blog/post/testing-unsplash", "publishedAt": "2025-02-05T18:30:47.000Z"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'PUT',
    'https://services.leadconnectorhq.com/blogs/posts/YOUR_postId',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"title": "Your blog title", "locationId": "Account ID", "blogId": "Blog ID", "imageUrl": "Image URl", "description": "A short description", "rawHTML": "<h1>Your blog content</h1>", "status": "PUBLISHED", "imageAltText": "Alt text for your blog image", "categories": ["9c48df2694a849b6089f9d0d3513efe", "6683abde331c041f32c07aee"], "tags": ["blog", "seo"], "author": "6683abde331c041f32c07aea", "urlSlug": "any-blog-post-url", "canonicalLink": "https://tryghl.blog/post/testing-unsplash", "publishedAt": "2025-02-05T18:30:47.000Z"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/blogs/posts/YOUR_postId');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'title': 'Your blog title', 'locationId': 'Account ID', 'blogId': 'Blog ID', 'imageUrl': 'Image URl', 'description': 'A short description', 'rawHTML': '<h1>Your blog content</h1>', 'status': 'PUBLISHED', 'imageAltText': 'Alt text for your blog image', 'categories': ['9c48df2694a849b6089f9d0d3513efe', '6683abde331c041f32c07aee'], 'tags': ['blog', 'seo'], 'author': '6683abde331c041f32c07aea', 'urlSlug': 'any-blog-post-url', 'canonicalLink': 'https://tryghl.blog/post/testing-unsplash', 'publishedAt': '2025-02-05T18:30:47.000Z'}),
]);
$data = json_decode(curl_exec($ch), true);