# Contact the instance administrators

`POST /api/v1/server/contact`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `fromName` (required)
  Type: string
  
  Display name of the sender

- `fromEmail` (required)
  Type: string, email
  
  Email address of the sender

- `subject` (optional)
  Type: string
  
  Subject of the message

- `body` (required)
  Type: string
  
  Message body

Responses:

- 204: successful operation

- 403: a contact form was already sent recently from this IP address

- 409: contact form or SMTP is not configured on this instance

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/server/contact' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "fromName": "string",
  "fromEmail": "user@example.com",
  "subject": "string",
  "body": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "fromName": "string",
  "fromEmail": "user@example.com",
  "subject": "string",
  "body": "string"
}`;

const response = await fetch('https://peertube2.cpy.re/api/v1/server/contact', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "fromName": "string",
  "fromEmail": "user@example.com",
  "subject": "string",
  "body": "string"
}'''

response = requests.post(
    'https://peertube2.cpy.re/api/v1/server/contact',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
