# General

General operations related to PromptEasy.eu API health and operating.

## Basic heartbeat endpoint

`GET /`

Authentication: no security requirement declared for this operation.

Responses:

- 200: The current time

Content type: application/json

Type: object

Schema: [Heartbeat](https://api.prompteasy.eu/docs/api/models/heartbeat/index.md)

- `time` (optional)
  Type: string
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- 500: API down

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://api.prompteasy.eu/')
print(response.text)
```


## Get CSRF cookie

`GET /sanctum/csrf-cookie`

Authentication: no security requirement declared for this operation.

Responses:

- 204: No Content

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/sanctum/csrf-cookie'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/sanctum/csrf-cookie', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://api.prompteasy.eu/sanctum/csrf-cookie')
print(response.text)
```


## Get system status

`GET /v1/status`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key

Responses:

- 200: System status response detailing health of various services

Content type: application/json

Type: object

Schema: [SystemStatus](https://api.prompteasy.eu/docs/api/models/systemstatus/index.md)

- `database` (optional)
  Type: boolean
  
  Health of the EU-West project database
  
  Example:
  
  ```json
  true
  ```

- `workers` (optional)
  Type: boolean
  
  Health of the background queue workers
  
  Example:
  
  ```json
  true
  ```

- `payment_gateway` (optional)
  Type: boolean
  
  Health of the external payment gateway (Stripe)
  
  Example:
  
  ```json
  true
  ```

- `optional_ai` (optional)
  Type: boolean
  
  Health of the optional AI interface (Gemini)
  
  Example:
  
  ```json
  true
  ```

- `email` (optional)
  Type: boolean
  
  Health of the email interface (Mailgun)
  
  Example:
  
  ```json
  true
  ```

- `mcp` (optional)
  Type: boolean
  
  Health of the internal MCP server
  
  Example:
  
  ```json
  true
  ```

- 503: System status response detailing health of various services

Content type: application/json

Type: object

Schema: [SystemStatus](https://api.prompteasy.eu/docs/api/models/systemstatus/index.md)

- `database` (optional)
  Type: boolean
  
  Health of the EU-West project database
  
  Example:
  
  ```json
  true
  ```

- `workers` (optional)
  Type: boolean
  
  Health of the background queue workers
  
  Example:
  
  ```json
  true
  ```

- `payment_gateway` (optional)
  Type: boolean
  
  Health of the external payment gateway (Stripe)
  
  Example:
  
  ```json
  true
  ```

- `optional_ai` (optional)
  Type: boolean
  
  Health of the optional AI interface (Gemini)
  
  Example:
  
  ```json
  true
  ```

- `email` (optional)
  Type: boolean
  
  Health of the email interface (Mailgun)
  
  Example:
  
  ```json
  true
  ```

- `mcp` (optional)
  Type: boolean
  
  Health of the internal MCP server
  
  Example:
  
  ```json
  true
  ```

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/status' \
  -H 'X-Api-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/status', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/status',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```


## Health check endpoint

`GET /v1/health`

Authentication: no security requirement declared for this operation.

Responses:

- 200: System health status

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/health'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/health', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://api.prompteasy.eu/v1/health')
print(response.text)
```


## Get details of the latest contract for a given agreement type

`GET /v1/contracts/{agreement}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key

Parameters:

- `agreement` (path, string, required) - The agreement type (e.g. tos, privacy, high_risk_ai)
  Type: string

Responses:

- 200: Latest contract details

Content type: application/json

Type: object

Schema: [Contract](https://api.prompteasy.eu/docs/api/models/contract/index.md)

- `id` (optional)
  Type: string, uuid
  
  Example:
  
  ```json
  "9b2d5a39-ec9b-4b21-b3b4-4ffc8b671a53"
  ```

- `contract_id` (optional)
  Type: string, uuid; nullable
  
  Example:
  
  ```json
  "9b2d5a39-ec9b-4b21-b3b4-4ffc8b671a53"
  ```

- `contract_name` (optional)
  Type: string
  
  Example:
  
  ```json
  "Terms of Service"
  ```

- `version` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `contract_content` (optional)
  Type: string
  
  Example:
  
  ```json
  "Standard Terms of Service text..."
  ```

- `changes_summary` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "Minor wording updates in Section 2."
  ```

- `agreement_for` (optional)
  Type: string
  
  Example:
  
  ```json
  "tos"
  ```

- `only_for_plan` (optional)
  Type: string; nullable
  
  Example:
  
  ```json
  "premium"
  ```

- `is_user_contract` (optional)
  Type: boolean
  
  Example:
  
  ```json
  false
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- 404: Contract not found

Content type: application/json

Type: object

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Contract not found."
  ```

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/contracts/privacy' \
  -H 'X-Api-Key: YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/contracts/privacy', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/contracts/privacy',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
    },
)
print(response.text)
```
