> For the complete documentation index, see [llms.txt](https://docs.discloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discloud.com/en/api-and-integrations/api-overview/subdomain.md).

# Subdomain

## List subdomains

> Returns all subdomains of the authenticated user. Requires Platinum plan or higher.

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Subdomains","description":"Operations about subdomains"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/subdomain/all":{"get":{"tags":["Subdomains"],"summary":"List subdomains","description":"Returns all subdomains of the authenticated user. Requires Platinum plan or higher.","operationId":"listSubdomains","responses":{"200":{"description":"List of subdomains returned successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubdomainListResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get subdomain

> Returns information about a specific subdomain of the user. Requires Platinum plan or higher.

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Subdomains","description":"Operations about subdomains"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/subdomain/{subdomainName}":{"get":{"tags":["Subdomains"],"summary":"Get subdomain","description":"Returns information about a specific subdomain of the user. Requires Platinum plan or higher.","operationId":"getSubdomain","parameters":[{"name":"subdomainName","in":"path","required":true,"description":"Subdomain name (without the .discloud.app suffix)","schema":{"type":"string"}}],"responses":{"200":{"description":"Subdomain returned successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubdomainResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient plan or no permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Subdomain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Subdomain already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create subdomain

> Creates a new subdomain. Requires Platinum plan or higher. Maximum of 100 subdomains per user.

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Subdomains","description":"Operations about subdomains"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/subdomain/{subdomainName}":{"post":{"tags":["Subdomains"],"summary":"Create subdomain","description":"Creates a new subdomain. Requires Platinum plan or higher. Maximum of 100 subdomains per user.","operationId":"createSubdomain","parameters":[{"name":"subdomainName","in":"path","required":true,"description":"Desired subdomain name (without the .discloud.app suffix)","schema":{"type":"string","pattern":"^[a-z0-9-]{2,20}$"}}],"responses":{"201":{"description":"Subdomain created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubdomainResponse"}}}},"400":{"description":"Invalid subdomain name or inappropriate word","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient plan or limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Subdomain already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete subdomain

> Deletes a user's subdomain. Cannot delete subdomains that are in use (status 2). Requires Platinum plan or higher.

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Subdomains","description":"Operations about subdomains"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/subdomain/{subdomainName}":{"delete":{"tags":["Subdomains"],"summary":"Delete subdomain","description":"Deletes a user's subdomain. Cannot delete subdomains that are in use (status 2). Requires Platinum plan or higher.","operationId":"deleteSubdomain","parameters":[{"name":"subdomainName","in":"path","required":true,"description":"Subdomain name to be deleted","schema":{"type":"string"}}],"responses":{"200":{"description":"Subdomain deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient plan or no permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Subdomain not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Subdomain in use","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.discloud.com/en/api-and-integrations/api-overview/subdomain.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
