Skip to content

API Server

The APIs here are designed for API server configuration.

Upload HTTPS Certificate

This API allows you to update the HTTPS certificate for the Access API, applicable only to port 12445. Please note that restarting the Access application is necessary to apply these changes. If the Private Key and Certificate do not match, it will result in a "parameter error" message.

Request URL/api/v1/developer/api_server/certificates
Permission Keyedit:api_server
MethodPOST
UniFi Access RequirementVersion 2.2.10 or later

Request Header

ParameterRequiredTypeDescription
AuthorizationTStringToken required for authentication and access control.

Request Body

ParameterRequiredTypeDescriptionExample
keyTFilePrivate Keyserver.key
certTFileCertificateserver.crt

Response Sample

json
{
  "code": "SUCCESS",
  "data": "success",
  "msg": "success"
}

Request Sample

bash
curl -XPOST '{{host}}/api/v1/developer/api_server/certificates'
    -H 'Authorization: Bearer wHFmHR******kD6wHg/yg'
    --form 'key=@"/server.key"'
    --form 'cert=@"/server.crt"'

Delete HTTPS Certificate

This API allows you to delete the HTTPS certificate for the Access API, applicable only to port 12445. Please note that restarting the Access application is necessary to apply these changes.

Request URL/api/v1/developer/api_server/certificates
Permission Keyedit:api_server
MethodDELETE
UniFi Access RequirementVersion 2.2.10 or later

Request Header

ParameterRequiredTypeDescription
AuthorizationTStringToken required for authentication and access control.

Response Sample

json
{
  "code": "SUCCESS",
  "data": "success",
  "msg": "success"
}

Request Sample

bash
curl -XDELETE '{{host}}/api/v1/developer/api_server/certificates'
    -H 'Authorization: Bearer wHFmHR******kD6wHg/yg'