# Tenants

Tenant view and update operations. More info about compliance can be found from from [Agreements & Compliance documentation](https://prompteasy.eu/docs/administration/agreements).

## Get active tenant

`GET /v1/tenant`

Authentication (security requirement alternatives):

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

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Responses:

- 200: Tenant object

Content type: application/json

Type: object

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

- `id` (optional)
  Type: string, uuid
  
  Example:
  
  ```json
  "a81d4a03-7cf5-4cf0-9dc8-f5e1823793df"
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "Acme Inc."
  ```

- `email` (optional)
  Type: string
  
  Example:
  
  ```json
  "foo@bar.invalid"
  ```

- `country` (optional)
  Type: string
  
  Example:
  
  ```json
  "FI"
  ```

- `postal_code` (optional)
  Type: string
  
  Example:
  
  ```json
  "12345"
  ```

- `vat_id` (optional)
  Type: string
  
  Example:
  
  ```json
  "FI12345678"
  ```

- `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"
  ```

- `pm_type` (optional)
  Type: string
  
  Example:
  
  ```json
  "visa"
  ```

- `pm_last_four` (optional)
  Type: string
  
  Example:
  
  ```json
  "4242"
  ```

- `plan` (optional)
  Type: object
  
  - `id` (optional)
    Type: integer
    
    Example:
    
    ```json
    1
    ```
  
  - `name` (optional)
    Type: string
    
    Example:
    
    ```json
    "Enterprise Plan"
    ```
  
  - `slug` (optional)
    Type: string
    
    Example:
    
    ```json
    "enterprise"
    ```
  
  - `payment` (optional)
    Type: string
    
    Example:
    
    ```json
    "post-paid"
    ```
  
  - `seats` (optional)
    Type: integer
    
    Example:
    
    ```json
    10
    ```
  
  - `duration` (optional)
    Type: string
    
    Example:
    
    ```json
    "month"
    ```
  
  - `price_vat0` (optional)
    Type: integer
    
    Example:
    
    ```json
    4900
    ```
  
  - `vat` (optional)
    Type: integer
    
    Example:
    
    ```json
    24
    ```
  
  - `price_with_vat` (optional)
    Type: integer
    
    Example:
    
    ```json
    6076
    ```
  
  - `currency` (optional)
    Type: string
    
    Example:
    
    ```json
    "EUR"
    ```
  
  - `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"
    ```

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

- `quantity` (optional)
  Type: integer
  
  Example:
  
  ```json
  10
  ```

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

- `billing_portal` (optional)
  Type: string
  
  Example:
  
  ```json
  "https://billing.prompteasy.eu/..."
  ```

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

- `cfo_board_enabled` (optional)
  Type: boolean
  
  Indicates whether the CFO Board telemetry pipeline is enabled for the tenant
  
  Example:
  
  ```json
  true
  ```

- `compliance_months` (optional)
  Type: integer
  
  Example:
  
  ```json
  6
  ```

- `contracts` (optional)
  Type: object
  
  - `tos` (optional)
    Reference: [TenantContractStatus](https://api.prompteasy.eu/docs/api/models/tenantcontractstatus/index.md); Type: object
  
  - `privacy` (optional)
    Reference: [TenantContractStatus](https://api.prompteasy.eu/docs/api/models/tenantcontractstatus/index.md); Type: object
  
  - `high_risk_ai` (optional)
    Reference: [TenantContractStatus](https://api.prompteasy.eu/docs/api/models/tenantcontractstatus/index.md); Type: object

- `settings` (optional)
  Reference: [TenantSettings](https://api.prompteasy.eu/docs/api/models/tenantsettings/index.md); Type: object

- 403: Forbidden

## Examples

### cURL

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

### JavaScript

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

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

### Python

```python
import requests

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


## Update a tenant

`PUT /v1/tenant`

Authentication (security requirement alternatives):

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

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Request body: application/json (required)

Type: object

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

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

- `ai_enabled` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `suggestion_auto_approve` (optional)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `pagination_per_page` (optional)
  Type: integer
  
  Example:
  
  ```json
  20
  ```

- `high_risk_ai` (optional)
  Type: boolean
  
  Whether high risk AI features are enabled
  
  Example:
  
  ```json
  true
  ```

Responses:

- 200: Tenant object

Content type: application/json

Type: object

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

- `id` (optional)
  Type: string, uuid
  
  Example:
  
  ```json
  "a81d4a03-7cf5-4cf0-9dc8-f5e1823793df"
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "Acme Inc."
  ```

- `email` (optional)
  Type: string
  
  Example:
  
  ```json
  "foo@bar.invalid"
  ```

- `country` (optional)
  Type: string
  
  Example:
  
  ```json
  "FI"
  ```

- `postal_code` (optional)
  Type: string
  
  Example:
  
  ```json
  "12345"
  ```

- `vat_id` (optional)
  Type: string
  
  Example:
  
  ```json
  "FI12345678"
  ```

- `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"
  ```

- `pm_type` (optional)
  Type: string
  
  Example:
  
  ```json
  "visa"
  ```

- `pm_last_four` (optional)
  Type: string
  
  Example:
  
  ```json
  "4242"
  ```

- `plan` (optional)
  Type: object
  
  - `id` (optional)
    Type: integer
    
    Example:
    
    ```json
    1
    ```
  
  - `name` (optional)
    Type: string
    
    Example:
    
    ```json
    "Enterprise Plan"
    ```
  
  - `slug` (optional)
    Type: string
    
    Example:
    
    ```json
    "enterprise"
    ```
  
  - `payment` (optional)
    Type: string
    
    Example:
    
    ```json
    "post-paid"
    ```
  
  - `seats` (optional)
    Type: integer
    
    Example:
    
    ```json
    10
    ```
  
  - `duration` (optional)
    Type: string
    
    Example:
    
    ```json
    "month"
    ```
  
  - `price_vat0` (optional)
    Type: integer
    
    Example:
    
    ```json
    4900
    ```
  
  - `vat` (optional)
    Type: integer
    
    Example:
    
    ```json
    24
    ```
  
  - `price_with_vat` (optional)
    Type: integer
    
    Example:
    
    ```json
    6076
    ```
  
  - `currency` (optional)
    Type: string
    
    Example:
    
    ```json
    "EUR"
    ```
  
  - `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"
    ```

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

- `quantity` (optional)
  Type: integer
  
  Example:
  
  ```json
  10
  ```

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

- `billing_portal` (optional)
  Type: string
  
  Example:
  
  ```json
  "https://billing.prompteasy.eu/..."
  ```

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

- `cfo_board_enabled` (optional)
  Type: boolean
  
  Indicates whether the CFO Board telemetry pipeline is enabled for the tenant
  
  Example:
  
  ```json
  true
  ```

- `compliance_months` (optional)
  Type: integer
  
  Example:
  
  ```json
  6
  ```

- `contracts` (optional)
  Type: object
  
  - `tos` (optional)
    Reference: [TenantContractStatus](https://api.prompteasy.eu/docs/api/models/tenantcontractstatus/index.md); Type: object
  
  - `privacy` (optional)
    Reference: [TenantContractStatus](https://api.prompteasy.eu/docs/api/models/tenantcontractstatus/index.md); Type: object
  
  - `high_risk_ai` (optional)
    Reference: [TenantContractStatus](https://api.prompteasy.eu/docs/api/models/tenantcontractstatus/index.md); Type: object

- `settings` (optional)
  Reference: [TenantSettings](https://api.prompteasy.eu/docs/api/models/tenantsettings/index.md); Type: object

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

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

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X PUT 'https://api.prompteasy.eu/v1/tenant' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "is_individual": false,
  "ai_enabled": true,
  "suggestion_auto_approve": true,
  "pagination_per_page": 20,
  "high_risk_ai": true
}'
```

### JavaScript

```javascript
const body = `{
  "is_individual": false,
  "ai_enabled": true,
  "suggestion_auto_approve": true,
  "pagination_per_page": 20,
  "high_risk_ai": true
}`;

const response = await fetch('https://api.prompteasy.eu/v1/tenant', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "is_individual": false,
  "ai_enabled": true,
  "suggestion_auto_approve": true,
  "pagination_per_page": 20,
  "high_risk_ai": true
}'''

response = requests.put(
    'https://api.prompteasy.eu/v1/tenant',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Download unencrypted compliance data

`GET /v1/tenant/custody`

Authentication (security requirement alternatives):

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

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Responses:

- 200: A raw, unencrypted JSONL file containing the compliance details of the tenant.

Content type: application/x-jsonlines

Type: string, binary

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

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

### JavaScript

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

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

### Python

```python
import requests

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