Notifications
Notifications are messages sent from the server after certain events have finished running, such as verification and file creation. On this page, we’ll dive into the different notification routes you can use to manage notifications programmatically. We'll look at how to query and mark notifications as read.
The notification model
The notification model contains all the information about each notification. There are two types of notification: Content Verification and Collection Created.
Content Verification
- Name
id
- Type
- string
- Description
Unique identifier for the notification.
- Name
user_uuid
- Type
- string
- Description
Unique identifier for the user that the notification belongs to.
- Name
card_uuid
- Type
- string
- Description
Unique identifier for the card that the notification belongs to.
- Name
verification_uuid
- Type
- string
- Description
Unique identifier for the verification that the notification belongs to.
- Name
similarity_score
- Type
- integer
- Description
The similarity score of the verification.
- Name
user_read
- Type
- boolean
- Description
Whether or not the user has read the notification.
- Name
created_at
- Type
- timestamp
- Description
Timestamp of when the notification was created.
- Name
updated_at
- Type
- timestamp
- Description
Timestamp of when the notification was last updated.
Collection Created
- Name
id
- Type
- string
- Description
Unique identifier for the notification.
- Name
user_uuid
- Type
- string
- Description
Unique identifier for the user that the notification belongs to.
- Name
collection_uuid
- Type
- string
- Description
Unique identifier for the collection that the notification belongs to.
- Name
user_read
- Type
- boolean
- Description
Whether or not the user has read the notification.
- Name
created_at
- Type
- timestamp
- Description
Timestamp of when the notification was created.
- Name
updated_at
- Type
- timestamp
- Description
Timestamp of when the notification was last updated.
Get all notifications for a user
This route allows you to retrieve all notifications for a user. Refer to the list at the top of this page to see which properties are included with notification objects. (Must be authenticated to use)
Response
If the response is successful it will return a 200 status code with an array of notifications.
- Name
notifications
- Type
- Notification
- Description
A notification object.
Request
curl -L 'https://api.arguflow.ai/api/notifications' \
-H 'Cookie: ai-editor=your_cookie_value_here'
Response
[
{
"id": "47814970-030b-42cb-b194-26779e41e981",
"user_uuid": "c9379ab0-389d-4204-8602-5ba1bf99d441",
"card_uuid": "6aa69c6b-61a3-4ef8-804d-8ed08e4608bd",
"verification_uuid": "fe2a18c1-9000-4c67-a1f5-db5e572f6886",
"similarity_score": 100,
"user_read": false,
"created_at": "2023-07-20T11:57:01.496469",
"updated_at": "2023-07-20T11:57:01.496520"
},
{
"id": "240bf745-2f6b-4ff2-811a-8bb192e705f6",
"user_uuid": "c9379ab0-389d-4204-8602-5ba1bf99d441",
"collection_uuid": "2cdf94d5-9be3-4280-81c8-2c1cb7eb8f36",
"user_read": false,
"created_at": "2023-07-20T11:55:21.452637",
"updated_at": "2023-07-20T11:55:21.452638"
},
]
Mark a notification as read
This route allows you to mark a notification as read. (Must be authenticated to use)
Required attributes
- Name
notification_id
- Type
- string
- Description
Unique identifier for the notification you want to mark as read.
Response
If the response is successful it will return a 204 status code with no body.
Request
curl https://api.arguflow.ai/api/notifications \
-H 'Cookie: ai-editor=your_cookie_value_here' \
-H 'Content-Type: application/json' \
-d "{
"notification_id": "240bf745-2f6b-4ff2-811a-8bb192e705f6"
}"
Mark all notifications as read
This route allows you to mark all notifications as read. (Must be authenticated to use)
Response
If the response is successful it will return a 204 status code with no body.
Request
curl https://api.arguflow.ai/api/notifications/all \
-H 'Cookie: ai-editor=your_cookie_value_here'