Applies to:
- Plan -
- Deployment -
Summary
Issue: A prompt slug update fails with aFailed to save prompt. Error: Slug '<your-slug>' already exists error, but GET /v1/prompt?slug=<your-slug> returns {"objects": []} and no prompt appears in the UI.
Cause: A slug is reserved by a prompt record that is not currently visible through standard API queries or in the Braintrust UI.
Resolution: Use PUT /v1/prompt to upsert the prompt with the desired slug and make it visible again.
Resolution steps
Confirm the issue
Step 1: Search for the slug in the target project
Run the following request, replacing<your-project-id> and <your-slug> with your values:
Step 2: Try updating the prompt slug
Attempt to update the prompt with the desired slug:400 error for a unique key violation, the slug conflict is confirmed.
Resolve the conflict using PUT
Step 1: Upsert the prompt
Send aPUT /v1/prompt request with the full prompt payload, including the target project_id and slug:
PUT /v1/prompt endpoint performs an upsert that can restore the prompt associated with the slug and make it visible again.