Add a domain.
interface Request {
domain: string
}
interface Response {
domainId: string
token: string
}
# Example
curl -X POST \
-H 'Authorization: <api_key>' \
-H 'Content-Type: application/javascript' \
'https://api.stormkit.io/v1/domains' \
-d '{ "domain": "example.org" }'
{
"domainId": "18914",
"token": "AiX8xKhrGvsnwTTvT7yoxUFlTYzjn3bm"
}
Successful responses return the newly created domain id and a token to start the verification process.
Return domains attached to an environment.
interface QueryString {
afterId?: string
verified?: "true"
}
interface Response {
domains: []Domain
pagination: Pagination
}
# Example
curl -X GET \
-H 'Authorization: <api_key>' \
-H 'Content-Type: application/javascript' \
'https://api.stormkit.io/v1/domains'
{
"domains": [
{
"id": "18914",
"domainName": "exmaple.org",
"verified": false,
"token": "AiX8xKhrGvsnwTTvT7yoxUFlTYzjn3bm"
}
],
"pagination": {
"hasNextPage": false
}
}
To filter domains by verification status, you can use the verified
querystring parameter.
To paginate results, you can specify the afterId
querystring parameter. This value is returned in the first GET
request.
Delete a Domain by it's id.
interface QueryString {
id: string
}
interface Response {
ok: boolean
}
# Example
curl -X PUT \
-H 'Authorization: <api_key>' \
-H 'Content-Type: application/javascript' \
'https://api.stormkit.io/v1/domains?id=1501'
Update the custom certificate of a domain.
certKey
is the private key in PEM format.certValue
is the certificate value in PEM format.You can use openssl
to generate PEM files from crt
:
openssl x509 -in example_org.crt -out example_org.pem -outform PEM
interface Request {
domainId: string
certKey: string
certValue: string
}
interface Response {
ok: boolean
}
# Example
curl -X PUT \
-H 'Authorization: <api_key>' \
-H 'Content-Type: application/javascript' \
'https://api.stormkit.io/v1/domains/cert' \
-d '{ "domainId": "2500", "certValue": "-----BEGIN CERTIFICATE-----", "certKey": "-----BEGIN PRIVATE KEY-----" }'
{
"ok": true
}
Deletes the custom certificate associated with the domain.
interface Request {
domainId: string
}
interface Response {
ok: boolean
}
# Example
curl -X DELETE \
-H 'Authorization: <api_key>' \
-H 'Content-Type: application/javascript' \
'https://api.stormkit.io/v1/domains/cert?id=2500'
{
"ok": true
}
interface Domain {
id: string
domainName: string
verified: boolean
token: string
customCert?: {
value: string
key: string
}
}
interface Pagination {
hasNextPage: boolean
afterId?: string
}
Property | Definition |
---|---|
id | The unique id of the domain. |
domainName | The domain name. |
verified | Whether the domain is verified or not. For self-hosted users, this is always true . |
token | A token used to create TXT record to verify a domain. |
customCert?.value | If present, the value of the custom certificate. |
customCert?.key | If present, the private key of the custom certificate. |