Skip to content

Commit 1d902d8

Browse files
committed
Database
1 parent 6f90c22 commit 1d902d8

File tree

4 files changed

+228
-1
lines changed

4 files changed

+228
-1
lines changed

docs/api/databases.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# API Endpoints: Databases
2+
3+
[More info about Databases](/databases.html).
4+
5+
## Run Query
6+
7+
#### Request
8+
9+
**POST** <code>https://webhook.site/database/<span class="url-param">databaseId</span>/query</code>
10+
11+
* `query`: The SQL query to execute.
12+
13+
```json
14+
{
15+
"query": "select * from mytable;"
16+
}
17+
```
18+
19+
#### Response
20+
21+
* `result`: (array) The returned data.
22+
* `error`: (string) If the query results in an error, the error is represented here.
23+
* `time`: (float) Query execution time in milliseconds.
24+
25+
```json
26+
{
27+
"result": [
28+
{
29+
"id": 1,
30+
"value": "hello world"
31+
},
32+
{
33+
"id": 2,
34+
"value": "it's a great day to be a query"
35+
}
36+
],
37+
"error": null,
38+
"time": 0
39+
}
40+
```
41+
42+
Or, for an error:
43+
44+
```json
45+
{
46+
"result": null,
47+
"error": "Undefined table: 7 ERROR: relation \"nonexisting_table\" does not exist",
48+
"time": 0
49+
}
50+
```
51+
52+
## Create database
53+
54+
* Requires [authentication](/api/about.html#api-key)
55+
* Will return `401 Unauthorized` when no databases purchased in subscription
56+
57+
#### Request
58+
59+
**POST** `https://webhook.site/databases`
60+
61+
* `name` (required) The name of the database.
62+
* `group_id` Enter a group ID to attach database to a group.
63+
* `plan` (required) Either `db-s`, `db-m`, `db-l`.
64+
65+
```json
66+
{
67+
"name": "My Database",
68+
"group_id": null,
69+
"plan": "db-s"
70+
}
71+
```
72+
73+
#### Response
74+
75+
```json
76+
{
77+
"id": "23984",
78+
"name": "My Database",
79+
"plan": "db-s",
80+
"group_id": null,
81+
"max_bytes": 104857600,
82+
"max_tables": 1,
83+
"team_id": 181,
84+
"updated_at": "2025-09-24T08:52:50.000000Z",
85+
"created_at": "2025-09-24T08:52:50.000000Z"
86+
}
87+
```
88+
89+
## Get all databases
90+
91+
**GET** `https://webhook.site/database?page=1&per_page=15`
92+
93+
#### Response
94+
95+
```json
96+
{
97+
"current_page": 1,
98+
"data": [
99+
{
100+
"id": "23984",
101+
"name": "My Database",
102+
"plan": "db-s",
103+
"team_id": 345987,
104+
"group_id": null,
105+
"max_bytes": 104857600,
106+
"max_tables": 1,
107+
"bytes_used": 0,
108+
"tables_used": 1,
109+
"created_at": "2025-09-23T10:26:51.000000Z",
110+
"updated_at": "2025-09-23T10:26:55.000000Z",
111+
"group": null
112+
}
113+
],
114+
"first_page_url": "https:\/\/webhook.test\/databases?page=1",
115+
"from": 1,
116+
"last_page": 1,
117+
"last_page_url": "https:\/\/webhook.test\/databases?page=1",
118+
"links": [
119+
{
120+
"url": null,
121+
"label": "&laquo; Previous",
122+
"active": false
123+
},
124+
{
125+
"url": "https:\/\/webhook.test\/databases?page=1",
126+
"label": "1",
127+
"active": true
128+
},
129+
{
130+
"url": null,
131+
"label": "Next &raquo;",
132+
"active": false
133+
}
134+
],
135+
"next_page_url": null,
136+
"path": "https:\/\/webhook.test\/databases",
137+
"per_page": 15,
138+
"prev_page_url": null,
139+
"to": 1,
140+
"total": 1
141+
}
142+
```
143+
144+
## Update database
145+
146+
#### Request
147+
148+
**PUT** `https://webhook.site/databases`
149+
150+
* `name` (required) The name of the database.
151+
* `group_id` Enter a group ID to attach database to a group.
152+
153+
```json
154+
{
155+
"name": "My Updated Database",
156+
"group_id": null
157+
}
158+
```
159+
160+
#### Response
161+
162+
```json
163+
{
164+
"id": "100014",
165+
"name": "My Updated Database",
166+
"plan": "db-s",
167+
"team_id": 181,
168+
"group_id": null,
169+
"max_bytes": 104857600,
170+
"max_tables": 1,
171+
"bytes_used": 0,
172+
"tables_used": 0,
173+
"created_at": "2025-09-24T08:52:50.000000Z",
174+
"updated_at": "2025-09-24T08:56:29.000000Z"
175+
}
176+
```
177+
178+
## Delete database
179+
180+
#### Request
181+
182+
**DELETE** <code>https://webhook.site/database/<span class="url-param">databaseId</span></code>
183+
184+
#### Response
185+
186+
`204 No content`
187+

docs/database.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Databases
3+
nav_order: 390
4+
---
5+
6+
# Webhook.site Databases
7+
8+
Store and process data in the Webhook.site Cloud using Databases. Built right in to Webhook.site, Databases provide a fully-featured PostgreSQL-compatible database. You can create and remove tables, create columns and run queries in the Console.
9+
10+
With Webhook.site Custom Actions, you can interact with your Database to store, update, retrieve and remove data by SQL Query whenever a Webhook.site URL or E-mail Address receives a hit.
11+
12+
Additionally, with Webhook.site's simple API, you can manage your Database, including running SQL queries.
13+
14+
## Under the hood
15+
16+
Webhook.site Databases are powered by CockroachDB, providing a fault-tolerant, secure and highly available PostgreSQL-compatible environment for your data. With Webhook.site Databases, you don't have to worry about maintenance, uptime, backups as Webhook.site Cloud continually manages and scales the database clusters upon demand to ensure performance.
17+
18+
## Pricing and availability
19+
20+
!!! news
21+
As an introductory offer, each Webhook.site Pro & Enterprise subscription automatically comes with a `DB-S` Webhook.site Database instance included. Additional databases can be ordered by contacting Support.
22+
23+
### Pricing Table
24+
25+
| | `DB-S` Small | `DB-M` Medium | `DB-L` Large | `DB-X` Custom |
26+
|---------|--------------|--------------------|--------------------|-----------------|
27+
| Storage | 100 mb | 5 gb | 20 gb | Custom |
28+
| Tables | 1 | 3 | 10 | Custom |
29+
| Pricing | $0/mo | $10/mo ($100/year) | $25/mo ($250/year) | Contact [Support](https://support.webhook.site) |
30+
31+
To purchase or provision a Database, go to [Databases](https://webhook.site/control-panel/databases) in Control Panel.
32+
33+
To upgrade a database instance, Contact [Support](https://support.webhook.site).

docs/news.markdown

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ Subscribe below to receive updates about improvements and new features on Webhoo
2424
</form>
2525
</div>
2626

27-
## 29 September
27+
## 1 October 2025
28+
29+
* **Webhook.site Databases**, our new built-in database service hosted on the Webhook.site Cloud, is released to all users, and as an introductory offer, all Webhook.site Subscribers can create 1 DB-S instance for free. [More info here](/databases.html). <br> Create your Database now in Control Panel &rarr; [Databases](https://webhook.site/control-panel/databases).
30+
31+
32+
## 29 September 2025
2833

2934
* Added [Users API](/api/users.html) for inviting and managing users.
3035

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ nav:
6363
- Open Source: open-source.markdown
6464
- Basic, Pro & Enterprise: pro.markdown
6565
- CLI: cli.md
66+
- Databases: database.md
6667
- Schedules: schedules.md
6768
- DNSHook: dnshook.md
6869
- Form Builder: form-builder.md
@@ -96,5 +97,6 @@ nav:
9697
- Global Variables: api/global-variables.md
9798
- Templates: api/templates.md
9899
- Schedules: api/schedules.md
100+
- Databases: api/databases.md
99101
- Users: api/users.md
100102
- Groups: api/groups.md

0 commit comments

Comments
 (0)