Skip to main content
POST
/
v1
/
anecdotes
Create a new anecdote
curl --request POST \
  --url https://api.yalg.ai/v1/anecdotes \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "content": "A customer got stuck on step one, which showed us the product was explaining itself too late."
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "title": "How I Learned to Lead a Team",
  "content": "Last year, I was tasked with leading...",
  "authorId": "987fcdeb-51a2-43d7-8f9e-123456789abc",
  "storyType": "professional_stories",
  "tags": [
    "leadership",
    "teamwork"
  ],
  "mood": "reflective",
  "context": "startup",
  "lessonLearned": "Effective leadership requires trust...",
  "linkedinAngle": "Share this as a leadership lesson...",
  "priority": 1,
  "isActive": true,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

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.

Query Parameters

autoFill
boolean
required

autoFill parameter.

Example:

"example"

Body

application/json
content
string
required

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..."

title
string

Title of the anecdote (optional when autoFill is enabled)

Maximum string length: 200
Example:

"How I Learned to Lead a Team"

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 like recent events, dates, achievements that should only be used once)

Example:

false

Response

Anecdote created successfully