> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/feature-management-experimentation/management-and-administration/api-best-practices/examples/index.md).

# Admin API Examples

### Overview <a href="#overview" id="overview"></a>

Whether you're managing feature flags at scale, migrating between environments, or reporting on usage, these examples are designed to help platform and release engineering teams speed up workflows and enforce governance.

### Common use cases <a href="#common-use-cases" id="common-use-cases"></a>

You can use these sample scripts to automate common tasks with the Admin API.

{% hint style="info" %}
All examples use the Python PyPi library for the Admin API, and require access tokens with Admin permissions. For setup instructions, see [Python PyPi Library](/feature-management-experimentation/management-and-administration/api-best-practices/wrappers/python-admin-api.md).
{% endhint %}

#### Flag lifecycle management <a href="#flag-lifecycle-management" id="flag-lifecycle-management"></a>

* [Find all Feature Flags that depend on a given flag](/feature-management-experimentation/management-and-administration/api-best-practices/examples/find-flags.md)
* [Delete a list of Feature Flags and their definitions](/feature-management-experimentation/management-and-administration/api-best-practices/examples/delete-list.md)
* [Export all feature flag definitions to JSON files](/feature-management-experimentation/management-and-administration/api-best-practices/examples/export-flag-definitions.md)
* [Copy feature flags with their definitions between projects](/feature-management-experimentation/management-and-administration/api-best-practices/examples/copy-flags.md)
* [Copy and overwrite feature flag definitions between environments](/feature-management-experimentation/management-and-administration/api-best-practices/examples/copy-flag-definition.md)
* [Export feature flags treatments to YAML file](/feature-management-experimentation/management-and-administration/api-best-practices/examples/export-treatments.md)
* [Get list of feature flags in an environment with rollout status](/feature-management-experimentation/management-and-administration/api-best-practices/examples/get-list.md)
* [Report flags with 100% treatment and no changes since a given date](/feature-management-experimentation/management-and-administration/api-best-practices/examples/report-flags.md)

#### Targeting and segments <a href="#targeting-and-segments" id="targeting-and-segments"></a>

* [Import thousands of keys to an existing segment](/feature-management-experimentation/management-and-administration/api-best-practices/examples/import-keys.md)
* [Delete thousands of keys from a segment](/feature-management-experimentation/management-and-administration/api-best-practices/examples/delete-keys.md)
* [Copy segment content to another segment](/feature-management-experimentation/management-and-administration/api-best-practices/examples/copy-segment.md)
* [Add segment to individual targets for a group of feature flags](/feature-management-experimentation/management-and-administration/api-best-practices/examples/add-segment.md)
* [Add user keys to individual targets in a flag](/feature-management-experimentation/management-and-administration/api-best-practices/examples/add-keys.md)
* [Add targeting rule to an existing feature flag](/feature-management-experimentation/management-and-administration/api-best-practices/examples/add-targeting-rule.md)

#### User and identity management <a href="#user-and-identity-management" id="user-and-identity-management"></a>

* [Fetch list of all feature flag users](/feature-management-experimentation/management-and-administration/api-best-practices/examples/fetch-list.md)
* [Create custom attribute and update an existing Identity](/feature-management-experimentation/management-and-administration/api-best-practices/examples/customer-attribute.md)

#### Metadata and reporting <a href="#metadata-and-reporting" id="metadata-and-reporting"></a>

* [Extract list of tags for flags and segments](/feature-management-experimentation/management-and-administration/api-best-practices/examples/extract-list.md)
* [Export flags that haven’t received impressions since a certain date](/feature-management-experimentation/management-and-administration/api-best-practices/examples/export-flags.md)
