# GrowthBook Custom Hooks API

**Canonical:** https://apis.io/apis/growthbook/growthbook-custom-hooks-api/  
**Provider:** GrowthBook — https://apis.io/providers/growthbook/  
**Base URL:** https://api.growthbook.io/api  
**Documentation:** https://docs.growthbook.io/api

GrowthBook Custom Hooks API is one of 51 APIs that [GrowthBook](https://apis.io/providers/growthbook/) publishes on the [APIs.io](https://apis.io/) network, described by a machine-readable OpenAPI specification. Tagged areas include custom-hooks. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

Sandboxed JavaScript validation hooks that run when features, configs, or their revisions are saved or published. Throwing an Error blocks the save; `addWarning(msg)` raises a soft warning. Hooks are scoped by projects, or pinned to a single feature/config via `entityType`/`entityId`; a config-scoped hook also runs for every config inheriting from it (its whole descendant lineage). Scope can be retargeted on update (or cleared with nulls). Requires an enterprise plan; not available on GrowthBook Cloud.

## Operations (8)

| Method | Path | Summary |
|---|---|---|
| GET | `/v1/custom-hooks` | Get all custom hooks |
| POST | `/v1/custom-hooks` | Create a single custom hook |
| POST | `/v1/custom-hooks/test` | Dry-run hook code in the sandbox |
| GET | `/v1/custom-hooks/{id}` | Get a single custom hook |
| POST | `/v1/custom-hooks/{id}` | Partially update a single custom hook |
| DELETE | `/v1/custom-hooks/{id}` | Delete a single custom hook |
| GET | `/v1/custom-hooks/{id}/history` | List a custom hook's version history |
| POST | `/v1/custom-hooks/{id}/revert` | Revert a custom hook to a previous version |

## Machine-readable artifacts (2)

- **OpenAPI** — https://raw.githubusercontent.com/api-evangelist/growthbook/refs/heads/main/openapi/growthbook-custom-hooks-api-openapi.yml
- **Documentation** — https://docs.growthbook.io/api

## Other GrowthBook APIs (12)

- [GrowthBook AnalyticsExplorations API](https://apis.io/apis/growthbook/growthbook-analyticsexplorations-api/)
- [GrowthBook Archetypes API](https://apis.io/apis/growthbook/growthbook-archetypes-api/)
- [GrowthBook Attributes API](https://apis.io/apis/growthbook/growthbook-attributes-api/)
- [GrowthBook Code References API](https://apis.io/apis/growthbook/growthbook-code-references-api/)
- [GrowthBook Dashboards API](https://apis.io/apis/growthbook/growthbook-dashboards-api/)
- [GrowthBook Data Sources API](https://apis.io/apis/growthbook/growthbook-data-sources-api/)
- [GrowthBook Dimensions API](https://apis.io/apis/growthbook/growthbook-dimensions-api/)
- [GrowthBook Environments API](https://apis.io/apis/growthbook/growthbook-environments-api/)
- [GrowthBook Experiments API](https://apis.io/apis/growthbook/growthbook-experiments-api/)
- [GrowthBook Fact Metrics API](https://apis.io/apis/growthbook/growthbook-fact-metrics-api/)
- [GrowthBook Fact Tables API](https://apis.io/apis/growthbook/growthbook-fact-tables-api/)
- [GrowthBook Feature Revisions API](https://apis.io/apis/growthbook/growthbook-feature-revisions-api/)

## Tags

custom-hooks

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/growthbook/growthbook-custom-hooks-api/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/growthbook/.
