Getting started
Change external database access
Enable or disable supported external access to the database.
PATCH
/api/customer/v1/projects/{projectId}/databases/{databaseId}/external-accessThis operation can remove, overwrite or interrupt resources, or grant access. Check the project and resource IDs before sending it.
Path parameters
| Name | Value |
|---|---|
projectId | Required resource ID from an earlier API response. |
databaseId | Required resource ID from an earlier API response. |
Request body
Send JSON with Content-Type: application/json. Nested fields and accepted values are listed in the schema.
| Field | Type | Required |
|---|---|---|
enabled | boolean | Yes |
Full request schema
{
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
},
"required": [
"enabled"
],
"additionalProperties": false
}Example request
Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.
curl --request PATCH "$HCODE_BASE_URL/api/customer/v1/projects/${PROJECT_ID}/databases/${DATABASE_ID}/external-access" \
--header "Authorization: Bearer $HCODE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"enabled": true
}' Response
The JSON shape is defined in the response schema.
Response schema
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"externalEnabled": {
"type": "boolean"
},
"externalHost": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"externalPort": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"externalSlug": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"operationId": {
"type": "string"
},
"operations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string"
},
"href": {
"type": "string"
}
},
"required": [
"id",
"status",
"href"
]
}
}
},
"required": [],
"additionalProperties": true
}See errors and retries for failure responses.