Update a prompt fragment
POST/api/v1/prompt-fragments/update
Partially updates a fragment via updateMask, using the mask semantics of profile update.
The change reaches every profile that includes this fragment on its next turn and increments the project-wide fragment-set version. There is no per-profile rollout.
The following access conditions are preserved as declared intent and are not implemented by generated code: Authorized scoped domain action.
Use this in a guide: Reuse and update shared assistant instructions
Request
Responses
- 200
Fragment updated; the new stored record is echoed back
Replace the content of an existing fragment, preserving its other fields.
Section ID: DOC-MA-profiles-prompts-api-updatePromptFragment#example-agent-profiles-updatePromptFragment-request
Request example
{
"fragmentId": "answer-style",
"fragment": {
"content": "Use short paragraphs and include the next action."
},
"updateMask": "content"
}
Guide request for Recipe: change shared wording across the assistants. Replace example resource identifiers with your own authorized values.
Section ID: DOC-MA-profiles-prompts-api-updatePromptFragment#example-cookbook-managed-agents-profiles-prompts-prompt-fragments-04-request
Request example
{
"fragmentId": "safety",
"fragment": {
"content": "Never give medical or dosage advice. Refer the user to a clinician."
},
"updateMask": "content"
}
Illustrative response shape; omitted default fields and actual outcomes depend on the operation.
Section ID: DOC-MA-profiles-prompts-api-updatePromptFragment#example-agent-profiles-updatePromptFragment-response
Response example
{
"fragment": {
"fragmentId": "example_123",
"name": "example",
"content": "Example text"
}
}
Document ID: DOC-MA-profiles-prompts-api-updatePromptFragment. Section identities and revisions.
| Section | Stable reference |
|---|---|
| Update a prompt fragment | DOC-MA-profiles-prompts-api-updatePromptFragment#overview |
| Request | DOC-MA-profiles-prompts-api-updatePromptFragment#request |
| Responses | DOC-MA-profiles-prompts-api-updatePromptFragment#responses |