POST | Create or modify request

Prev Next

POST | Create or modify request

Creates a new certificate request or modifies an existing one.

  • Endpoint: POST /api/v1/certificates/requests
  • Method: POST
  • Request: POST /api/v1/certificates/requests

Request parameters

Parameter Type Required Description
code_request Integer No Code of an existing request. If not included, a new request will be created.
certificate_type Integer Yes Certificate type. Values: • 1 = DV SSL - Domain SSL • 2 = OV SSL - Organization SSL • 3 = EV SSL - Extended SSL
domain_type String Yes Domain type. Values: • SING = Single domain • MULT = Multiple domains • WILD = Wildcard
organization Integer Yes Organization code. It must be a valid organization registered in Segura.
common_name String Yes Common name of the certificate.
san Array No Subject Alternative Names. Will be filled with common_name if not provided.
tags Array No Certificate identification tags. New tags will be created if they don't already exist.
encryption String Yes Encryption algorithm. Values: RSA, DSA
encryption_key_size Integer Yes Encryption key size. Values: 4096, 2048, 1024
certificate_algorithm String Yes Signature algorithm. Values: SHA256, SHA384, SHA512. If the encryption is DSA, only SHA256 is allowed.
validity Integer Yes Certificate validity period in days.
key_password String No Certificate key password.
senha_revogacao String No Certificate revocation password.
environments Array No Certificate environments. New environments will be created if they don't already exist.
systems Array No Certificate systems. New systems will be created if they don't already exist.
project String No Project name.
external_ip String No External IP of the certificate.
hostname_ip String No IP or hostname of the certificate.
justification String No Request justification (max 1024 characters).
responsible Integer No Responsible user code. Must be a user registered in Segura.
description String No Request description (max 512 characters).

Example using cURL

curl -X POST https://[segura_vault_url]/api/v1/certificates/requests \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "certificate_type": 2,
    "domain_type": "SING",
    "organization": 42,
    "common_name": "api.example.com",
    "encryption": "RSA",
    "encryption_key_size": 2048,
    "certificate_algorithm": "SHA256",
    "validity": 365,
    "justification": "Needed for new API service",
    "description": "Certificate for public API endpoints"
  }'

Response

{
  "status": 200,
  "message": "Request created successfully",
  "error": false,
  "code_request": 123,
  "type_certificate": 2,
  "type_domain": "SING",
  "organization": 42,
  "common_name": "api.example.com",
  "encryption": "RSA",
  "encryption_key_size": 2048,
  "certificate_algorithm": "SHA256",
  "validity": 365,
  "justification": "Needed for new API service",
  "description": "Certificate for public API endpoints"
}

Error responses

HTTP Status Error Message
400 Invalid parameters provided
401 Unauthorized access
404 Resource not found
500 Internal server error