API
Network allowlist
Which addresses may connect to a database.
The examples use the two shell variables from Authentication:
export FENVIX_API=https://api.fenvix.dev/v1/public
export FENVIX_KEY="$(read_from_your_secret_store)" # never written in a commandGet a database's IP allowlist#
GET /databases/{id}/ip-allowlist
Works with an admin or a read_only key.
curl -sS "$FENVIX_API/databases/$DATABASE_ID/ip-allowlist" \
-H "Authorization: Bearer $FENVIX_KEY"Parameters#
| Name | In | Required | Type | Notes |
|---|---|---|---|---|
id |
path | yes | string | — |
Answers#
| Status | Body | Meaning |
|---|---|---|
200 |
IpAllowlist |
The allowlist. |
401 |
Error |
No key, or the key is not valid, has expired or has been revoked. |
404 |
Error |
No such database. |
429 |
Error |
Too many requests. Wait for the number of seconds in Retry-After. |
Replace a database's IP allowlist#
PUT /databases/{id}/ip-allowlist
Needs an admin key. Accepts Idempotency-Key.
curl -sS -X PUT "$FENVIX_API/databases/$DATABASE_ID/ip-allowlist" \
-H "Authorization: Bearer $FENVIX_KEY" \
-H "Content-Type: application/json" \
-d '{"entries":["203.0.113.7"]}'Parameters#
| Name | In | Required | Type | Notes |
|---|---|---|---|---|
id |
path | yes | string | — |
Idempotency-Key |
header | no | string | Repeat a request safely for 24 hours. See the Idempotency section. |
Request body#
| Field | Required | Type | Notes |
|---|---|---|---|
entries |
yes | array | At most 100. |
Answers#
| Status | Body | Meaning |
|---|---|---|
200 |
IpAllowlist |
The new allowlist. |
400 |
Error |
The request is not valid; field names the part that is not. |
401 |
Error |
No key, or the key is not valid, has expired or has been revoked. |
403 |
Error |
The key is read only. |
404 |
Error |
No such database. |
409 |
Error |
Conflict: the name is taken, the database is busy, or the Idempotency-Key was used for another request. |
429 |
Error |
Too many requests. Wait for the number of seconds in Retry-After. |
503 |
Error |
The engine did not answer; nothing was changed. |