Domains Examples | Yext Hitchhikers Platform
API Example Usage
I have a single domain I want to attach to the site I’ve built
- Find the site to which you wish to attach the domain and derive the resource identifier. It will be of the format
accounts/<business-id>/sites/<site-id>
, where both the business ID and the site ID can be found in the URL for the page:https://www.yext.com/s/<business-id>/yextsites/<site-id>/overview
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains
with the domain setup. For reference, see the expected request information in the Domain: Create endpoint. For simplicity, use the HTTP validation type with managed SSL. - Use the GET API calls to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>
to get the status of the domain and the ownership verification steps. You can proceed to the next step when the domain is in an ACTIVE state.
- During the
PENDING_VERIFICATION
state, you will need to verify the ownership of the domain through a CNAME record, TXT record, or HTTP validation. - During the
PENDING_CREATION
state orCREATION
state, you will need to verify the ownership of the domain to the certificate authority. If the CNAME record was used for ownership verification, no additional steps are needed; you’ll just need to wait for verification.
- During the
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>/associations
using the site identifier from step 1. This domain must be set as primary withprimary: true
in the request. For more information on making the request, see the Domain Association: Create endpoint. - Now the domain will be serving the content at the site!
I currently have my domain attached to another vendor, but am building a site on Yext. How do I ensure I have a zero-downtime cutover?
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains
with the domain setup. For reference, see the expected request information in the Domain: Create endpoint. To ensure no downtime, use TXT for the validation method and managed SSL. - Use the GET API calls to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>
to get the status of the domain and the ownership verification steps. You can proceed to the next step when the domain is in an ACTIVE state and ready to cutover.
- During the
PENDING_VERIFICATION
state, you will need to verify the ownership of the domain through a TXT record or HTTP validation. - During the
PENDING_CREATION
state or CREATION state, you will need to verify the ownership of the domain with the certificate authority. This will include adding the TXT records presented in the hostname validation in the response to the GET requests.
- During the
- Find the site to which you wish to attach the domain and derive the resource identifier. It will be of the format
accounts/<business-id>/sites/<site-id>
, where both the business ID and the site ID can be found in the URL for the page:https://www.yext.com/s/<business-id>/yextsites/<site-id>/overview
. - Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>/associations
using the site identifier from step 1. This domain will need to be set as primary withprimary: true
in the request. For more information on making the request, see the Domain Association: Create endpoint. - Add the CNAME record from the GET API calls when ready to cutover. There should be zero downtime.
- Now the domain will be serving the content at the site!
I am a reseller and I want to host the sites I have built on a wildcard domain
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains
with the domain setup. For reference see the expected request information in the Domain: Create endpoint. As part of this request, the wildcard flag must be set to true and TXT validation is required. For serving the content, you will still need to setup the CNAME from the wildcard. For example, if the hostname isexample.com
, the CNAME must be set on the*.example.com
record. - Use the GET API calls to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>
to get the status of the domain and the ownership verification steps. You can proceed to the next step when the domain is in an ACTIVE state and ready to cutover.
- During the
PENDING_VERIFICATION
state, you will need to verify the ownership of the domain through a TXT record or HTTP validation. - During the
PENDING_CREATION
state orCREATION
state, you will need to verify the ownership of the domain to the certificate authority. This will include adding the TXT records presented in the hostname validation in the response to the GET requests.
- During the
- Find your site that you wish to attach the domain to and derive the resource identifier. It will be of the format
accounts/<business-id>/sites/<site-id>
, where both the business ID and the site ID can be found in the URL for the page:https://www.yext.com/s/<business-id>/yextsites/<site-id>/overview
. - Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>/associations
using the site identifier from step 1. The hostname for this request can be anything that is one level above the wildcard hostname. For example, if the wildcard hostname wereexample.com
,help.example.com
would be valid for this request, whereasen.help.example.com
would not. This domain must be set as primary withprimary: true
in the request. For more information on making the request, see the Domain Association: Create endpoint.. - Now the domain will be serving the content at the site! Repeat the preceeding two steps for any sites you wish to use with the wildcard.
My security practices only allow me to use Let’s Encrypt and DigiCert as Certificate Authorities
- Find your site that you wish to attach the domain to and derive the resource identifier. It will be of the format
accounts/<business-id>/sites/<site-id>
, where both the business ID and the site ID can be found in the URL for the page:https://www.yext.com/s/<business-id>/yextsites/<site-id>/overview
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains
with the domain setup. For reference, see the expected request information in the Domain: Create endpoint. For simplicity, use the HTTP validation type with managed SSL. To not use Google Trust and set the certificate authority on the Yext-managed certificate, specifyLETS_ENCRYPT
as the certificate authority. - Use the GET API calls to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>
to get the status of the domain and the ownership verification steps. You can proceed to the next step when the domain is in an ACTIVE state.
- During the
PENDING_VERIFICATION
state, you will need to verify the ownership of the domain through a CNAME record, TXT record, or HTTP validation. - During the
PENDING_CREATION
state orCREATION
state, you will need to verify the ownership of the domain to the certificate authority. If the CNAME record was used for ownership verification, no additional steps are needed, you’ll just need to wait for verification.
- During the
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>/associations
using the site identifier from step 1. This domain will need to be set as primary withprimary: true
in the request. For more information on making the request, see the Domain Association: Create endpoint. - Now the domain will be serving the content at the site!
I have a site, but I want to add other domains that serve the same content, so users have multiple ways to see my content
- Find the site to which you wish to attach the domain and derive the resource identifier. It will be of the format
accounts/<business-id>/sites/<site-id>
, where both the business id and the site id can be found in the URL for the page:https://www.yext.com/s/<business-id>/yextsites/<site-id>/overview
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains
with the domain setup. For reference, see the expected request information in the Domain: Create endpoint. For simplicity, use the HTTP validation type with managed SSL. - Use the GET API calls to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>
to get the status of the domain and the ownership verification steps. You can proceed to the next step when the domain is in an ACTIVE state.
- During the
PENDING_VERIFICATION
state, you will need to verify the ownership of the domain through a CNAME record, TXT record, or HTTP validation. - During the
PENDING_CREATION
state orCREATION
state, you will need to verify the ownership of the domain to the certificate authority. If the CNAME record was used for ownership verification, no additional steps are needed, you’ll just need to wait for verification.
- During the
- Send a POST API call to
https://api.yextapis.com/v2/accounts/<business-id>/domains/<domain-id>/associations
using the site identifier from step 1. This domain must be set as primary withprimary: true
in the request. For more information on making the request, see the Domain Association: Create endpoint. - Now the domain will be serving the content at the site!
- For additional domains, follow steps 1-4 again, except that during step 4, set the primary field to false. Each additional domain added here will be referred to as an alias and will signal to search engines that the canonical domain is the one added in step 4.
I accidentally deleted my domain. Can I get it back?
- Each domain is unique for the hostname while it is active. However, if the domain is deleted, then just recreate it and follow the same steps. Associations will need to be recreated as well. See the first example .
I’ve moved to a new account, but my domain is stuck on my old account. How do I move it?
- Create the same domain in the new account with the desired settings using this endpoint.
- Follow all of the verification steps until you are presented with a
MOVE_REQUIRED
state. - At this point, send a PATCH request to this [endpoint]() with the parameter force set to true.
- Now the domain will be moved to this account. Use the domain association endpoint to associate the domain with a new site in the new account.
- The old domain will be left in the old account, but in a verification failed state. This domain can be deleted now. If the operation needs to be reversed, a patch request can be sent to the domain to repeat this process in reverse.
I have a legacy pages 2.0 domain created prior to this new API. How do I migrate it to use with the new API?
- Use the
Migrate Legacy Pages Domain
endpoint to kick off the migration process. The hostname at the end should match the domain you want to migrate. If the domain has a Pages CDN integration and domain accessible integration, both will be migrated to the new system.
- All of the sites associated with that domain will automatically pick up on the changes to use the new domains API.
I want to create a Certificate Signing Request for a client for Custom SSL
- Send a POST request to the
Managed CSR: Create
endpoint to create a managed CSR with all the relevant information.
- Note the managed CSR ID in the response.
- Copy the CSR from the response and unescape the newline characters to turn them into real newlines.
- Provision a certificate with your desired certificate authority. The newlines must be escaped before adding it to the domain.
- Create a new domain with the
Domain: Create
endpoint. But instead of putting
managed_ssl
in the body, usemanaged_csr
and the fields specified in the Managed CSR section of the Domain SSL Configuration section. The managed CSR ID field should match the managed CSR ID from the response in the first step. - The domain will now be provisioned with the custom SSL.
<% elem.innerText %>