Creates or edits a publication profile for an Apache plugin.
- Endpoint:
/api/certificate/profile/apache
- Method:
POST
- Request:
POST /api/certificate/profile/apache
Request parameters
| Parameter |
Type |
Required |
Description |
code_profile |
int |
No |
Existing profile code. We will create a new profile if you don't provide the existing one. |
name_profile |
string |
Yes |
Profile name. |
site |
string |
No |
Site where the certificate should be installed. If not provided, the certificate will be installed on the default Apache site. |
config_path |
string |
No |
Configuration path. Default: /etc/apache2/sites-available/default.com.conf. |
port |
int |
No |
Port. Default: 443. |
code_credential |
int |
Conditional |
A credential code is to be used in the publication. Required if a username is not provided. |
username |
string |
Conditional |
The username is used to locate credentials for publication. Required if code_credential is not provided. |
devices |
array |
Yes |
Array with device codes where the certificate should be published. |
Example using cURL
curl -X POST https://[segura_vault_url]/api/certificate/profile/apache \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name_profile": "Web Servers - Production",
"site": "api.example.com",
"config_path": "/etc/apache2/sites-available/api.example.com.conf",
"port": 443,
"username": "admin",
"devices": [101, 102, 103]
}'
Response
{
"status": 200,
"message": "Profile created successfully",
"error": false,
"code_profile": 22,
"name_profile": "Web Servers - Production",
"site": "api.example.com",
"config_path": "/etc/apache2/sites-available/api.example.com.conf",
"port": 443,
"username": "admin",
"devices": [101, 102, 103]
}
Error responses
| HTTP Status Code |
Description |
| 400 Bad Request |
Invalid parameters provided. |
| 401 Unauthorized |
Unauthorized access. |
| 403 Forbidden |
Forbidden access. |
| 404 Not Found |
Resource not found. |
| 500 Internal Server Error |
Internal server error. |