# Create an SMTP credential. The secret is shown once, in this answer only

`POST /mail/smtp/credentials` · Rivier · campaigns

Create an SMTP credential. The secret is shown once, in this answer only.

- Scope: campaigns:admin
- Graphql: Mutation.campaignsMailSmtpCredentialCreate
- Sdk: mail.smtp.createCredential
- Cli: mail smtp-create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "label": {
      "type": "string",
      "maxLength": 80
    }
  },
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/mail/smtp/credentials' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "label": "string"
}'
```
