Notifications

Notifications keep users informed about important events in their organization, such as workflow completions, failures, and other system events. Use these endpoints to list, read, and manage notifications.

The notification model

The notification model contains information about a single notification.

Properties

  • Name
    notification_id
    Type
    string
    Description

    Unique identifier for the notification (UUID).

  • Name
    event_type
    Type
    string
    Description

    The type of event that triggered this notification (e.g., "workflow.completed", "workflow.failed").

  • Name
    title
    Type
    string
    Description

    A short title summarizing the notification.

  • Name
    message
    Type
    string
    Description

    The full notification message with details.

  • Name
    event_data
    Type
    object
    Description

    Additional data related to the event (optional, varies by event type).

  • Name
    is_read
    Type
    boolean
    Description

    Whether the notification has been marked as read.

  • Name
    created_at
    Type
    timestamp
    Description

    When the notification was created.

  • Name
    read_at
    Type
    timestamp
    Description

    When the notification was marked as read (null if unread).


GET/notifications

List notifications

This endpoint allows you to retrieve a paginated list of notifications for the current user. Notifications are returned in reverse chronological order (newest first).

Optional attributes

  • Name
    unread_only
    Type
    boolean
    Description

    If true, only return unread notifications (default: false).

  • Name
    limit
    Type
    integer
    Description

    Maximum number of notifications to return (default: 50).

  • Name
    offset
    Type
    integer
    Description

    Number of notifications to skip for pagination (default: 0).

  • Name
    X-Org-Id
    Type
    string
    Description

    Organization identifier (header). If not provided, uses your default organization.

Request

GET
/v1/notifications
curl -G https://api.elanlanguages.ai/v1/notifications \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -d unread_only=false \
  -d limit=10

Response

{
  "notifications": [
    {
      "notification_id": "550e8400-e29b-41d4-a716-446655440000",
      "event_type": "workflow.completed",
      "title": "Translation Complete",
      "message": "Your translation job 'Marketing Docs' has completed successfully.",
      "event_data": {
        "workflow_id": "wf_abc123",
        "job_name": "Marketing Docs"
      },
      "is_read": false,
      "created_at": "2025-12-21T10:30:00Z",
      "read_at": null
    }
  ],
  "total": 25,
  "unread_count": 5
}

GET/notifications/unread/count

Get unread count

This endpoint returns the count of unread notifications for the current user. This is a lightweight endpoint suitable for polling to update notification badges.

Optional attributes

  • Name
    X-Org-Id
    Type
    string
    Description

    Organization identifier (header). If not provided, uses your default organization.

Request

GET
/v1/notifications/unread/count
curl https://api.elanlanguages.ai/v1/notifications/unread/count \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"

Response

{
  "unread_count": 5
}

GET/notifications/:notification_id

Get notification

This endpoint allows you to retrieve a specific notification by its ID.

Required attributes

  • Name
    notification_id
    Type
    string
    Description

    The unique identifier (UUID) for the notification.

Optional attributes

  • Name
    X-Org-Id
    Type
    string
    Description

    Organization identifier (header). If not provided, uses your default organization.

Request

GET
/v1/notifications/550e8400-e29b-41d4-a716-446655440000
curl https://api.elanlanguages.ai/v1/notifications/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"

Response

{
  "notification_id": "550e8400-e29b-41d4-a716-446655440000",
  "event_type": "workflow.completed",
  "title": "Translation Complete",
  "message": "Your translation job 'Marketing Docs' has completed successfully.",
  "event_data": {
    "workflow_id": "wf_abc123",
    "job_name": "Marketing Docs"
  },
  "is_read": false,
  "created_at": "2025-12-21T10:30:00Z",
  "read_at": null
}

POST/notifications/read

Mark notifications as read

This endpoint allows you to mark one or more notifications as read by providing their IDs.

Required attributes

  • Name
    notification_ids
    Type
    array
    Description

    An array of notification UUIDs to mark as read.

Optional attributes

  • Name
    X-Org-Id
    Type
    string
    Description

    Organization identifier (header). If not provided, uses your default organization.

Request

POST
/v1/notifications/read
curl -X POST https://api.elanlanguages.ai/v1/notifications/read \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}" \
  -H "Content-Type: application/json" \
  -d '{
    "notification_ids": [
      "550e8400-e29b-41d4-a716-446655440000",
      "550e8400-e29b-41d4-a716-446655440001"
    ]
  }'

Response

{
  "marked_count": 2
}

POST/notifications/read/all

Mark all as read

This endpoint marks all unread notifications as read for the current user.

Optional attributes

  • Name
    X-Org-Id
    Type
    string
    Description

    Organization identifier (header). If not provided, uses your default organization.

Request

POST
/v1/notifications/read/all
curl -X POST https://api.elanlanguages.ai/v1/notifications/read/all \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"

Response

{
  "marked_count": 5
}

DELETE/notifications/:notification_id

Delete notification

This endpoint permanently deletes a notification. Consider marking as read instead if you want to keep a record of the notification.

Required attributes

  • Name
    notification_id
    Type
    string
    Description

    The unique identifier (UUID) for the notification to delete.

Optional attributes

  • Name
    X-Org-Id
    Type
    string
    Description

    Organization identifier (header). If not provided, uses your default organization.

Request

DELETE
/v1/notifications/550e8400-e29b-41d4-a716-446655440000
curl -X DELETE https://api.elanlanguages.ai/v1/notifications/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer {token}" \
  -H "X-Org-Id: {orgId}"

Response

// Returns 204 No Content on success

Was this page helpful?