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

# OCF export and import API

> Export your full cap table as an Open Cap Format ZIP bundle, or import an OCF bundle to migrate from another platform or restore cap table data.

[Open Cap Format (OCF)](https://www.opencaptablecoalition.com/) is an open standard for representing cap table data in a portable, machine-readable format. OCF bundles are JSON files organized into a well-defined manifest structure — one file per entity type — making them compatible with any OCF-aware platform, legal tool, or cap table auditor.

Launchboard supports both directions: you can export your entire cap table as a compliant OCF ZIP, and you can import an OCF bundle to seed or migrate data from another platform.

***

## Export the cap table as OCF

Downloads a ZIP archive containing OCF-compliant JSON files for every entity type in your organization. The archive is generated fresh on each request from live ledger data.

**`GET /api/v1/cap-table/ocf-export`**

Requires role: **VIEWER**. Returns `Content-Type: application/zip`.

### Query parameters

| Param     | Type   | Description                                                                           |
| --------- | ------ | ------------------------------------------------------------------------------------- |
| `include` | string | Comma-separated list of OCF file type keys to include. Omit to export all file types. |

When you omit `include`, the export contains all ten file types:

| Key             | Content                        |
| --------------- | ------------------------------ |
| `issuer`        | Organization / issuer metadata |
| `stakeholders`  | All stakeholder records        |
| `stock_classes` | Share class definitions        |
| `stock_plans`   | Equity plan records            |
| `transactions`  | Full transaction log           |
| `valuations`    | Valuation records              |
| `vesting_terms` | Vesting schedule definitions   |
| `stock_legends` | Stock legend text              |
| `documents`     | Document references            |
| `ocf_manifest`  | Top-level manifest file        |

<CodeGroup>
  ```bash Full export theme={null}
  curl -o my-captable-ocf-export.zip \
    "https://launchboard.xyz/api/v1/cap-table/ocf-export" \
    -H "Authorization: Bearer pg_live_your_key"
  ```

  ```bash Partial export (stakeholders + transactions only) theme={null}
  curl -o partial-export.zip \
    "https://launchboard.xyz/api/v1/cap-table/ocf-export?include=stakeholders,transactions" \
    -H "Authorization: Bearer pg_live_your_key"
  ```
</CodeGroup>

**Response — `200 OK`**

The response body is a binary ZIP stream. The `Content-Disposition` header provides a filename in the format `{org-name}-ocf-export-{date}.zip`:

```
Content-Type: application/zip
Content-Disposition: attachment; filename="acme-corp-ocf-export-2024-03-15.zip"
Cache-Control: no-store
```

The ZIP contains one JSON file per included entity type, structured according to the [OCF specification](https://www.opencaptablecoalition.com/).

<Note>
  The export includes all stakeholders, share classes, securities, equity plans, vesting terms, valuations, and the full transaction log. Large cap tables may take a few seconds to generate. Cache the downloaded file if you need to inspect it repeatedly rather than re-requesting it.
</Note>

***

## Import an OCF bundle

Imports stakeholders, stock classes, and issuances from an OCF manifest and entity files. This is the recommended migration path when moving from another cap table platform.

**`POST /api/v1/cap-table/ocf-import`**

Requires role: **ADMIN**. Idempotent — entities whose IDs already exist in Launchboard are skipped and reported in the `conflicts` array rather than causing the import to fail.

<ParamField body="manifest" type="object" required>
  The parsed OCF manifest object (the contents of the `ocf_manifest.json` file in the export ZIP).
</ParamField>

<ParamField body="entityFiles" type="object" required>
  A map of filename → parsed JSON content for each OCF entity file you want to import. Keys are the OCF filenames (e.g. `"stakeholders.json"`, `"stock_classes.json"`, `"transactions.json"`).
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://launchboard.xyz/api/v1/cap-table/ocf-import \
    -H "Authorization: Bearer pg_live_your_key" \
    -H "Content-Type: application/json" \
    -d '{
      "manifest": {
        "ocf_version": "1.0.0",
        "issuer": { "id": "issuer-001", "legal_name": "Acme Corp" },
        "as_of": "2024-03-15T00:00:00.000Z",
        "generated_at": "2024-03-15T12:00:00.000Z",
        "comments": []
      },
      "entityFiles": {
        "stakeholders.json": {
          "items": [
            {
              "id": "stakeholder-001",
              "object_type": "STAKEHOLDER",
              "name": { "legal_name": "Alice Chen" },
              "stakeholder_type": "INDIVIDUAL",
              "current_relationship": "FOUNDER"
            }
          ]
        },
        "stock_classes.json": {
          "items": [
            {
              "id": "stock-class-001",
              "object_type": "STOCK_CLASS",
              "name": "Common Stock",
              "class_type": "COMMON",
              "default_id_prefix": "CS",
              "initial_shares_authorized": "10000000",
              "votes_per_share": "1"
            }
          ]
        }
      }
    }'
  ```
</CodeGroup>

**Response — `200 OK`**

```json theme={null}
{
  "data": {
    "imported": {
      "stakeholders": 1,
      "stockClasses": 1,
      "issuances": 0
    },
    "conflicts": []
  }
}
```

<ResponseField name="data.imported" type="object">
  Counts of successfully imported entities.
</ResponseField>

<ResponseField name="data.imported.stakeholders" type="integer">
  Number of stakeholder records created.
</ResponseField>

<ResponseField name="data.imported.stockClasses" type="integer">
  Number of share classes created.
</ResponseField>

<ResponseField name="data.imported.issuances" type="integer">
  Number of security issuances created.
</ResponseField>

<ResponseField name="data.conflicts" type="array">
  Entities that were skipped because a record with the same ID already exists. The import does not fail on conflicts.
</ResponseField>

<ResponseField name="data.conflicts[].entityType" type="string">
  Type of the conflicting entity (e.g. `"stakeholder"`, `"stock_class"`).
</ResponseField>

<ResponseField name="data.conflicts[].id" type="string">
  ID of the conflicting entity.
</ResponseField>

<ResponseField name="data.conflicts[].reason" type="string">
  Human-readable description of why the entity was skipped.
</ResponseField>

<Warning>
  OCF import requires **ADMIN** role. The import will partially succeed — entities processed before a validation error are committed, and the conflict list tells you what was skipped. Re-run the import after resolving conflicts; already-imported entities are safely skipped.
</Warning>

***

## Typical migration workflow

<Steps>
  <Step title="Export from your current platform">
    Download an OCF export from your existing cap table software.
  </Step>

  <Step title="Validate the bundle">
    Use an OCF-compatible validator (or inspect the manifest manually) to confirm the bundle is well-formed.
  </Step>

  <Step title="Import into Launchboard">
    Parse each OCF JSON file and POST the `manifest` and `entityFiles` to this endpoint.
  </Step>

  <Step title="Review conflicts">
    Check the `conflicts` array. Any skipped entity can be re-imported after resolving the conflict, or created manually via the individual resource endpoints.
  </Step>

  <Step title="Verify the summary">
    Call `GET /api/v1/cap-table/summary` and compare `totalIssued` and `stakeholderCount` against your source platform to confirm the import is complete.
  </Step>
</Steps>

***

## Error codes

| Status | When it occurs                                                                                                            |
| ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `401`  | Missing or invalid API key.                                                                                               |
| `403`  | Key role is below `ADMIN`.                                                                                                |
| `422`  | Request body failed schema validation — the manifest or entity files are malformed. Check the `errors` field for details. |
| `500`  | An unexpected server error occurred during export or import generation.                                                   |
