Certificates

A Certificate is a way to store your custom SSL certificate for your Files.com site. Files.com is also capable of registering SSL certificates itself, so this is only required if you have specific security requirements to use your own certificate.

List Certificates

Endpoint

GET/certificates

Return Object

Certificate[]

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/certificates.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "My Certificate",
    "custom_domain_id": 1,
    "certificate": "[certificate]",
    "created_at": "2000-01-01T01:00:00Z",
    "display_status": "Available",
    "domains": [

    ],
    "expires_at": "2000-01-01T01:00:00Z",
    "brick_managed": true,
    "intermediates": "[certificates]",
    "ip_addresses": [

    ],
    "issuer": "example",
    "key_type": "RSA-4096",
    "request": "[CSR]",
    "status": "Available",
    "subject": "my-custom-domain.com"
  }
]

Show Certificate

Endpoint

GET/certificates/{id}

Return Object

Certificate

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
id
int64
Required
Certificate ID.

Example Request

curl https://app.files.com/api/rest/v1/certificates/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "My Certificate",
  "custom_domain_id": 1,
  "certificate": "[certificate]",
  "created_at": "2000-01-01T01:00:00Z",
  "display_status": "Available",
  "domains": [

  ],
  "expires_at": "2000-01-01T01:00:00Z",
  "brick_managed": true,
  "intermediates": "[certificates]",
  "ip_addresses": [

  ],
  "issuer": "example",
  "key_type": "RSA-4096",
  "request": "[CSR]",
  "status": "Available",
  "subject": "my-custom-domain.com"
}

Create CSR or import existing SSL Certificate

Endpoint

POST/certificates

Return Object

Certificate

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
name
string
Required
Internal name of the SSL certificate.
certificate_domain
string
Domain for certificate.
certificate_extra_domains
array(string)
Additional domains for the certificate CSR.
certificate_country
string
Country.
certificate_state_or_province
string
State or province.
certificate_city_or_locale
string
City or locale.
certificate_company_name
string
Company name.
csr_ou1
string
Department name or organization unit 1
csr_ou2
string
Department name or organization unit 2
csr_ou3
string
Department name or organization unit 3
certificate_email_address
string
Email address for the certificate owner.
key_type
string
Any supported key type. Defaults to RSA-4096.
certificate
string
The certificate. PEM or PKCS7 formats accepted.
private_key
string
Certificate private key.
password
string
Certificate password.
intermediates
string
Intermediate certificates. PEM or PKCS7 formats accepted.

Example Request

curl https://app.files.com/api/rest/v1/certificates.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"Name","certificate_domain":"domain.com","certificate_extra_domains":["www.domain.com"],"key_type":"RSA-4096","certificate":"[certificate]","intermediates":"[certificates]"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "My Certificate",
  "custom_domain_id": 1,
  "certificate": "[certificate]",
  "created_at": "2000-01-01T01:00:00Z",
  "display_status": "Available",
  "domains": [

  ],
  "expires_at": "2000-01-01T01:00:00Z",
  "brick_managed": true,
  "intermediates": "[certificates]",
  "ip_addresses": [

  ],
  "issuer": "example",
  "key_type": "RSA-4096",
  "request": "[CSR]",
  "status": "Available",
  "subject": "my-custom-domain.com"
}

Activate SSL Certificate

Endpoint

POST/certificates/{id}/activate

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
id
int64
Required
Certificate ID.
replace_cert
string
Leave blank or set to any to replace any currently active certificate, if applicable. Set to new_ips to activate this certificate as an additional certificate on your Site by allocating a new set of Dedicated IPs (may require a Plan upgrade). Set to the ID of a currently active certificate to replace that certificate on its set of dedicated IPs. A certificate belonging to a Custom Domain activates only for that domain: leave blank, use any, or specify that domain's current certificate ID.

Example Request

curl https://app.files.com/api/rest/v1/certificates/{id}/activate.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"replace_cert":""}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Deactivate SSL Certificate

Endpoint

POST/certificates/{id}/deactivate

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
id
int64
Required
Certificate ID.

Example Request

curl https://app.files.com/api/rest/v1/certificates/{id}/deactivate.json \
  -X POST \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Replace this active custom SSL Certificate for the Primary Custom Domain with a Files.com SSL Certificate. The Primary Custom Domain's CNAME record must point at the Site's subdomain. The Files.com certificate is issued and activated in the background

Endpoint

POST/certificates/{id}/replace_with_files_certificate

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
id
int64
Required
Certificate ID.

Example Request

curl https://app.files.com/api/rest/v1/certificates/{id}/replace_with_files_certificate.json \
  -X POST \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Update Certificate

Endpoint

PATCH/certificates/{id}

Return Object

Certificate

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
id
int64
Required
Certificate ID.
name
string
Internal certificate name.
intermediates
string
Any intermediate certificates. PEM or PKCS7 formats accepted.
certificate
string
The certificate. PEM or PKCS7 formats accepted.

Example Request

curl https://app.files.com/api/rest/v1/certificates/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"name":"My Certificate","intermediates":"[certificates]","certificate":"[certificate]"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "My Certificate",
  "custom_domain_id": 1,
  "certificate": "[certificate]",
  "created_at": "2000-01-01T01:00:00Z",
  "display_status": "Available",
  "domains": [

  ],
  "expires_at": "2000-01-01T01:00:00Z",
  "brick_managed": true,
  "intermediates": "[certificates]",
  "ip_addresses": [

  ],
  "issuer": "example",
  "key_type": "RSA-4096",
  "request": "[CSR]",
  "status": "Available",
  "subject": "my-custom-domain.com"
}

Delete Certificate

Endpoint

DELETE/certificates/{id}

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Request Parameters

ParameterDescription
id
int64
Required
Certificate ID.

Example Request

curl https://app.files.com/api/rest/v1/certificates/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The Certificate Object

Some of the endpoints above return a Certificate object. The attributes of this object are listed below.

AttributeDescription
id
int64
Certificate ID
name
string
Descriptive name of certificate
custom_domain_id
int64
Custom Domain that owns this certificate, including while the certificate is inactive.
certificate
string
Full text of SSL certificate
created_at
date-time
Certificate created at
display_status
string
Certificate status. (One of Request Generated, New, Active, Active/Expired, Expired, or Available)
domains
array(string)
Domains on this certificate other than files.com domains
expires_at
date-time
Certificate expiration date/time
brick_managed
boolean
Is this certificate automatically managed and renewed by Files.com?
intermediates
string
Intermediate certificates
ip_addresses
array(string)
A list of IP addresses associated with this SSL Certificate
issuer
string
X509 issuer
key_type
string
Type of key
request
string
Certificate signing request text
status
string
Certificate status (Request Generated, New, Active, Active/Expired, Expired, or Available)
subject
string
X509 Subject name

Example Certificate Object

{
  "id": 1,
  "name": "My Certificate",
  "custom_domain_id": 1,
  "certificate": "[certificate]",
  "created_at": "2000-01-01T01:00:00Z",
  "display_status": "Available",
  "domains": [

  ],
  "expires_at": "2000-01-01T01:00:00Z",
  "brick_managed": true,
  "intermediates": "[certificates]",
  "ip_addresses": [

  ],
  "issuer": "example",
  "key_type": "RSA-4096",
  "request": "[CSR]",
  "status": "Available",
  "subject": "my-custom-domain.com"
}