> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexus-search.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounts

> Manage your business relationships with organizations and companies

## Overview

Accounts in Nexus Search represent organizations or companies with whom you have or are establishing a business relationship. They serve as the central hub for managing all interactions, contacts, projects, and opportunities related to a specific company.

## Finding Accounts

You can access your accounts through the left sidebar navigation:

1. Navigate to the **Records** section
2. Click on **Accounts**
3. View a complete list of all account records in Nexus Search

## Account Creation

### Quick Start

To create a new account:

<Steps>
  <Step title="Open Account Creation">
    Click the blue **"Add Account"** button in the top right corner
  </Step>

  <Step title="Configure AI Profile Generation">
    A dialog opens where you can enable or disable AI-assisted account creation (enabled by default)
  </Step>

  <Step title="Enter Account Details">
    Fill in the required and optional fields
  </Step>

  <Step title="Review AI-Generated Profile">
    Review the automatically generated company profile
  </Step>

  <Step title="Create Account">
    Click **"Create Account"** to finalize
  </Step>
</Steps>

### AI-Assisted Profile Generation

<Info>
  When AI-assisted profile generation is enabled, Nexus Search uses AI-powered web searches and additional data sources to automatically describe the organization or company. This includes:

  * Company activities and business description
  * Locations and office information
  * Publicly known decision-makers
  * Other relevant information to better understand the company

  Content from the company website is incorporated into the company portrait.
</Info>

### Required and Optional Fields

**Company Name** (Required)

* Enter the company name (e.g., "Mustermann AG")
* This field is mandatory for account creation

**Website/Domain** (Recommended)

* Add the company website or domain
* Used by AI to enhance the company portrait
* Website content is analyzed and incorporated

**Account Description** (Optional)

* Add custom notes or observations
* Options for adding content:
  * Copy and paste from other sources
  * Type your own thoughts and notes
  * Use **Speech-to-Text** feature to dictate your observations
    * AI creates a transcript automatically
    * Transcript is inserted into the description field

**Account Workflow** (Optional)

* Select a workflow stage (e.g., "Prospect", "New Customer", "Existing Customer")
* Account workflows can be configured in Settings under "Workflows"

### Profile Review

After clicking **"Create Profile"**, you'll see an overview page displaying:

* **AI-Generated Company Portrait** - Comprehensive description of the company
* **Extracted Information**:
  * Industry classification
  * Company size
  * Headquarters location
  * LinkedIn URL

Review the generated information and click **"Create Account"** to finalize.

## Viewing Account Details

Once created, you'll be directed to the account detail page where you can:

* View structured data in the **Details** tab
* See the AI-generated company profile
* Edit any information as needed
* Access related records (contacts, projects, jobs, etc.)

## Editing Account Details

<Steps>
  <Step title="Open Account Details">
    Navigate to the account detail page
  </Step>

  <Step title="Access Details Tab">
    Click on the **"Details"** tab
  </Step>

  <Step title="Enter Edit Mode">
    Click the **"Edit"** button on the right side
  </Step>

  <Step title="Modify Fields">
    All account sections will open for editing. Update any relevant fields.
  </Step>

  <Step title="Save or Cancel">
    * Click **"Save"** at the bottom of the page to save changes
    * Or click **"Cancel"** to discard changes
  </Step>
</Steps>

## Deleting an Account

<Warning>
  Deleting an account will permanently remove the account and associated data. This action cannot be undone.
</Warning>

To delete an account:

<Steps>
  <Step title="Open Account Details">
    Navigate to the account detail page
  </Step>

  <Step title="Access Details Tab">
    Click on the **"Details"** tab
  </Step>

  <Step title="Scroll to Danger Zone">
    Scroll to the bottom of the page to find the red-highlighted danger zone
  </Step>

  <Step title="Initiate Deletion">
    Click the **"Delete Account"** button
  </Step>

  <Step title="Confirm Deletion">
    * Read the warning about data loss
    * Type the account name into the confirmation field
    * Click **"Delete Account"** to confirm
  </Step>
</Steps>

Claude description:

## 1) Deleting an Account

| **What**                                   | **What Happens**                                                                                                                                | **Mechanism**                          |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| **Account record**                         | Deleted                                                                                                                                         | Edge function step 4                   |
| **Documents (account\_files rows)**        | Deleted                                                                                                                                         | DB CASCADE on account\_id FK           |
| **Document files in account-files bucket** | Deleted                                                                                                                                         | Edge function step 1 (storage cleanup) |
| **Activities referencing this account**    | Account ID removed from account\_ids array; activity deleted if no other entity references remain                                               | Edge function step 3                   |
| **Related Contacts**                       | **NOT deleted** — contacts are independent entities; they may reference the account via account\_id but that FK is likely SET NULL or NO ACTION | DB FK behavior                         |
| **Related Projects**                       | **NOT deleted** — projects linked via account\_id remain; FK is likely SET NULL                                                                 | DB FK behavior                         |

## (2) Other Entities

| **Entity**      |        **Documents Cleaned**        |           **Storage Cleaned**          |     **Activities Cleaned**     | **Special Handling**                                                                                 |
| --------------- | :---------------------------------: | :------------------------------------: | :----------------------------: | ---------------------------------------------------------------------------------------------------- |
| **Contact**     |   contact\_files rows via CASCADE   |   contact-files bucket files removed   |   contact\_ids array updated   | None. Related account is NOT affected.                                                               |
| **Candidate**   |  candidate\_files rows via CASCADE  |  candidate-files bucket files removed  |  candidate\_ids array updated  | None. Applications referencing this candidate depend on DB FK behavior (likely CASCADE or SET NULL). |
| **Project**     |   project\_files rows via CASCADE   |   project-files bucket files removed   |   project\_ids array updated   | None. Related jobs/account are NOT deleted.                                                          |
| **Job**         |     job\_files rows via CASCADE     |     job-files bucket files removed     |     job\_ids array updated     | screening\_questions and form\_submissions manually deleted first (NO ACTION FK).                    |
| **Application** | application\_files rows via CASCADE | application-files bucket files removed | application\_ids array updated | None. Related candidate/job are NOT affected.                                                        |

**In all cases**: The function only deletes the single entity you target plus its direct dependents (files, activities). It does **not** walk up or sideways to delete related first-class entities (e.g. deleting a project won't delete its jobs; deleting a candidate won't delete their applications unless the DB FK is set to CASCADE).
