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

# Accounts API

> REST endpoints for creating, reading, updating, and deleting account (company) records in ParsaLink.

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "linear-gradient(90deg, #143D4E 0%, #1C758A 100%)",
color: "#FFFFFF",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
boxShadow: "0 8px 24px rgba(20, 61, 78, 0.18)"
}}
>
  Accounts
</div>

## Endpoints

<div
  style={{
 
border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Available endpoints for managing accounts.
</div>

<div
  style={{
background: "linear-gradient(135deg, rgba(20, 61, 78, 0.04) 0%, rgba(28, 117, 138, 0.08) 100%)",
border: "1px solid #CDD1D3",
borderRadius: "18px",
padding: "8px 12px 2px 12px",
marginBottom: "22px",
boxShadow: "0 10px 30px rgba(20, 61, 78, 0.06)"
}}
>
  | Method   | Path                           | Description                  |
  | -------- | ------------------------------ | ---------------------------- |
  | `GET`    | `/api/accounts/`               | List accounts                |
  | `POST`   | `/api/accounts/`               | Create an account            |
  | `GET`    | `/api/accounts/{id}/`          | Get an account               |
  | `PATCH`  | `/api/accounts/{id}/`          | Update an account            |
  | `DELETE` | `/api/accounts/{id}/`          | Delete an account            |
  | `GET`    | `/api/accounts/{id}/contacts/` | List contacts for an account |
</div>

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "rgba(48, 200, 202, 0.12)",
color: "#1C758A",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
border: "1px solid rgba(48, 200, 202, 0.28)"
}}
>
  Accounts
</div>

## List Accounts

```http theme={null}
GET /api/accounts/
Authorization: Bearer <token>
```

<div
  style={{

border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Retrieve a paginated list of accounts with optional filters.
</div>

**Query Parameters:**

<div
  style={{
 border: "1px solid #CDD1D3",
borderRadius: "18px",
padding: "8px 12px 2px 12px",
marginBottom: "22px",
boxShadow: "0 10px 30px rgba(20, 61, 78, 0.05)"
}}
  className="dark:!bg-black dark:!border-gray-800 dark:shadow-none"
>
  | Parameter    | Type    | Description                       |
  | ------------ | ------- | --------------------------------- |
  | `page`       | integer | Page number                       |
  | `limit`      | integer | Results per page (max: 100)       |
  | `stage`      | string  | Filter by account stage           |
  | `industry`   | string  | Filter by industry                |
  | `assignedTo` | string  | Filter by assigned user ID        |
  | `search`     | string  | Search by company name or website |
</div>

**Response:**

```json theme={null}
{
  "count": 34,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "acc_01HX...",
      "name": "Acme Corp",
      "website": "https://acme.com",
      "industry": "Manufacturing",
      "companySize": "51-200",
      "stage": "customer",
      "assignedTo": "usr_01HX...",
      "contactCount": 5,
      "openOpportunityCount": 2,
      "createdAt": "2024-11-01T09:00:00Z",
      "updatedAt": "2025-03-18T16:45:00Z"
    }
  ]
}
```

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "linear-gradient(90deg, #143D4E 0%, #1C758A 100%)",
color: "#FFFFFF",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
boxShadow: "0 8px 24px rgba(20, 61, 78, 0.18)"
}}
>
  Creation
</div>

## Create an Account

```http theme={null}
POST /api/accounts/
Authorization: Bearer <token>
Content-Type: application/json
```

<div
  style={{

border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Create a new account record with company details and associations.
</div>

**Request body:**

```json theme={null}
{
  "name": "TechCorp Inc",
  "website": "https://techcorp.com",
  "industry": "Software",
  "companySize": "201-500",
  "annualRevenue": 15000000,
  "stage": "prospect",
  "phone": "+15551234567",
  "billingAddress": {
    "street": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "postalCode": "94107",
    "country": "US"
  },
  "assignedTo": "usr_01HX...",
  "tags": ["enterprise", "saas"],
  "description": "Enterprise SaaS company focused on data analytics"
}
```

**Required fields:** `name`

**Response:** `201 Created`

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "rgba(255, 111, 97, 0.12)",
color: "#FF6F61",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
border: "1px solid rgba(255, 111, 97, 0.24)"
}}
>
  Account Details
</div>

## Get an Account

```http theme={null}
GET /api/accounts/{id}/
Authorization: Bearer <token>
```

<div
  style={{

border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Retrieve full account details including metrics and relationships.
</div>

**Response:**

```json theme={null}
{
  "id": "acc_01HX...",
  "name": "TechCorp Inc",
  "website": "https://techcorp.com",
  "industry": "Software",
  "companySize": "201-500",
  "annualRevenue": 15000000,
  "stage": "prospect",
  "phone": "+15551234567",
  "billingAddress": {
    "street": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "postalCode": "94107",
    "country": "US"
  },
  "assignedTo": "usr_01HX...",
  "assignedToName": "Alex Johnson",
  "tags": ["enterprise", "saas"],
  "description": "Enterprise SaaS company focused on data analytics",
  "contactCount": 0,
  "openOpportunityCount": 0,
  "openCaseCount": 0,
  "createdAt": "2025-03-15T14:00:00Z",
  "updatedAt": "2025-03-15T14:00:00Z"
}
```

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "rgba(48, 200, 202, 0.12)",
color: "#1C758A",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
border: "1px solid rgba(48, 200, 202, 0.28)"
}}
>
  Updates
</div>

## Update an Account

```http theme={null}
PATCH /api/accounts/{id}/
Authorization: Bearer <token>
Content-Type: application/json
```

<div
  style={{

border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Update account fields such as stage, industry, or metadata.
</div>

**Example:**

```json theme={null}
{
  "stage": "active",
  "industry": "FinTech"
}
```

**Response:** `200 OK` with the updated account object.

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "linear-gradient(90deg, #143D4E 0%, #1C758A 100%)",
color: "#FFFFFF",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
boxShadow: "0 8px 24px rgba(20, 61, 78, 0.18)"
}}
>
  Deletion
</div>

## Delete an Account

```http theme={null}
DELETE /api/accounts/{id}/
Authorization: Bearer <token>
```

<div
  style={{

border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Permanently remove an account.
</div>

**Response:** `204 No Content`

<Warning>
  Deleting an account does not delete linked contacts, opportunities, or cases. Those records remain in the CRM but lose their account association. To fully clean up, delete the linked records first.
</Warning>

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "rgba(255, 111, 97, 0.12)",
color: "#FF6F61",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
border: "1px solid rgba(255, 111, 97, 0.24)"
}}
>
  Contacts
</div>

## List Contacts for an Account

```http theme={null}
GET /api/accounts/{id}/contacts/
Authorization: Bearer <token>
```

<div
  style={{

border: "1px solid rgba(48, 200, 202, 0.22)",
borderRadius: "16px",
padding: "16px 18px",
marginBottom: "20px",
color: "#2C768D",
boxShadow: "0 10px 26px rgba(28, 117, 138, 0.08)"
}}
  className="dark:!bg-[#0B0B0B] dark:!border-gray-800 dark:!text-cyan-300 dark:shadow-none"
>
  Returns all contacts linked to the specified account.
</div>

**Response:**

```json theme={null}
{
  "count": 3,
  "results": [
    {
      "id": "cnt_01HX...",
      "firstName": "John",
      "lastName": "Smith",
      "email": "john@techcorp.com",
      "title": "VP of Engineering",
      "stage": "customer"
    }
  ]
}
```

***

<div
  style={{ 
display: "inline-flex",
alignItems: "center",
gap: "8px",
background: "rgba(48, 200, 202, 0.12)",
color: "#1C758A",
fontSize: "12px",
fontWeight: "700",
marginBottom: "10px",
padding: "8px 14px",
letterSpacing: "0.08em",
textTransform: "uppercase",
borderRadius: "999px",
border: "1px solid rgba(48, 200, 202, 0.28)"
}}
>
  Stages
</div>

## Account Stage Values

<div
  style={{
 border: "1px solid #CDD1D3",
borderRadius: "18px",
padding: "8px 12px 2px 12px",
marginBottom: "22px",
boxShadow: "0 10px 30px rgba(20, 61, 78, 0.05)"
}}
  className="dark:!bg-black dark:!border-gray-800 dark:shadow-none"
>
  | Value      | Label    |
  | ---------- | -------- |
  | `prospect` | Prospect |
  | `active`   | Active   |
  | `customer` | Customer |
  | `partner`  | Partner  |
  | `churned`  | Churned  |
</div>
