# mailslurp.api.DomainControllerApi

# Load the API package

import 'package:mailslurp/api.dart';

All URIs are relative to https://api.mailslurp.com

Method HTTP request Description
createDomain POST /domains Create Domain
deleteDomain DELETE /domains/{id} Delete a domain
getDomain GET /domains/{id} Get a domain
getDomains GET /domains Get domains

# createDomain

DomainDto createDomain(domainOptions)

Create Domain

Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.

# Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = DomainControllerApi();
var domainOptions = CreateDomainOptions(); // CreateDomainOptions | domainOptions
try { 
    var result = api_instance.createDomain(domainOptions);
    print(result);
} catch (e) {
    print("Exception when calling DomainControllerApi->createDomain: $e\n");
}

# Parameters

Name Type Description Notes
domainOptions CreateDomainOptions domainOptions

# Return type

DomainDto

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# deleteDomain

deleteDomain(id)

Delete a domain

Delete a domain. This will disable any existing inboxes that use this domain.

# Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = DomainControllerApi();
var id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | id
try { 
    api_instance.deleteDomain(id);
} catch (e) {
    print("Exception when calling DomainControllerApi->deleteDomain: $e\n");
}

# Parameters

Name Type Description Notes
id String id [default to null]

# Return type

void (empty response body)

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# getDomain

DomainDto getDomain(id)

Get a domain

Returns domain verification status and tokens for a given domain

# Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = DomainControllerApi();
var id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | id
try { 
    var result = api_instance.getDomain(id);
    print(result);
} catch (e) {
    print("Exception when calling DomainControllerApi->getDomain: $e\n");
}

# Parameters

Name Type Description Notes
id String id [default to null]

# Return type

DomainDto

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# getDomains

List<DomainPreview> getDomains()

Get domains

List all custom domains you have created

# Example

import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = DomainControllerApi();
try { 
    var result = api_instance.getDomains();
    print(result);
} catch (e) {
    print("Exception when calling DomainControllerApi->getDomains: $e\n");
}

# Parameters

This endpoint does not need any parameter.

# Return type

List<DomainPreview>

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]