Managing a Campaign's Claygent Skills with the Clay CLI
?q={your_question}.Managing a Campaign's Claygent Skills with the Clay CLI
Change which Claygent skills back a campaign, using Clay's real campaigns update-claygent command, which replaces the whole skill list rather than patching it, and rejects anything it doesn't strictly recognize.
What you will build
A read-modify-write cycle: read the campaign's current skill list, build the intended full list, and write it back.
clay campaigns get <campaign-id> (read current enabledSkills)
↓
clay campaigns update-claygent <campaign-id> --input '{"enabledSkillIds":[...]}'
↓
{ enabledSkillIds: [...] } (the full new list, not a diff)
AI Prompt
Using the Clay CLI, update the skills enabled on a campaign's Claygent.
Requirements:
- `clay campaigns update-claygent <campaign-id> --input '{"enabledSkillIds":
[...]}'`. The input is a strict object containing only "enabledSkillIds";
any other key is rejected outright.
- The submitted array replaces the current list. Read the campaign first
(`clay campaigns get`), copy its complete current enabledSkillIds, then add
or remove the ids you actually intend to change; there is no partial/diff
update.
- Campaign fields and document connections are not expressible through this
command, only the skill id list.
- An empty array is valid input and clears every enabled skill.
- Run the verification step below before finishing.
Prerequisites
- The
clayCLI on PATH, authenticated viaclay login(an OAuth session, not a Public API key) jq
Note: JSON samples below are trimmed to the fields relevant to each step. Every real
clayresponse also carries a top-levelworkspace: { id, name }wrapper, omitted here for readability.
1. Read the current skill list first
clay campaigns get cam_0tl84os74M6XWkVnp2s | jq '.claygentSettings.enabledSkills'
2. Submit a strict update
clay campaigns update-claygent cam_0tl84os74M6XWkVnp2s --input '{"enabledSkillIds":[]}'
Real output: an empty list is valid and clears every enabled skill:
{"enabledSkillIds": []}
3. Confirm an unrecognized key is rejected outright
clay campaigns update-claygent cam_0tl84os74M6XWkVnp2s --input '{"foo":"bar"}'
Real output:
{"error": {"code": "validation_error", "message": "option '--input <json|file|->' argument '{\"foo\":\"bar\"}' is invalid. --input: Invalid input: expected array, received undefined at enabledSkillIds"}}
The error names the exact missing field (enabledSkillIds) rather than a generic "invalid input," which is useful for scripting a retry that fixes the actual problem.
Verify the result
Confirm the behavior above holds by re-running the key command and checking the result:
clay campaigns update-claygent cam_0tl84os74M6XWkVnp2s --input '{"enabledSkillIds":[]}'
Expected: the command accepts a strict {"enabledSkillIds": [...]} object, replaces the full list with what's submitted, and rejects any other shape with a validation_error naming the missing field.
How it works
The whole-list-replace design (rather than an add/remove diff) mirrors audiences update --filter's same choice: the command's contract stays simple, with one input shape and one deterministic output, at the cost of requiring a read-modify-write cycle for a partial change. Because it is easy to accidentally wipe a campaign's skills by submitting a hand-typed list instead of the real current one, always read first.
Common issues
Accidentally clearing skills by not reading the current list first
Many "update" commands merge into an existing list, so it's a reasonable assumption that this one does too. It is instead a full replacement. Always clay campaigns get first and build off the real current enabledSkills ids.
Trying to change campaign fields or document connections through this command
It's a reasonable assumption that one Claygent-related command covers all Claygent-adjacent settings. This command expresses only enabledSkillIds. Document connections and other campaign fields go through campaigns update and campaigns context resolve.
Next steps
- Use
clay campaigns options skillsto see which skill ids are actually available in the workspace before enabling them. - Re-resolve context with
clay campaigns context resolveafter updating to confirm the new skills' instructions are actually pulled in.
verification:
status: verified
tested_at: "2026-09-21"
product_version: "clay CLI 1.2.0"
command: "clay campaigns update-claygent cam_0tl84os74M6XWkVnp2s --input '{\"enabledSkillIds\":[]}'"
expected_result: "The command replaces the campaign's full enabled-skills list with the submitted array, and rejects any object missing enabledSkillIds with a validation_error naming the field."