Site.eu
Back to Helpdesk
HELP CENTER ARTICLE
#Account

How to create a contact and make it ready with the API

How to create a contact and make it ready with the API

Every domain name has a holder: the person or company it belongs to. In your account, the holder is one of your contacts. With the Site.eu API, you can create that contact from your own script.

Some extensions also need extra details about the holder. For .es, for example, that's an ID number. Once the contact has those details, it's ready for that extension. Then you can register domain names with it right away.

Rather do it in your dashboard? Read how to make a contact ready for a domain extension. New to our API? Then first read how to get started with the API.

What you need

An API key. Make one in your dashboard under Settings, on the API keys tab. Under API Endpoints, tick:

  • contacts.create: create contacts.
  • contacts.required_info: check and add the extra details for an extension.
  • contacts.view: see your contacts and the extensions they're ready for.

Put your API key in the X-API-Key header of every request. Send the fields as JSON in the body.

Step 1: create the contact

POST https://backend.site.eu/v2/contacts

Send these fields:

  • first_name and last_name (required).
  • email (required).
  • phone_number (required): digits only, without + or 00. Send the national number, or the country code followed by it, like 31201234567 for a Dutch number.
  • address (required): with address_line_first, city, postal_code and country_id. Leave out postal_code only when the country has no postal codes.
  • company_name: only when a company holds the domain names.
  • vat_number: optional. For EU countries, we check it in the EU's VIES database.

You find the country_id with GET /v2/countries. That one needs no API key.

The answer is the new contact, with its id. You need that ID in the next steps. Is something wrong? Then you get INPUT_001, with the field and the problem under fields. For example, a phone number that doesn't fit the country.

Step 2: check what the extension needs

GET https://backend.site.eu/v2/tlds/required_info?contact_id=3101&tld=.es

Here, 3101 is the ID of your contact and .es is the extension. We check the contact with the registry. Then you get one of two answers:

  • An empty list: the contact is ready for this extension. Nothing else to do.
  • A list with required_info: the details the registry still needs. Each field has its name, and mandatory says if you must fill it in. Some fields also show the values you can choose from (values) or the format (regex). A message from the registry can be there too.

The field names start with the name of the registry, like Esnic.identificationNumber for .es. You need that registry name in the next step: it's the part before the dot.

Step 3: add the details

PATCH https://backend.site.eu/v2/contacts/3101/required_info

Send these fields:

  • registry: the name of the registry, like Esnic.
  • tld: the extension, like .es.
  • properties: each field from step 2 with its value. Use the full field names, like Esnic.identificationNumber.

We check the details with the registry. Does it accept them? Then we save them, and the contact is ready. Does it refuse them? Then nothing is saved, and you get INPUT_002 with the fields that need a fix.

Some extensions need a private person as the contact for a few roles, even when a company holds the domain name. Then the answer of step 2 has contact_roles with person. Send person along with the details: "contact_person" uses the contact person of the company, or send the ID of one of your contacts who is a private person.

Step 4: check that the contact is ready

Do step 2 again. Is the list empty? Then the contact is ready. You can also see it with GET /v2/contacts: ready_tlds lists every extension the contact is ready for.

Now you can register a domain name with this contact as the holder. Send its ID as contact_id. Read how to order domain names with the API.

Good to know

  • You can also send the details with an order. Register or transfer a domain name, and add the details as required_info. We check them and save them on the contact.
  • Is the contact not right for the extension? Some extensions only accept a company, or only a private person. Then you get REG_006. Use another contact.
  • Got REG_005? Then the contact already has all the details for this extension.
  • Not every extension needs extra details. For .com, for example, the check in step 2 usually gives an empty list right away.

Need help? Contact us by WhatsApp, Telegram or email.

Couldn’t find what you were looking for?

You can always chat with one of our experts for any questions you might have!

New articles added