# Notifications

## Get All User Notifications

> Get notifications for a specific user.\
> \
> Args:\
> \----\
> &#x20;   user (UserProfile): The user profile dependency.\
> &#x20;   organization (Organization): The organization dependency.\
> &#x20;   notification\_service (NotificationService): The notification service dependency\
> \
> Returns:\
> \-------\
> &#x20;   list\[UserNotificationBase]: The list of notifications for the user.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}},"paths":{"/notifications/":{"get":{"tags":["notifications"],"summary":"Get All User Notifications","description":"Get notifications for a specific user.\n\nArgs:\n----\n    user (UserProfile): The user profile dependency.\n    organization (Organization): The organization dependency.\n    notification_service (NotificationService): The notification service dependency\n\nReturns:\n-------\n    list[UserNotificationBase]: The list of notifications for the user.","operationId":"get_all_user_notifications_notifications__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response Get All User Notifications Notifications  Get"}}}}}}}}}
```

## Delete Notification

> Delete a notification by its ID.\
> \
> Args:\
> \----\
> &#x20;   notification\_id (str): The ID of the notification to delete.\
> &#x20;   user (UserProfile): The user profile dependency.\
> &#x20;   notification\_service (NotificationService): The notification service dependency\
> &#x20;   created\_at (datetime.datetime): The created at date of the notification.\
> \
> Returns:\
> \-------\
> &#x20;   dict: The response indicating the success of the deletion.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/notifications/{notification_id}":{"delete":{"tags":["notifications"],"summary":"Delete Notification","description":"Delete a notification by its ID.\n\nArgs:\n----\n    notification_id (str): The ID of the notification to delete.\n    user (UserProfile): The user profile dependency.\n    notification_service (NotificationService): The notification service dependency\n    created_at (datetime.datetime): The created at date of the notification.\n\nReturns:\n-------\n    dict: The response indicating the success of the deletion.","operationId":"delete_notification_notifications__notification_id__delete","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Notification Id"}},{"name":"created_at","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"Created At"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Notification Notifications  Notification Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Update Notification

> Update a notification.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"UpdateUserNotification":{"properties":{"read_at":{"type":"string","format":"date-time","title":"Read At"}},"type":"object","required":["read_at"],"title":"UpdateUserNotification"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/notifications/{notification_id}":{"patch":{"tags":["notifications"],"summary":"Update Notification","description":"Update a notification.","operationId":"update_notification_notifications__notification_id__patch","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Notification Id"}},{"name":"created_at","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"Created At"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserNotification"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Notification Notifications  Notification Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Delete All User Notifications

> Delete all notifications for a specific user.\
> \
> Args:\
> \----\
> &#x20;   user (UserProfile): The user profile dependency.\
> &#x20;   organization (Organization): The organization dependency\
> &#x20;   notification\_service (NotificationService): The notification service dependency\
> \
> Returns:\
> \-------\
> &#x20;   dict: The response indicating the success of the deletion.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}},"paths":{"/notifications/all/":{"delete":{"tags":["notifications"],"summary":"Delete All User Notifications","description":"Delete all notifications for a specific user.\n\nArgs:\n----\n    user (UserProfile): The user profile dependency.\n    organization (Organization): The organization dependency\n    notification_service (NotificationService): The notification service dependency\n\nReturns:\n-------\n    dict: The response indicating the success of the deletion.","operationId":"delete_all_user_notifications_notifications_all__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete All User Notifications Notifications All  Delete"}}}}}}}}}
```

## Get Users From Org By Role

> Get users from organization by role.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/notifications/{notification_id}/":{"post":{"tags":["notifications"],"summary":"Get Users From Org By Role","description":"Get users from organization by role.","operationId":"get_users_from_org_by_role_notifications__notification_id___post","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Notification Id"}},{"name":"role_name","in":"query","required":true,"schema":{"type":"string","title":"Role Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Users From Org By Role Notifications  Notification Id   Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
