# DomainControllerAPI

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

    open class func createDomain(domainOptions: CreateDomainOptions, completion: @escaping (_ data: DomainDto?, _ error: Error?) -> Void)

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

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let domainOptions = CreateDomainOptions(domain: "domain_example") // CreateDomainOptions | domainOptions
// Create Domain
DomainControllerAPI.createDomain(domainOptions: domainOptions) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# 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

    open class func deleteDomain(_id: UUID, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Delete a domain

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

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let _id = 987 // UUID | id
// Delete a domain
DomainControllerAPI.deleteDomain(_id: _id) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
_id UUID id

# 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

    open class func getDomain(_id: UUID, completion: @escaping (_ data: DomainDto?, _ error: Error?) -> Void)

Get a domain

Returns domain verification status and tokens for a given domain

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let _id = 987 // UUID | id
// Get a domain
DomainControllerAPI.getDomain(_id: _id) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

Name Type Description Notes
_id UUID id

# 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

    open class func getDomains(completion: @escaping (_ data: [DomainPreview]?, _ error: Error?) -> Void)

Get domains

List all custom domains you have created

# Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
// Get domains
DomainControllerAPI.getDomains() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }
    if (response) {
        dump(response)
    }
}

# Parameters

This endpoint does not need any parameter.

# Return type

[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]