Skip to main content

15 Domains API: How to request or reset an authcode

This is a series of articles dedicated to demonstrating how to get acquainted with Openprovider Domains API methods.

This is a second article in a series in which we are going to cover outgoing domain transfer. To get more information about our API in general, please use our documentation portal as your reference.

Domain transfer is a procedure of changing the current registrar of a domain name. For gTLD domains, a transfer is only possible once the domain has been registered for at least 60 days and has not been transferred between registrars in the last 60 days. ccTLDs follow their own registry rules, which may differ.

To transfer a domain out of Openprovider one should submit a transfer request with a new registrar. You should follow their instructions on the specifics of the process.

The following requirements should be met before initiating the transfer:

  • for gTLD domains, at least 60 days have passed since the domain was registered;
  • for gTLD domains, at least 60 days have passed since the last transfer between registrars;
  • the domain is "Unlocked" for transfer.

You can disable the Transfer Lock by utilizing modifyDomainRequest method. Yet in this article, we are going to focus on how to request or reset an Auth code for a domain.

In order to request an Auth code of a domain one should utilize the requestAuthCodeDomainRequest method. It reads the transfer authorization code (or EPP code) from the registry, or triggers the registry to send the code to the domain owner (for example, for .be and .eu).

Entering Geo Fence iconUse the endpoint path below. Base URL is determined by both the target environment and the API version.
GET {base_url}/domains/{id}/authcode
REQUEST VALUES
Name Type Description
id string Required. Openprovider domain ID.
auth_code_type string Optional. Type of transfer authorization code. Values: external (default) or internal (for internal transfers between reseller accounts in Openprovider only).
REQUEST EXAMPLE
curl -X GET \
 'https://api.openprovider.eu/v1beta/domains/123456/authcode' \
 -H 'Authorization: Bearer <your_token>' 
RESPONSE EXAMPLE
{
  "code": 0,
  "desc": "",
  "data": {
    "auth_code": "12345678",
    "type": "external"
  }
}

Sometimes a domain might not have an Auth code assigned to it. In such a case, you may need to reset it. If so, use resetAuthCodeDomainRequest, which generates a new authorization code where the registry allows it.

Entering Geo Fence iconUse the endpoint path below. Base URL is determined by both the target environment and the API version.
POST {base_url}/domains/{id}/authcode/reset

The method has almost identical input parameters as the previous one:

REQUEST VALUES
Name Type Description
id string Required. Openprovider domain ID.
auth_code_type string Optional.Type of transfer authorization code. Values: "external" (default) or "internal" (for internal transfers between reseller accounts in Openprovider only).
REQUEST EXAMPLE
curl -X POST \
 'https://api.openprovider.eu/v1beta/domains/123456/authcode/reset' \
 -H 'Authorization: Bearer <your_token>' \
 -H 'Content-Type: application/json' \
 -d '{"auth_code_type": "internal"}'
RESPONSE EXAMPLE
{
  "code": 0,
  "desc": "",
  "data": {
    "auth_code": "12345678",
    "domain_roid": "",
    "epp_statuses": [""],
    "type": "internal"
  }
}

Domain transfers can take up to five days to complete, but once the transfer is pending, you can expedite the process by approving it manually.