Skip to main content

Delete a prompt fragment

POST 

/api/v1/prompt-fragments/delete

Deletes a fragment from the current set. The renderer reports missing fragments and other reachable-template errors; its caller can then return the original prompt.

Deleting does not rewrite the profiles that include it

A missing fragment can leave the system prompt unrendered, so literal {{template "safety" .}} text reaches the model. Generation may continue with that raw template; this is not a validated or safe fallback, and a successful response does not prove that the intended instructions were rendered. Other failures can still stop the turn.

Check dependencies before removal: page through all profiles and inspect their generationConfig.systemPrompt values, then check nested fragment includes too. Checking one page or only direct includes can miss a dependent profile.

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​

Fragment deleted

Use the fragmentId of an existing prompt fragment in your project.​

Section ID: DOC-MA-profiles-prompts-api-deletePromptFragment#example-agent-profiles-deletePromptFragment-request

Request example

{
"fragmentId": "answer-style"
}

Guide request for Retire a shared block without leaving broken includes. Replace example resource identifiers with your own authorized values.​

Section ID: DOC-MA-profiles-prompts-api-deletePromptFragment#example-cookbook-managed-agents-profiles-prompts-prompt-fragments-06-request

Request example

{
"fragmentId": "safety"
}

Illustrative response shape; omitted default fields and actual outcomes depend on the operation.​

Section ID: DOC-MA-profiles-prompts-api-deletePromptFragment#example-agent-profiles-deletePromptFragment-response

Response example

{}

Document ID: DOC-MA-profiles-prompts-api-deletePromptFragment. Section identities and revisions.

SectionStable reference
Delete a prompt fragmentDOC-MA-profiles-prompts-api-deletePromptFragment#overview
RequestDOC-MA-profiles-prompts-api-deletePromptFragment#request
ResponsesDOC-MA-profiles-prompts-api-deletePromptFragment#responses