# Security

## POST /add-ip-whitelist

> Add IP whitelist

```json
{"openapi":"3.0.3","info":{"title":"Investhub API","version":"1.0.0"},"servers":[{"url":"https://{project}.supabase.co/functions/v1","variables":{"project":{"default":"your-project-ref","description":"Supabase project reference"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy access token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/add-ip-whitelist":{"post":{"operationId":"add_ip_whitelist","summary":"Add IP whitelist","tags":["Security"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"See Edge Function source for exact request shape (e.g. interface XxxRequest in index.ts)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /remove-ip-whitelist

> Remove IP whitelist

```json
{"openapi":"3.0.3","info":{"title":"Investhub API","version":"1.0.0"},"servers":[{"url":"https://{project}.supabase.co/functions/v1","variables":{"project":{"default":"your-project-ref","description":"Supabase project reference"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy access token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/remove-ip-whitelist":{"post":{"operationId":"remove_ip_whitelist","summary":"Remove IP whitelist","tags":["Security"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"See Edge Function source for exact request shape (e.g. interface XxxRequest in index.ts)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /toggle-ip-whitelist

> Toggle IP whitelist

```json
{"openapi":"3.0.3","info":{"title":"Investhub API","version":"1.0.0"},"servers":[{"url":"https://{project}.supabase.co/functions/v1","variables":{"project":{"default":"your-project-ref","description":"Supabase project reference"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy access token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/toggle-ip-whitelist":{"post":{"operationId":"toggle_ip_whitelist","summary":"Toggle IP whitelist","tags":["Security"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"See Edge Function source for exact request shape (e.g. interface XxxRequest in index.ts)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /get-ip-whitelists

> Get IP whitelists

```json
{"openapi":"3.0.3","info":{"title":"Investhub API","version":"1.0.0"},"servers":[{"url":"https://{project}.supabase.co/functions/v1","variables":{"project":{"default":"your-project-ref","description":"Supabase project reference"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy access token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/get-ip-whitelists":{"post":{"operationId":"get_ip_whitelists","summary":"Get IP whitelists","tags":["Security"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"See Edge Function source for exact request shape (e.g. interface XxxRequest in index.ts)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /sync-mfa-status

> Sync MFA status

```json
{"openapi":"3.0.3","info":{"title":"Investhub API","version":"1.0.0"},"servers":[{"url":"https://{project}.supabase.co/functions/v1","variables":{"project":{"default":"your-project-ref","description":"Supabase project reference"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy access token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/sync-mfa-status":{"post":{"operationId":"sync_mfa_status","summary":"Sync MFA status","tags":["Security"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"See Edge Function source for exact request shape (e.g. interface XxxRequest in index.ts)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /update-mfa-status

> Update MFA status

```json
{"openapi":"3.0.3","info":{"title":"Investhub API","version":"1.0.0"},"servers":[{"url":"https://{project}.supabase.co/functions/v1","variables":{"project":{"default":"your-project-ref","description":"Supabase project reference"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Privy access token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}},"paths":{"/update-mfa-status":{"post":{"operationId":"update_mfa_status","summary":"Update MFA status","tags":["Security"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"See Edge Function source for exact request shape (e.g. interface XxxRequest in index.ts)"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
