Custom Domains: Update
This documentation entry provides a clear and detailed guide on how to update an existing custom domain using the API, including the necessary parameters, headers, and expected response.
Endpoint
POST /api/domains/{domain_id}
/api/domains/{domain_id}Update an existing custom domain by specifying its unique identifier.
Request
HTTP Request
POST https://uptimekeep.com/api/domains/{domain_id}Replace {domain_id} with the ID of the custom domain you wish to update.
Headers
Authorization
String
Bearer token for API authentication.
Content-Type
String
Must be set to multipart/form-data for file uploads.
Parameters
host
String
No
The domain name (e.g., "domain.com").
custom_index_url
String
No
Custom URL for the index page (e.g., "https://mywebsite.com/").
custom_not_found_url
String
No
Custom URL for the 404 error page (e.g., "https://mywebsite.com/404-page").
Example of a request:
curl --request POST \
--url 'https://uptimekeep.com/api/domains/{domain_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'host=domain.com'Response
A successful response returns a JSON object containing the unique identifier of the updated custom domain.
Response Example
Fields
Data Object
id
Integer
Unique identifier for the updated custom domain.
Errors
If the request fails, the API will return an error message with an appropriate HTTP status code, such as 400 Bad Request if required parameters are missing or invalid, or 404 Not Found if the custom domain ID does not exist.
Last updated