Skip to main content
Archive flags and segments when they’re no longer needed instead of deleting them.
See Archiving Flags in the reference for details on what happens when you archive, when to archive, and best practices.

Archive a Flag

Archive a flag that’s no longer needed:
curl -X POST "https://api.confidence.dev/v1/flags/example-flag:archive" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Archive a Segment

Archive a segment that’s no longer needed:
curl -X POST "https://api.confidence.dev/v1/segments/my-segment:archive" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Verify Archive Status

Check if a flag is archived:
curl -X GET "https://api.confidence.dev/v1/flags/example-flag" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
The response includes an archived field set to true.

Archive Multiple Resources

Archive multiple flags or segments in sequence:
#!/bin/bash

# Archive multiple flags
for flag in "old-feature" "test-flag" "deprecated-config"; do
  curl -X POST "https://api.confidence.dev/v1/flags/$flag:archive" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  echo "Archived flag: $flag"
done

# Archive multiple segments
for segment in "experiment-1" "experiment-2" "test-segment"; do
  curl -X POST "https://api.confidence.dev/v1/segments/$segment:archive" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  echo "Archived segment: $segment"
done

Find Archival Candidates

List all flags to find archival candidates:
curl -X GET "https://api.confidence.dev/v1/flags" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
List all segments to find archival candidates:
curl -X GET "https://api.confidence.dev/v1/segments" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Next Steps

After archiving resources:
  1. Remove feature flag code from your application
  2. Update documentation to reflect production behavior
  3. Review analytics from the archived experiment
  4. Plan next experiments based on learnings