REST /api/v1/activity-attachments 6 endpoints
GET /api/v1/activity-attachments/api/v1/activity-attachments

List attachment records. Supports filtering by activity_id. Calls getByActivityId(activityId) when activity_id filter is present.

Public

Response Example

{
  "data": [
    {
      "id": "att_7f3a9c12",
      "activity_id": "act_4b2e1f89",
      "org_id": "org_abc123",
      "file_name": "session_notes.pdf",
      "file_size": 204800,
      "content_type": "application/pdf",
      "storage_path": "org_abc123/activities/act_4b2e1f89/session_notes.pdf",
      "uploaded_by": "usr_9d5c3a71",
      "created_at": "2026-03-15T09:12:34Z",
      "updated_at": "2026-03-15T09:12:34Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1
  }
}
GET /api/v1/activity-attachments/api/v1/activity-attachments/:id

Retrieve a single attachment record by ID.

Public

Response Example

{
  "id": "att_7f3a9c12",
  "activity_id": "act_4b2e1f89",
  "org_id": "org_abc123",
  "file_name": "session_notes.pdf",
  "file_size": 204800,
  "content_type": "application/pdf",
  "storage_path": "org_abc123/activities/act_4b2e1f89/session_notes.pdf",
  "uploaded_by": "usr_9d5c3a71",
  "created_at": "2026-03-15T09:12:34Z",
  "updated_at": "2026-03-15T09:12:34Z"
}
POST /api/v1/activity-attachments/api/v1/activity-attachments

Insert a new attachment record (database row only — binary upload handled by supabase-storage-adapter). Calls insertAttachment(record).

Public

Request Example

{
  "activity_id": "act_4b2e1f89",
  "org_id": "org_abc123",
  "file_name": "intake_form.pdf",
  "file_size": 87040,
  "content_type": "application/pdf",
  "storage_path": "org_abc123/activities/act_4b2e1f89/intake_form.pdf",
  "uploaded_by": "usr_9d5c3a71"
}

Response Example

{
  "id": "att_1a5b7c93",
  "activity_id": "act_4b2e1f89",
  "org_id": "org_abc123",
  "file_name": "intake_form.pdf",
  "file_size": 87040,
  "content_type": "application/pdf",
  "storage_path": "org_abc123/activities/act_4b2e1f89/intake_form.pdf",
  "uploaded_by": "usr_9d5c3a71",
  "created_at": "2026-03-26T14:23:45Z",
  "updated_at": "2026-03-26T14:23:45Z"
}
PUT /api/v1/activity-attachments/api/v1/activity-attachments/:id

Update an attachment record (e.g. rename file_name, update storage_path after a move).

Public

Request Example

{
  "file_name": "intake_form_signed.pdf",
  "storage_path": "org_abc123/activities/act_4b2e1f89/intake_form_signed.pdf"
}

Response Example

{
  "id": "att_1a5b7c93",
  "activity_id": "act_4b2e1f89",
  "org_id": "org_abc123",
  "file_name": "intake_form_signed.pdf",
  "file_size": 87040,
  "content_type": "application/pdf",
  "storage_path": "org_abc123/activities/act_4b2e1f89/intake_form_signed.pdf",
  "uploaded_by": "usr_9d5c3a71",
  "created_at": "2026-03-26T14:23:45Z",
  "updated_at": "2026-03-26T16:05:10Z"
}
DELETE /api/v1/activity-attachments/api/v1/activity-attachments/:id

Delete an attachment record from the database (org-scoped). Calls deleteAttachment(attachmentId, orgId).

Public

Response Example

{
  "success": true,
  "deleted_id": "att_1a5b7c93",
  "org_id": "org_abc123"
}
GET /api/v1/activity-attachments/api/v1/activity-attachments/count

Return the total number of attachments for a given activity. Calls countByActivityId(activityId).

Public

Response Example

{
  "activity_id": "act_4b2e1f89",
  "count": 5
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}