Child pages
  • WHM API 1 Functions - set_autossl_metadata
Skip to end of metadata
Go to start of metadata

Description

This function sets values for AutoSSL's metadata keys. This allows you to replace certificates that AutoSSL did not issue and toggle other AutoSSL notifications.

Note:

We recommend that you use the WHM API 1 set_autossl_metadata_key function instead.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/set_autossl_metadata?api.version=1&metadata_json=%7B%22clobber_externally_signed%22%3A1%2C%20%22notify_autossl_expiry%22%3A1%2C%20%22notify_autossl_expiry_user%22%3A1%2C%20%22notify_autossl_expiry_coverage%22%3A1%2C%20%22notify_autossl_expiry_coverage_user%22%3A1%2C%20%22notify_autossl_renewal%22%3A1%2C%20%notify_autossl_renewal_user%22%3A1%2C%20%22notify_autossl_renewal_coverage%22%3A1%2C%20%22notify_autossl_renewal_coverage_user%22%3A1%2C%20%22notify_autossl_renewal_coverage_reduced%22%3A1%2C%20%22notify_autossl_renewal_coverage_reduced_user%22%3A1%2C%20%22notify_autossl_renewal_uncovered_domains%22%3A1%2C%20%22notify_autossl_renewal_uncovered_domains_user%22%3A1%7D
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/set_autossl_metadata?api.version=1&metadata_json=%7B%22clobber_externally_signed%22%3A1%2C%20%22notify_autossl_expiry%22%3A1%2C%20%22notify_autossl_expiry_user%22%3A1%2C%20%22notify_autossl_expiry_coverage%22%3A1%2C%20%22notify_autossl_expiry_coverage_user%22%3A1%2C%20%22notify_autossl_renewal%22%3A1%2C%20%notify_autossl_renewal_user%22%3A1%2C%20%22notify_autossl_renewal_coverage%22%3A1%2C%20%22notify_autossl_renewal_coverage_user%22%3A1%2C%20%22notify_autossl_renewal_coverage_reduced%22%3A1%2C%20%22notify_autossl_renewal_coverage_reduced_user%22%3A1%2C%20%22notify_autossl_renewal_uncovered_domains%22%3A1%2C%20%22notify_autossl_renewal_uncovered_domains_user%22%3A1%7D
 Command Line
whmapi1 set_autossl_metadata metadata_json=%7B%22clobber_externally_signed%22%3A1%2C%20%22notify_autossl_expiry%22%3A1%2C%20%22notify_autossl_expiry_user%22%3A1%2C%20%22notify_autossl_expiry_coverage%22%3A1%2C%20%22notify_autossl_expiry_coverage_user%22%3A1%2C%20%22notify_autossl_renewal%22%3A1%2C%20%notify_autossl_renewal_user%22%3A1%2C%20%22notify_autossl_renewal_coverage%22%3A1%2C%20%22notify_autossl_renewal_coverage_user%22%3A1%2C%20%22notify_autossl_renewal_coverage_reduced%22%3A1%2C%20%22notify_autossl_renewal_coverage_reduced_user%22%3A1%2C%20%22notify_autossl_renewal_uncovered_domains%22%3A1%2C%20%22notify_autossl_renewal_uncovered_domains_user%22%3A1%7D


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": "1",
        "command": "set_autossl_metadata"
    }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>set_autossl_metadata</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

Important:

  • You can enter more than one key and value pair in the metadata_json JSON hash.
  • Any keys that you do not explicitly define will adopt the system's default value.


ParameterTypeDescriptionPossible valuesExample
metadata_jsonJSON

Required

A JSON-encoded hash of metadata keys and values that control AutoSSL's behavior.

This hash contains the clobber_externally_signed, notify_autossl_expiry , notify_autossl_expiry_coverage , notify_autossl_expiry_coverage_user, notify_autossl_renewal , notify_autossl_renewal_user, notify_autossl_renewal_coverage, notify_autossl_renewal_coverage_user, notify_autossl_renewal_coverage_reduced, notify_autossl_renewal_coverage_reduced_user, notify_autossl_uncovered_domains and notify_autossl_renewal_uncovered_domains_user parameters.
{\"clobber_externally_signed\":1}

clobber_externally_signed

Boolean

Whether to allow AutoSSL to replace certificates that none of this system’s AutoSSL modules issued. When you enable this option, AutoSSL will install certificates that replace users’ Certificate Authority (CA) issued certificates if they are invalid or expire within three days.

This parameter defaults to 0.

The function accepts this parameter in the metadata_json hash.

  • 1 — Replace the certificate.
  • 0 — Do not replace the certificate.
1

notify_autossl_expiry

Boolean

Whether to send a notification when an AutoSSL certificate expires. This occurs when AutoSSL cannot request a new certificate.

This parameter defaults to 1.

Notes:

  • This can happen if all of a website’s domains fail Domain Control Validation (DCV), or if the AutoSSL provider has not issued a certificate in response to a request.
  • We added this parameter in cPanel & WHM version 70.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_expiry_coverage

Boolean

Whether to send a notification if at least one currently-secured domain will lose coverage when the certificate renews.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 68.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_expiry_coverage_user

Boolean

Whether to send a notification if at least one of a user's currently-secured domains will lose coverage when the certificate renews.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 74.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_expiry_user

Boolean

Whether to send a notification when a user's AutoSSL certificate expires. This occurs when AutoSSL cannot request a new certificate for a user.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 74.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal

Boolean

Whether to send a notification when AutoSSL successfully renews a certificate.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 68.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_user

Boolean

Whether to send a notification when AutoSSL successfully renews a certificate for a user.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 74.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_coverage

Boolean

Whether to send a notification if a currently-secured domain fails DCV and the certificate has not reached its renewal period.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 68.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_coverage_user

Boolean

Whether to send a notification if a currently-secured domain fails DCV and the certificate has not reached its renewal period.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 74.

The function accepts this parameter in the metadata_json hash.

  • 1 — Notify.
  • 0 — Do not notify.

notify_autossl_renewal_coverage_reduced

Boolean

Whether to send a notification when AutoSSL has renewed a certificate and the new certificate lacks at least one domain that the previous certificate secured.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 70.

The function accepts this parameter in the  metadata_json  hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_coverage_reduced_user

Boolean

Whether to send a notification when AutoSSL has renewed a certificate for a user and the new certificate lacks at least one domain that the previous certificate secured.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 74.

The function accepts this parameter in the  metadata_json  hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_uncovered_domains

Boolean

Whether to send a notification when AutoSSL has renewed a certificate and the new certificate lacks one or more of the website’s domains.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 70.

The function accepts this parameter in the  metadata_json  hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

notify_autossl_renewal_uncovered_domains_user

Boolean

Whether to send a notification when AutoSSL has renewed a certificate for a user and the new certificate lacks one or more of the website’s domains.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 74.

The function accepts this parameter in the  metadata_json  hash.

  • 1 — Notify.
  • 0 — Do not notify.
1

Returns

This function only returns metadata.