Skip to main content
PATCH
/
v1
/
posts
/
{id}
Update a post
curl --request PATCH \
  --url https://api.yalg.ai/v1/posts/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "content": "Updated post draft with a sharper hook and clearer takeaway.",
  "status": "draft"
}
'
{
  "id": "018f9f40-7d7b-7712-9b0f-2e5d9fd5df3f",
  "anecdoteId": "018f9f41-22a1-74bb-9450-7dd0d21ab8ab",
  "content": "I used to think consistency came from discipline. It actually came from removing friction.",
  "platform": "linkedin",
  "status": "draft",
  "likes": 12,
  "comments": 3,
  "shares": 1,
  "createdAt": "2026-06-20T17:24:39.000Z",
  "updatedAt": "2026-06-20T17:24:39.000Z"
}

Authorizations

x-api-key
string
header
default:yalg_live_your_api_key
required

YALG Developer API key. Send it in the x-api-key header from a server-side environment only.

Path Parameters

id
string
required

UUID of the post to update

Example:

"123e4567-e89b-12d3-a456-426614174000"

Body

application/json
content
string

The content of the LinkedIn post (optional for HOOK_CREATED status)

Maximum string length: 5000
Example:

"Just had an amazing experience at the tech conference! Here are my key takeaways..."

agentCreated
boolean

Whether the post was created by an agent

Example:

true

imageUrl
string

URL of an image to include in the post

Maximum string length: 255
Example:

"https://example.com/image.jpg"

videoUrl
string

URL of a video to include in the post

Maximum string length: 255
Example:

"https://example.com/video.mp4"

anecdoteIds
string<uuid>[]

UUIDs of the anecdotes this post is based on

Example:
[
"987fcdeb-51a2-43d7-8f9e-123456789abc",
"123e4567-e89b-12d3-a456-426614174000"
]
tags
string[]

Tags associated with the post for categorization

Example:
[
"technology",
"conference",
"networking",
"learning"
]
linkedInUrl
string

Original LinkedIn post URL

Maximum string length: 500
Example:

"https://www.linkedin.com/feed/update/urn:li:activity:1234567890"

originalTimestamp
string<date-time>

Original timestamp of the post (for imported posts)

Example:

"2023-12-01T10:30:00Z"

scheduledAt
string<date-time>

Scheduled publication timestamp for the post

Example:

"2023-12-01T15:30:00Z"

publishedAt
string<date-time>

Actual publication timestamp when the post was published

Example:

"2023-12-01T15:32:15Z"

likesCount
number

Number of likes on the post

Required range: x >= 0
Example:

42

commentsCount
number

Number of comments on the post

Required range: x >= 0
Example:

8

sharesCount
number

Number of shares/reposts of the post

Required range: x >= 0
Example:

15

impressionsCount
number

Number of impressions/views of the post

Required range: x >= 0
Example:

1250

status
enum<string>

Status of the post

Available options:
drafted,
scheduled,
published,
failed
Example:

"published"

targetPlatforms
enum<string>[]

Target platforms for publishing

Available options:
linkedin,
instagram,
facebook
Example:
["linkedin", "instagram", "facebook"]
instagramFormat
enum<string>

Instagram post format (carousel or single image)

Available options:
carousel,
single
Example:

"carousel"

isActive
boolean
default:true

Whether the post is active (visible) or soft-deleted

Example:

true

authorId
string
deprecated

Do not send this field in public API requests. YALG ignores arbitrary owner identifiers and derives the owner from the authenticated API key.

Response

Post updated successfully

Social post managed by YALG.

id
string<uuid>

Post identifier.

Example:

"018f9f40-7d7b-7712-9b0f-2e5d9fd5df3f"

anecdoteId
string<uuid>

Source anecdote identifier.

Example:

"018f9f40-7d7b-7712-9b0f-2e5d9fd5df3f"

content
string
Example:

"A publishable LinkedIn post generated from an anecdote."

platform
string
Example:

"linkedin"

status
string
Example:

"draft"

scheduledAt
string<date-time>
Example:

"2026-06-20T17:24:39.000Z"

publishedAt
string<date-time>
Example:

"2026-06-20T17:24:39.000Z"

likes
integer
Example:

12

comments
integer
Example:

3

shares
integer
Example:

1

createdAt
string<date-time>
Example:

"2026-06-20T17:24:39.000Z"

updatedAt
string<date-time>
Example:

"2026-06-20T17:24:39.000Z"