---
title: "Enable (CREATE EXTENSION … CASCADE) or disable (DROP EXTENSION, refused while used) an allow-listed extension"
method: POST
path: "/databases/{databaseId}/extensions"
tags: ["Databases"]
---

# Enable (CREATE EXTENSION … CASCADE) or disable (DROP EXTENSION, refused while used) an allow-listed extension

`POST /databases/{databaseId}/extensions`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/databases/{databaseId}/extensions`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `databaseId` string, uuid, required

## Request body

- object
  - `name` string, required: extension to enable or disable (see GET /databases/{id}/extensions)
  - `enabled` boolean, required: true: CREATE EXTENSION IF NOT EXISTS (… CASCADE for dependencies); false: DROP EXTENSION (refused while objects use it)

## Response `200`

Extensions after the change

- object
  - `databaseId` string, uuid, required
  - `supported` boolean, required: extensions exist for PostgreSQL only
  - `image` string, nullable, required: database image, e.g. pgvector/pgvector:pg17
  - `pgvector` boolean, required: the image ships pgvector (the "vector" extension)
  - `items` object[], required
    - `name` string, required
    - `description` string, required
    - `category` 'ai' | 'search' | 'types' | 'functions' | 'indexing', required
    - `available` boolean, required: the database image ships it
    - `installed` boolean, required
    - `installedVersion` string, nullable, required
    - `defaultVersion` string, nullable, required
  - `checkedAt` string, nullable, required: when the list was last read from the database; null = never (the list shows the allow-list only)
  - `note` string, nullable, required: e.g. how to switch an older database to the pgvector image

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict); details.preparing = the database tools are starting, retry after details.retryAfterSeconds
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Not available on this server (code not_configured)
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
