# Create Mailgun API key Create Mailgun API key Endpoint: POST /v1/keys Version: 3.0.0 Security: basicAuth ## Request fields (multipart/form-data): - `email` (string) API Key user's email address; should be provided for all keys of 'web' kind - `domain_name` (string) Web domain to associate with the key, for keys of 'domain' kind - `kind` (string) Type of api key ('domain', 'user', or 'web'). Defaults to 'user' if not provided. Note: web keys are not subject to IP whitelisting and have a default/maximum validity period of 1 day. Enum: "domain", "user", "web" - `expiration` (integer) Key lifetime in seconds, must be greater than 0 if set - `role` (string, required) Key role ('admin', 'basic' [use in place of analyst], 'sending' [use with keys of domain kind], 'support', or 'developer') - `user_id` (string) API Key user's string user ID; should be provided for all keys of 'web' kind - `user_name` (string) API Key user's name - `description` (string) Key description ## Response 200 fields (application/json): - `message` (string, required) Response message - `key` (object, required) - `key.id` (string, required) The ID for the key - `key.description` (string, required) The description provided for the key upon its creation - `key.kind` (string, required) The type of the key which determines how it can be used - `key.role` (string, required) The role of the key which determines its scope in CRUD operations that have role-based access control - `key.created_at` (string, required) When the key was created - `key.updated_at` (string, required) When the key was last updated - `key.expires_at` (string) When the key will expire - `key.secret` (string) The full api key secret in plain text - `key.disabled_reason` (string) The reason for the key's disablement - `key.is_disabled` (boolean, required) Whether or not the key is disabled from use - `key.domain_name` (string,null, required) The sending domain associated with the key - `key.requestor` (string,null, required) An email address associated with the key - `key.user_name` (string,null, required) The api key user's name ## Response 403 fields (application/json): - `message` (string, required) Response message