# User Management

## List organization users

> List all users for the current organization.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users":{"get":{"summary":"List organization users","tags":["user-management"],"description":"List all users for the current organization.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"],"additionalProperties":false}}},"required":["records"],"additionalProperties":false}}}}}}}}}
```

## List organization invitations

> List all pending invitations for the current organization.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/invitations":{"get":{"summary":"List organization invitations","tags":["user-management"],"description":"List all pending invitations for the current organization.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["ORG_OWNER","VIEWER"]},"createdAt":{"type":"string"}},"required":["id","email","role","createdAt"],"additionalProperties":false}}},"required":["records"],"additionalProperties":false}}}}}}}}}
```

## Invite user to organization

> Invite a new user to the current organization via Auth0.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/invitations":{"post":{"summary":"Invite user to organization","tags":["user-management"],"description":"Invite a new user to the current organization via Auth0.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["ORG_OWNER","VIEWER"]}},"required":["email","role"]}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"invitationUrl":{"type":"string"}},"required":["id","invitationUrl"],"additionalProperties":false}}}}}}}}}
```

## Delete organization invitation

> Delete a pending invitation from the organization. Only users with MANAGE\_USERS permission can delete invitations.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/invitations/{invitationId}":{"delete":{"summary":"Delete organization invitation","tags":["user-management"],"description":"Delete a pending invitation from the organization. Only users with MANAGE_USERS permission can delete invitations.","parameters":[{"schema":{"type":"string"},"in":"path","name":"invitationId","required":true}],"responses":{"204":{"description":"Default Response"}}}}}}
```

## Get user by ID

> Get a specific user by their ID from the current organization.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/{userId}":{"get":{"summary":"Get user by ID","tags":["user-management"],"description":"Get a specific user by their ID from the current organization.","parameters":[{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["ORG_OWNER","VIEWER"]}},"required":["id","email","role"],"additionalProperties":false}}}}}}}}}
```

## Delete user from organization

> Delete a user from the organization. Only users with MANAGE\_USERS permission can delete users.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/{userId}":{"delete":{"summary":"Delete user from organization","tags":["user-management"],"description":"Delete a user from the organization. Only users with MANAGE_USERS permission can delete users.","parameters":[{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"204":{"description":"Default Response"}}}}}}
```

## Update user information

> Update user information in the organization. Only basic profile fields can be updated.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/{userId}":{"patch":{"summary":"Update user information","tags":["user-management"],"description":"Update user information in the organization. Only basic profile fields can be updated.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["ORG_OWNER","VIEWER"]}},"required":["email","role"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["ORG_OWNER","VIEWER"]}},"required":["id","email","role"],"additionalProperties":false}}}}}}}}}
```

## Reset user password

> Reset a user's password. Users can reset their own password, organization managers can reset passwords for users in their organization, and super admins can reset any user's password.

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/{userId}/password-reset-ticket":{"post":{"summary":"Reset user password","tags":["user-management"],"description":"Reset a user's password. Users can reset their own password, organization managers can reset passwords for users in their organization, and super admins can reset any user's password.","parameters":[{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"string"}},"required":["ticket"],"additionalProperties":false}}}}}}}}}
```

## Get MFA enrollment ticket

> Get an MFA enrollment ticket for the current user or a specified user (requires appropriate permissions).

```json
{"openapi":"3.0.3","info":{"title":"Dashboard API","version":"1.0.0"},"tags":[{"name":"user-management"}],"security":[{"every":["manage:users"]}],"components":{"securitySchemes":{"every":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://auth.dev.damisa.xyz/authorize","tokenUrl":"https://auth.dev.damisa.xyz/oauth/token","scopes":{"create:settlement":"Allows initiating a new settlement.","create:payout":"Allows creating a new payout.","manage:contact_book":"Allows managing the organization's contact book.","create:payment_request":"Allows creating a new payment request.","manage:users":"Allows organization's users","manage:token":"Allows to create and delete API Tokens.","manage:webhook":"Allows to create and delete webhooks."}}}}}},"paths":{"/api/v1/users/{userId}/mfa-enrollment-ticket":{"post":{"summary":"Get MFA enrollment ticket","tags":["user-management"],"description":"Get an MFA enrollment ticket for the current user or a specified user (requires appropriate permissions).","parameters":[{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"type":"string"}},"required":["ticket"],"additionalProperties":false}}}}}}}}}
```
