Credentials

The Credentials API lets you view and manage SMTP credentials.

List Mailgun SMTP credential metadata for a given domain

get/v3/domains/{domain_name}/credentials

List Mailgun SMTP credential metadata for a given domain

SecuritybasicAuth
Request
path Parameters
domain_name
required
string

Hostname filter for credential results

query Parameters
skip
integer
Default: 0

Number of results to skip, to help with pagination

limit
integer
Default: 100

Limit results to this many

Responses
200

A 200 response

Response Schema: application/json
required
Array of objects
total_count
required
integer <int32>
400

A 400 response

Request samples
Response samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "total_count": 1
}

Create Mailgun SMTP credentials for a given domain

post/v3/domains/{domain_name}/credentials

Create Mailgun SMTP credentials for a given domain

SecuritybasicAuth
Request
path Parameters
domain_name
required
string

Hostname for new credentials

Request Body schema: multipart/form-data
required
login
required
string

Email address of SMTP credential user; accepts multiple values

mailbox
string

Email address of SMTP credential user, may be used in place of 'login'; accepts multiple values

system
boolean

Identify if these are system account credentials, defaults to false

password
string

Supply desired password(s) for the new credentials if preferred over generated ones; accepts multiple values

Responses
200

A 200 response

Response Schema: application/json
message
required
string
object
note
string
400

A 400 response

Request samples
Response samples
application/json
{
  • "message": "Created 1 credentials pair(s)"
}

Delete all Mailgun SMTP credentials for a domain

delete/v3/domains/{domain_name}/credentials

Delete Mailgun SMTP credentials for a given domain

SecuritybasicAuth
Request
path Parameters
domain_name
required
string

Hostname of credentials to be deleted

Responses
200

A 200 response

Response Schema: application/json
message
required
string
count
required
integer <int32>
400

A 400 response

Request samples
Response samples
application/json
{
  • "message": "All domain credentials have been deleted",
  • "count": 2
}

Update Mailgun SMTP credentials

put/v3/domains/{domain_name}/credentials/{spec}

Update Mailgun SMTP credentials for a given domain and SMTP user

SecuritybasicAuth
Request
path Parameters
domain_name
required
string

Hostname of credentials to be updated

spec
required
string

Login specification of credentials to be updated (email address)

Request Body schema: multipart/form-data
required
password
string

Supply desired password for the credentials to update if preferred over a generated one

Responses
200

A 200 response

Response Schema: application/json
message
required
string
object
note
string
404

A 404 response

Request samples
Response samples
application/json
{
  • "message": "Created 1 credentials pair(s)"
}

Delete Mailgun SMTP credentials

delete/v3/domains/{domain_name}/credentials/{spec}

Delete Mailgun SMTP credentials for a given domain and SMTP user

SecuritybasicAuth
Request
path Parameters
domain_name
required
string

Hostname of credentials to be deleted

spec
required
string

Login specification of credentials to be deleted (email address)

Responses
200

A 200 response

Response Schema: application/json
message
required
string
spec
required
string
400

A 400 response

Request samples
Response samples
application/json
{
  • "message": "Credentials have been deleted",
  • "spec": "someone@example.com"
}

Update Mailgun SMTP credentials

put/v3/{domain_name}/mailboxes/{spec}

Update Mailgun SMTP credentials for a given domain and SMTP user

SecuritybasicAuth
Request
path Parameters
domain_name
required
string

Hostname of credentials to be updated

spec
required
string

Login specification of credentials to be updated (email address)

Request Body schema: multipart/form-data
required
password
string

Supply desired password for the credentials to update if preferred over a generated one

Responses
200

A 200 response

Response Schema: application/json
message
required
string
object
note
string
404

A 404 response

Request samples
Response samples
application/json
{
  • "message": "Created 1 credentials pair(s)"
}