# Domain

## Performs the Get operation.

> Use this endpoint to execute the get workflow in DomainController.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Domain"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Domain/Get":{"get":{"tags":["Domain"],"summary":"Performs the Get operation.","description":"Use this endpoint to execute the get workflow in DomainController.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"companyId","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Performs the Get operation.

> Use this endpoint to execute the get workflow in DomainController.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Domain"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Domain/Get/{domainId}":{"get":{"tags":["Domain"],"summary":"Performs the Get operation.","description":"Use this endpoint to execute the get workflow in DomainController.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"domainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Create domain.

> Use this endpoint to create domain.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Domain"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CreateDomainViewModel":{"required":["domainName"],"type":"object","properties":{"domainName":{"type":"string","description":"Gets or sets the fully qualified domain name to register."}},"description":"Represents the payload for adding a new company domain for verification."}}},"paths":{"/v1/Domain/Create/{companyId}":{"post":{"tags":["Domain"],"summary":"Create domain.","description":"Use this endpoint to create domain.\n\nRequired roles: Admin.","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateDomainViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateDomainViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Update domain.

> Use this endpoint to update domain.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Domain"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateDomainViewModel":{"required":["domainName"],"type":"object","properties":{"domainName":{"type":"string","description":"Gets or sets the updated fully qualified domain name."}},"description":"Represents the payload for updating an existing company domain name."}}},"paths":{"/v1/Domain/Update/{domainId}":{"patch":{"tags":["Domain"],"summary":"Update domain.","description":"Use this endpoint to update domain.\n\nRequired roles: Admin.","parameters":[{"name":"domainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateDomainViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Delete domain.

> Use this endpoint to delete domain.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Domain"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Domain/Delete/{domainId}":{"delete":{"tags":["Domain"],"summary":"Delete domain.","description":"Use this endpoint to delete domain.\n\nRequired roles: Admin.","parameters":[{"name":"domainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Verifies domain ownership by checking the configured TXT record.

> Validates the domain's DNS TXT record against the expected token and updates the domain status to Verified or Pending accordingly.\
> \
> Required roles: Admin.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Domain"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Domain/Execute/{domainId}":{"get":{"tags":["Domain"],"summary":"Verifies domain ownership by checking the configured TXT record.","description":"Validates the domain's DNS TXT record against the expected token and updates the domain status to Verified or Pending accordingly.\n\nRequired roles: Admin.","parameters":[{"name":"domainId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```


---

# Agent Instructions: 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://docs.safegpt.nl/api-nl/endpoints/domain.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.
