Collaboration API

Manage team collaboration on deals with assignments, threaded comments, document requests, activity timelines, and notifications. All collaboration data is scoped to your organization.

Assignments

Assign team members to deals with specific roles. Assignments trigger notifications and appear in the deal's activity timeline.

Returns all current assignments for a deal, including the assigned user's details and role.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
Request
curl https://api.banklyze.com/v1/deals/42/assignments \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": [
    {
      "id": 1,
      "deal_id": 42,
      "user_id": 5,
      "user_email": "analyst@company.com",
      "user_name": "Jane Smith",
      "role": "reviewer",
      "assigned_at": "2026-03-01T10:00:00Z",
      "assigned_by": "manager@company.com"
    },
    {
      "id": 2,
      "deal_id": 42,
      "user_id": 8,
      "user_email": "underwriter@company.com",
      "user_name": "John Doe",
      "role": "underwriter",
      "assigned_at": "2026-03-01T10:05:00Z",
      "assigned_by": "manager@company.com"
    }
  ]
}

Assign a user to a deal with a specific role. The assigned user receives a notification.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
user_idintegerRequiredThe user ID to assign
rolestringRequiredAssignment role: "reviewer", "underwriter", or "manager"
Request
curl -X POST https://api.banklyze.com/v1/deals/42/assignments \
  -H "Authorization: Bearer sk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 5,
    "role": "reviewer"
  }'
201 Created
{
  "data": {
    "id": 3,
    "deal_id": 42,
    "user_id": 5,
    "role": "reviewer",
    "assigned_at": "2026-03-10T14:30:00Z",
    "assigned_by": "manager@company.com"
  }
}

Remove a user's assignment from a deal. Returns 204 No Content on success.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
assignment_idintegerRequiredThe assignment ID to remove
Request
curl -X DELETE https://api.banklyze.com/v1/deals/42/assignments/3 \
  -H "Authorization: Bearer sk_live_abc123"

Comments

Threaded comments on deals. Top-level comments can have replies via the parent_id field. Comments support a single level of nesting.

Returns paginated comments for a deal. Top-level comments include their nested replies.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
pageintegerDefault: 1Page number
per_pageintegerDefault: 25Results per page (max 100)
Request
curl "https://api.banklyze.com/v1/deals/42/comments?page=1&per_page=25" \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": [
    {
      "id": 10,
      "deal_id": 42,
      "user_id": 5,
      "user_name": "Jane Smith",
      "content": "Revenue looks strong but NSF count is concerning. Flagging for senior review.",
      "parent_id": null,
      "created_at": "2026-03-05T09:15:00Z",
      "updated_at": "2026-03-05T09:15:00Z",
      "replies": [
        {
          "id": 11,
          "user_id": 8,
          "user_name": "John Doe",
          "content": "Agreed. The 4 NSFs in January are a red flag. Requesting additional statements.",
          "parent_id": 10,
          "created_at": "2026-03-05T10:00:00Z"
        }
      ]
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 25,
    "total": 1,
    "total_pages": 1
  }
}

Add a comment to a deal. Set parent_id to reply to an existing comment.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
contentstringRequiredComment text content
parent_idintegerOptionalParent comment ID for threaded replies
Request
curl -X POST https://api.banklyze.com/v1/deals/42/comments \
  -H "Authorization: Bearer sk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Revenue looks strong but NSF count is concerning.",
    "parent_id": null
  }'
201 Created
{
  "data": {
    "id": 12,
    "deal_id": 42,
    "user_id": 5,
    "content": "Revenue looks strong but NSF count is concerning.",
    "parent_id": null,
    "created_at": "2026-03-10T14:30:00Z"
  }
}

Update the content of an existing comment. Only the comment author can edit their own comments.

NameTypeRequiredDescription
comment_idintegerRequiredThe comment ID to edit
contentstringRequiredUpdated comment text
Request
curl -X PATCH https://api.banklyze.com/v1/comments/12 \
  -H "Authorization: Bearer sk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Revenue looks strong but NSF count is concerning. Flagging for senior review."
  }'

Soft-delete a comment. Only the comment author or an admin can delete comments. Returns 204 No Content on success.

NameTypeRequiredDescription
comment_idintegerRequiredThe comment ID to delete
Request
curl -X DELETE https://api.banklyze.com/v1/comments/12 \
  -H "Authorization: Bearer sk_live_abc123"

Document Requests

Request additional documents from applicants. Track request status as pending, fulfilled, or cancelled.

Returns all document requests for a deal, including their current status and due dates.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
Request
curl https://api.banklyze.com/v1/deals/42/doc-requests \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": [
    {
      "id": 1,
      "deal_id": 42,
      "document_type": "bank_statement",
      "description": "Please provide January and February 2026 bank statements.",
      "status": "pending",
      "due_date": "2026-03-15",
      "requested_by": "underwriter@company.com",
      "created_at": "2026-03-05T11:00:00Z",
      "fulfilled_at": null
    }
  ]
}

Create a new document request on a deal. Optionally set a due date for the request.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
document_typestringRequiredType of document requested: "bank_statement", "tax_return", or "profit_and_loss"
descriptionstringRequiredHuman-readable description of what is needed
due_datestringOptionalDue date in YYYY-MM-DD format
Request
curl -X POST https://api.banklyze.com/v1/deals/42/doc-requests \
  -H "Authorization: Bearer sk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "document_type": "bank_statement",
    "description": "Please provide January and February 2026 bank statements.",
    "due_date": "2026-03-15"
  }'
201 Created
{
  "data": {
    "id": 2,
    "deal_id": 42,
    "document_type": "bank_statement",
    "description": "Please provide January and February 2026 bank statements.",
    "status": "pending",
    "due_date": "2026-03-15",
    "created_at": "2026-03-10T14:30:00Z"
  }
}

Update the status of a document request. Valid statuses are pending, fulfilled, and cancelled.

NameTypeRequiredDescription
request_idintegerRequiredThe document request ID
statusstringRequiredNew status: "pending", "fulfilled", or "cancelled"
Request
curl -X PATCH https://api.banklyze.com/v1/doc-requests/2 \
  -H "Authorization: Bearer sk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "fulfilled"
  }'

Activity Timeline

A unified chronological view of everything that has happened on a deal: status changes, document uploads, comments, assignments, and processing events.

Returns the full activity timeline for a deal in chronological order. Includes all event types merged into a single stream.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
Request
curl https://api.banklyze.com/v1/deals/42/timeline \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": [
    {
      "type": "status_change",
      "timestamp": "2026-03-01T10:00:00Z",
      "actor": "system",
      "details": {
        "old_status": "new",
        "new_status": "processing"
      }
    },
    {
      "type": "document_uploaded",
      "timestamp": "2026-03-01T10:01:00Z",
      "actor": "analyst@company.com",
      "details": {
        "document_id": 101,
        "document_type": "bank_statement",
        "filename": "acme-jan-2026.pdf"
      }
    },
    {
      "type": "comment",
      "timestamp": "2026-03-05T09:15:00Z",
      "actor": "Jane Smith",
      "details": {
        "comment_id": 10,
        "content": "Revenue looks strong but NSF count is concerning."
      }
    },
    {
      "type": "assignment",
      "timestamp": "2026-03-05T10:30:00Z",
      "actor": "manager@company.com",
      "details": {
        "user_name": "John Doe",
        "role": "underwriter"
      }
    }
  ]
}

Returns a paginated activity feed for a deal. Each entry records a discrete action with the actor and metadata.

NameTypeRequiredDescription
deal_idintegerRequiredThe deal ID
pageintegerDefault: 1Page number
per_pageintegerDefault: 50Results per page (max 100)
Request
curl "https://api.banklyze.com/v1/deals/42/activity?page=1&per_page=50" \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": [
    {
      "id": 201,
      "deal_id": 42,
      "action": "document.uploaded",
      "actor_id": 5,
      "actor_name": "Jane Smith",
      "metadata": {
        "document_id": 101,
        "filename": "acme-jan-2026.pdf"
      },
      "created_at": "2026-03-01T10:01:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 50,
    "total": 24,
    "total_pages": 1
  }
}

The timeline endpoint returns all event types in a unified stream, while the activity endpoint returns structured activity records with pagination. Use timeline for a deal detail view and activity for audit logs.

Notifications

Retrieve and manage in-app notifications for the authenticated user. Notifications are generated by assignments, mentions, and deal status changes.

Returns paginated notifications for the authenticated user, ordered by most recent first.

NameTypeRequiredDescription
pageintegerDefault: 1Page number
per_pageintegerDefault: 25Results per page (max 100)
unread_onlybooleanDefault: falseFilter to unread notifications only
Request
curl https://api.banklyze.com/v1/notifications \
  -H "Authorization: Bearer sk_live_abc123"
200 OK
{
  "data": [
    {
      "id": 301,
      "type": "deal.assigned",
      "title": "New deal assignment",
      "message": "You have been assigned as reviewer on Acme Trucking LLC",
      "deal_id": 42,
      "read": false,
      "created_at": "2026-03-10T14:30:00Z"
    },
    {
      "id": 300,
      "type": "comment.mention",
      "title": "New comment mention",
      "message": "Jane Smith mentioned you in a comment on Acme Trucking LLC",
      "deal_id": 42,
      "read": true,
      "created_at": "2026-03-09T11:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 25,
    "total": 2,
    "total_pages": 1
  }
}

Mark one or more notifications as read. Pass an array of notification IDs to batch-update.

NameTypeRequiredDescription
notification_idsinteger[]RequiredArray of notification IDs to mark as read
Request
curl -X POST https://api.banklyze.com/v1/notifications/mark-read \
  -H "Authorization: Bearer sk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "notification_ids": [301, 300]
  }'
200 OK
{
  "data": {
    "marked": 2
  }
}