Skip to main content
PATCH
/
v1
/
anecdotes
/
{id}
Update an anecdote
curl --request PATCH \
  --url https://api.yalg.ai/v1/anecdotes/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "title": "The onboarding lesson",
  "content": "A customer got stuck on step one, which showed us the product was explaining itself too late.",
  "mood": "reflective",
  "storyType": "lesson",
  "tags": [
    "onboarding",
    "product"
  ]
}
'
{
  "id": "018f9f41-22a1-74bb-9450-7dd0d21ab8ab",
  "title": "The onboarding lesson",
  "content": "A customer got stuck on step one, which showed us the product was explaining itself too late.",
  "mood": "reflective",
  "storyType": "lesson",
  "tags": [
    "onboarding",
    "product"
  ],
  "isFavorite": false,
  "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 anecdote to update

Example:

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

Body

application/json
title
string

Title of the anecdote (optional when autoFill is enabled)

Maximum string length: 200
Example:

"How I Learned to Lead a Team"

content
string

The full content/story of the anecdote

Example:

"Last year, I was tasked with leading a cross-functional team for the first time. Initially, I struggled with delegation and tried to micromanage every detail..."

type
enum<string>
default:voice

Type of anecdote

Available options:
text,
voice
Example:

"voice"

transcript
string

Transcript of the voice anecdote (for voice type anecdotes)

Example:

"So I was reflecting on my journey from junior developer to tech lead..."

audioPath
string

Path to the audio file on disk (for voice type anecdotes)

Maximum string length: 500
Example:

"/uploads/audio/anecdote-001.mp3"

storyType
enum<string>

Type of story/anecdote (optional when autoFill is enabled)

Available options:
professional_stories,
personal_stories,
lesson_learned
Example:

"professional_stories"

authorId
string<uuid>

UUID of the user who created this anecdote (will be set from authentication token if not provided)

Example:

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

tags
string[]

Tags for categorizing and searching the anecdote (optional when autoFill is enabled)

Example:
[
"leadership",
"teamwork",
"management",
"growth"
]
contentScopes
enum<string>[]

Content formats where this anecdote can be used. Use all to make it available everywhere.

Available options:
all,
linkedin_post,
facebook_post,
youtube_script,
blog_article,
short
Example:
["youtube_script", "blog_article"]
mood
enum<string>

Mood or tone of the anecdote

Available options:
inspiring,
humorous,
reflective,
educational
Maximum string length: 50
Example:

"reflective"

context
enum<string>

Context where this anecdote took place

Available options:
work,
startup,
client meeting,
conference,
personal
Maximum string length: 100
Example:

"startup"

lessonLearned
string

The key lesson or takeaway from this anecdote

Example:

"Effective leadership requires trust, clear communication, and empowering team members to make decisions."

linkedinAngle
string

How this anecdote could be positioned for LinkedIn posting

Example:

"Share this as a leadership lesson with focus on team empowerment and growth mindset."

priority
number
default:1

Priority level for using this anecdote (1 = highest priority, 5 = lowest)

Required range: 1 <= x <= 5
Example:

1

isFavorite
boolean
default:false

Whether this anecdote is marked as favorite

Example:

false

timeSensitive
boolean
default:false

Whether this anecdote is time-sensitive (contains time-bound information that should only be used once)

Example:

false

usageCount
number

Number of times this anecdote has been used in posts

Required range: x >= 0
Example:

3

isActive
boolean
default:true

Whether this anecdote is active and available for use

Example:

true

Response

Anecdote updated successfully

Source anecdote used by YALG content workflows.

id
string<uuid>

Anecdote identifier.

Example:

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

title
string
Example:

"The onboarding lesson"

content
string
Example:

"A short story that can be turned into content."

mood
string
Example:

"reflective"

storyType
string
Example:

"lesson"

tags
string[]
isFavorite
boolean
Example:

false

createdAt
string<date-time>
Example:

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

updatedAt
string<date-time>
Example:

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