> For the complete documentation index, see [llms.txt](https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/developers/gitbook-api/api-reference/subdomains.md).

# Subdomains

Provide a branded subdomain for each organization to create a consistent user experience. This API supports subdomain creation, DNS checks, and more.

## The Subdomain object

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"components":{"schemas":{"Subdomain":{"type":"object","properties":{"object":{"type":"string","enum":["subdomain"]},"subdomain":{"type":"string","description":"The GitBook subdomain, for example \"my-company\" in \"my-company.gitbook.io\"","pattern":"^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$","minLength":3,"maxLength":32},"target":{"oneOf":[{"$ref":"#/components/schemas/OrganizationPointer"}]},"isActive":{"type":"boolean"}},"required":["object","subdomain","target","isActive"]},"OrganizationPointer":{"type":"object","properties":{"type":{"type":"string","enum":["organization"]},"organization":{"type":"string","description":"Unique identifier for the organization"}},"required":["type","organization"]}}}}
```

## GET /subdomains/{subdomain}

> Get a subdomain

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"subdomains","description":"Provide a branded subdomain for each organization to create a consistent user experience. This API supports subdomain creation, DNS checks, and more.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"Subdomain\" grouped=\"false\" %}\n    The Subdomain object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"subdomain":{"name":"subdomain","in":"path","required":true,"description":"The subdomain, for example \"my-company\" in \"my-company.gitbook.io\"","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$","minLength":3,"maxLength":32}}},"schemas":{"Subdomain":{"type":"object","properties":{"object":{"type":"string","enum":["subdomain"]},"subdomain":{"type":"string","description":"The GitBook subdomain, for example \"my-company\" in \"my-company.gitbook.io\"","pattern":"^[a-z0-9][a-z0-9-]{1,30}[a-z0-9]$","minLength":3,"maxLength":32},"target":{"oneOf":[{"$ref":"#/components/schemas/OrganizationPointer"}]},"isActive":{"type":"boolean"}},"required":["object","subdomain","target","isActive"]},"OrganizationPointer":{"type":"object","properties":{"type":{"type":"string","enum":["organization"]},"organization":{"type":"string","description":"Unique identifier for the organization"}},"required":["type","organization"]}}},"paths":{"/subdomains/{subdomain}":{"get":{"operationId":"getSubdomain","summary":"Get a subdomain","tags":["subdomains"],"parameters":[{"$ref":"#/components/parameters/subdomain"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subdomain"}}}}}}}}}
```


---

# 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:

```
GET https://gitbook-open-v2-preview.gitbook.workers.dev/url/gitbook.com/docs/developers/gitbook-api/api-reference/subdomains.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
