Skip to main content
PATCH
/
v1
/
components
/
{id}
/
code
Update component code
curl --request PATCH \
  --url https://api.yalg.ai/v1/components/{id}/code \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "Metric comparison card",
  "prompt": "Create a clean animated metric card for a 9:16 video.",
  "category": "metric"
}
'
{
  "id": "018f9f51-4b89-778f-9c0b-fd4626f47326",
  "name": "Metric comparison card",
  "category": "metric",
  "isPublic": false,
  "isValidated": true,
  "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

Component UUID

Example:

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

Body

application/json
sourceCode
string

Updated source code for the component

Response

Code updated successfully

Generated visual component.

id
string<uuid>

Component identifier.

Example:

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

name
string
Example:

"Metric counter"

category
string
Example:

"chart"

code
string

Generated component source code.

isPublic
boolean
Example:

false

isValidated
boolean
Example:

true

createdAt
string<date-time>
Example:

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

updatedAt
string<date-time>
Example:

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