- Create Mailgun API key
Create Mailgun API key
Type of API key ('domain', 'user', or 'web'). Defaults to 'user' if not provided. Note: web keys are not subject to IP allowlisting and have a default/maximum validity period of 1 day.
| Enum Value | Description |
|---|---|
| domain | Create API key of type 'domain' |
| user | Create API key of type 'user' |
| web | Create API key of type 'web' |
Key role ('admin', 'basic' [use in place of analyst], 'sending' [use with keys of domain kind], or 'developer')
| Enum Value | Description |
|---|---|
| admin | Provides admin-level permissions on an API key |
| basic | Provides basic aka analyst-level permissions on an API key |
| sending | Provides domain-scoped permissions on an API key for use only with 'domain' kind key |
| developer | Provides developer-level permissions on an API key |
API Key user's string user ID; should be provided for all keys of 'web' kind. The user must belong to the authenticated account
- US Mailgunhttps://api.mailgun.net/v1/keys
- EU Mailgunhttps://api.eu.mailgun.net/v1/keys
curl -i -X POST \
-u '<username>:<password>' \
https://api.mailgun.net/v1/keys \
-H 'Content-Type: multipart/form-data' \
-F domain_name=string \
-F kind=domain \
-F description=string \
-F expiration=0 \
-F role=admin \
-F user_id=string \
-F user_name=string \
-F email=string{ "message": "great success", "key": { "id": "f2153fd0-f1277777", "description": "api key", "kind": "domain", "role": "sending", "created_at": "2006-01-02T15:04:05", "updated_at": "2006-01-02T15:04:05", "requestor": null, "user_name": null, "domain_name": "example.com", "is_disabled": false, "secret": "api-key-be-careful" } }