MongoHQ Documentation

Documentation for using and extending the MongoHQ Platform.

MongoHQ API: Databases

Interact with your MongoHQ databases.

The database API allows you to interact with your MongoHQ databases. You can create databases, retrieve information about them and remove databases.

GET /databases

Retrieves a list of all databases in your account.

Required Parameters:

_apikey Your MongoHQ account’s secret key.

Example Request:

curl -X GET https://api.mongohq.com/databases?_apikey=12345

POST /databases

Create a new (paid) database under this account.

You can create new databases. You’re limited to only 5 free databases per account. You must have financial information in your MongoHQ account (credit card, etc.) to create any paid databases.

Required Parameters:

_apikey Your MongoHQ account’s secret key.

name The database name.

slug The type of database to create. Valid types can be found under the /plans API.

Example Request:

curl -X POST https://api.mongohq.com/databases?_apikey=12345 \
-H "Content-Type: application/json" \
-d '{"name":"my_new_db", "slug":"sandbox"}'

GET /databases/:db

Retrieve information about a particular database.

Required Parameters:

_apikey Your MongoHQ account’s secret key.

db The database name.

Example Request:

curl -X GET https://api.mongohq.com/databases/vehicles?_apikey=12345

DELETE /databases/:db

This will delete a database. Please be careful as this cannot be undone.

Required Parameters:

_apikey Your MongoHQ account’s secret key.

db The database name.

Example Request:

curl -X DELETE https://api.mongohq.com/databases/vehicles?_apikey=12345