cURL
curl -X PUT https://api.neuraldraft.io/v1/components/cmp_2Ngd9KqLmRpW \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"html":"<section>…</section>"}'await nd.components.update("cmp_2Ngd9KqLmRpW", { html });
requests.put(
f"https://api.neuraldraft.io/v1/components/{id}",
headers={"Authorization": f"Bearer {key}"},
json={"html": html},
)
<?php
$client->put("components/{$id}", [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['html' => $html],
]);
{
"id": "cmp_2Ngd9KqLmRpW",
"html": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"intent": "marketing_hero",
"page_slug": "home",
"keys_created": [
"hero.headline",
"hero.subhead",
"hero.cta"
]
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Components
Update component HTML
Replace the registered HTML of a component. New data-translate
attributes create new content keys; removed attributes leave their
underlying keys orphaned (they are NOT auto-deleted, since they
may be referenced elsewhere).
PUT
/
components
/
{id}
cURL
curl -X PUT https://api.neuraldraft.io/v1/components/cmp_2Ngd9KqLmRpW \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"html":"<section>…</section>"}'await nd.components.update("cmp_2Ngd9KqLmRpW", { html });
requests.put(
f"https://api.neuraldraft.io/v1/components/{id}",
headers={"Authorization": f"Bearer {key}"},
json={"html": html},
)
<?php
$client->put("components/{$id}", [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['html' => $html],
]);
{
"id": "cmp_2Ngd9KqLmRpW",
"html": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"intent": "marketing_hero",
"page_slug": "home",
"keys_created": [
"hero.headline",
"hero.subhead",
"hero.cta"
]
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Path Parameters
Example:
"cmp_2Ngd9KqLmRpW"
Body
application/json
Response
Updated component.