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

# Own Workforce

> Manage own workforce records for Scope 3 Category 1 calculations

<Note>
  **Early Access** - The Dcycle CLI is currently available for enterprise customers.
  [Contact us](/docs/support) to learn more about access.
</Note>

## Overview

Own workforce records represent on-site workers (employees, contractors) used in Scope 3 Category 1 calculations. Each record tracks employment category, location, and contract period.

### Available Commands

| Command                                | Description                     |
| -------------------------------------- | ------------------------------- |
| `dcy own-workforce list`               | List own workforce records      |
| `dcy own-workforce delete <id>`        | Delete an own workforce record  |
| `dcy own-workforce delete-bulk <file>` | Bulk delete records from a file |

***

## List Records

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy own-workforce list
```

Output:

```
Showing 4 of 120 own workforce records in Acme Corp
550e8400-... | EMP-001 | full-time  | ES-MAD | 2024-01-01 -> active
661f9511-... | EMP-002 | part-time  | ES-BCN | 2024-03-15 -> active
772a0622-... | CTR-010 | contractor | ES-MAD | 2024-06-01 -> 2024-12-31
883b1733-... | EMP-003 | full-time  | PT-LIS | 2024-01-01 -> active
```

### Flags

| Flag            | Short | Default | Description                    |
| --------------- | ----- | ------- | ------------------------------ |
| `--external-id` | `-e`  | —       | Filter by external employee ID |
| `--page`        | —     | `1`     | Page number                    |
| `--size`        | —     | `50`    | Page size                      |
| `--org`         | —     | —       | Organization ID override       |

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Short alias
dcy own-workforce ls

# Filter by external employee ID
dcy own-workforce list --external-id EMP-001

# Large page
dcy own-workforce list --size 500

# JSON output
dcy own-workforce list --format json | jq '.[] | {id, external_employee_id, employment_category}'
```

***

## Delete Record

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy own-workforce delete <record-id>
```

Output:

```
Delete own workforce record EMP-001 (550e8400-...)? (y/N)
own workforce record deleted successfully: EMP-001
```

### Flags

| Flag    | Short | Default | Description              |
| ------- | ----- | ------- | ------------------------ |
| `--yes` | `-y`  | `false` | Skip confirmation prompt |
| `--org` | —     | —       | Organization ID override |

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Skip confirmation
dcy own-workforce delete <record-id> --yes

# Short alias
dcy own-workforce rm <record-id> --yes
```

***

## Bulk Delete

Delete multiple records by providing a text file with one ID per line:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy own-workforce delete-bulk ids.txt --yes
```

Output:

```
deleted: 3
```

If some deletions fail:

```
2 failed: record not found
deleted: 1
failed: 2
```

### Flags

| Flag    | Short | Default | Description              |
| ------- | ----- | ------- | ------------------------ |
| `--yes` | `-y`  | `false` | Skip confirmation prompt |
| `--org` | —     | —       | Organization ID override |

The file should contain one own-workforce record UUID per line. Blank lines and duplicates are automatically skipped:

```text title="ids.txt" theme={"theme":{"light":"github-light","dark":"github-dark"}}
f1a2b3c4-d5e6-7890-abcd-ef1234567890
a1b2c3d4-e5f6-7890-abcd-ef1234567890
b9c0d1e2-f3a4-5678-bcde-f12345678901
```

<Tip>
  Extract IDs from a list command: `dcy own-workforce list --format json | jq -r '.[].id' > ids.txt`
</Tip>

***

## Typical Workflows

### Clean Up Own Workforce Data

Remove outdated or duplicate records:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Export all records and review
dcy own-workforce list --size 1000 --format json > workforce.json

# Extract IDs of expired contracts
jq -r '.[] | select(.contract_end_date != "" and .contract_end_date < "2024-01-01") | .id' \
  workforce.json > expired-ids.txt

# Preview count
wc -l expired-ids.txt

# Bulk delete
dcy own-workforce delete-bulk expired-ids.txt --yes
```

***

## Aliases

| Command                    | Alias                  |
| -------------------------- | ---------------------- |
| `dcy own-workforce list`   | `dcy own-workforce ls` |
| `dcy own-workforce delete` | `dcy own-workforce rm` |

## Next Steps

<CardGroup cols={2}>
  <Card title="Employees" icon="users" href="/cli/employees">
    Track employee commuting data for Scope 3 emissions
  </Card>

  <Card title="Sold Products" icon="box" href="/cli/sold-products">
    Bulk-manage sold product records
  </Card>

  <Card title="Data Imports" icon="upload" href="/cli/imports">
    Bulk import CSV/Excel data with guided mapping
  </Card>

  <Card title="Custom Emission Factors" icon="sliders" href="/cli/custom-ef">
    Upload organization-specific emission factors
  </Card>
</CardGroup>
