Domains

Notes
Expert level
The API key should be sent as a Bearer token in the Authorization header of the request. Get your API key.
List

API endpoint:

GET
https://trgt.ai/api/v1/domains

Request example:

curl --location --request GET 'https://trgt.ai/api/v1/domains' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Parameter
Type
Description
search
optional string
The search query.
sort
optional string
Sort by. Possible values are: desc for Descending, asc for Ascending.
Show

API endpoint:

GET
https://trgt.ai/api/v1/domains/{id}

Request example:

curl --location --request GET 'https://trgt.ai/api/v1/domains/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Store

API endpoint:

POST
https://trgt.ai/api/v1/domains

Request example:

curl --location --request POST 'https://trgt.ai/api/v1/domains' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
Type
Description
name
required string
The space name.
index_page
optional string
The index page to redirect to.
not_found_page
optional string
The 404 page to redirect to.
Update

API endpoint:

PUT PATCH
https://trgt.ai/api/v1/domains/{id}

Request example:

curl --location --request PUT 'https://trgt.ai/api/v1/domains/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'url={url}'
Parameter
Type
Description
index_page
optional string
The index page to redirect to.
not_found_page
optional string
The 404 page to redirect to.
Delete

API endpoint:

DELETE
https://trgt.ai/api/v1/domains/{id}

Request example:

curl --location --request DELETE 'https://trgt.ai/api/v1/domains/{id}' \
--header 'Authorization: Bearer {api_key}'