# Manage   Users

## POST /get-users

> List users

```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-users":{"post":{"operationId":"get_users","summary":"List users","tags":["Manage - Users"],"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-users-all

> List all users

```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-users-all":{"post":{"operationId":"get_users_all","summary":"List all users","tags":["Manage - Users"],"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 /create-user

> Create user

```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":{"/create-user":{"post":{"operationId":"create_user","summary":"Create user","tags":["Manage - Users"],"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-user

> Update user

```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-user":{"post":{"operationId":"update_user","summary":"Update user","tags":["Manage - Users"],"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 /delete-user

> Delete user

```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":{"/delete-user":{"post":{"operationId":"delete_user","summary":"Delete user","tags":["Manage - Users"],"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 /invite-user-with-role

> Invite user with role

```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":{"/invite-user-with-role":{"post":{"operationId":"invite_user_with_role","summary":"Invite user with role","tags":["Manage - Users"],"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-invitation

> Get invitation

```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-invitation":{"post":{"operationId":"get_invitation","summary":"Get invitation","tags":["Manage - Users"],"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 /accept-invitation

> Accept invitation

```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":{"/accept-invitation":{"post":{"operationId":"accept_invitation","summary":"Accept invitation","tags":["Manage - Users"],"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 /resend-invitation

> Resend invitation

```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":{"/resend-invitation":{"post":{"operationId":"resend_invitation","summary":"Resend invitation","tags":["Manage - Users"],"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-current-user-roles

> Get current user roles

```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-current-user-roles":{"post":{"operationId":"get_current_user_roles","summary":"Get current user roles","tags":["Manage - Users"],"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 /manage-roles

> Manage roles

```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":{"/manage-roles":{"post":{"operationId":"manage_roles","summary":"Manage roles","tags":["Manage - Users"],"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"}}}}}}}}}
```
