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

# Profile data export

> Export a single profile's full record to an Excel workbook with selectable sections like programs, tasks, scores, and files.

Profile data export gives admins and sub-admins a one-click way to download
everything Campground knows about a single contact as an Excel (`.xlsx`)
workbook. Use it to hand off a candidate dossier, archive a member's record
before deletion, or pull data into spreadsheets and BI tools.

Each export is recorded as a `profile.export` activity on the target profile so
you have an audit trail of who exported what, and which sections they included.

## When to use it

Reach for a profile export when you need:

* A portable record of one person's roles, programs, tasks, comments, scores,
  and files.
* A dossier to share with a hiring committee or program lead who doesn't have
  dashboard access.
* A backup of a profile's data before you archive or delete the contact.
* A spreadsheet you can pivot, filter, or import into another system.

For bulk exports across many profiles, use the Applications table export
instead — profile export is scoped to one contact at a time.

## Who can export

You need admin or sub-admin access to export profile data:

* **Admins** can export any profile in the organization.
* **Sub-admins** can export profiles that fall inside their assigned scope.
  Profiles outside scope return a permission error.

The contact themself cannot export their own profile from this menu.

## Export a profile

1. Open the profile page for the contact you want to export.
2. Select **Actions** in the profile header, then **Export**.
3. In the **Export profile data** modal, choose which sections to include.
   Basic info (name and email) is always included.
4. Select **Export**. The workbook downloads as soon as it's ready, and the
   modal stays open until the download completes.

If you don't pick at least one optional section, the **Export** button stays
disabled.

## Sections you can include

The modal lets you toggle each section independently. Sections appear in the
workbook in the order below.

| Section          | What it contains                                                      |
| ---------------- | --------------------------------------------------------------------- |
| Profile details  | Roles, groups, teams, custom fields, joined date, and last active.    |
| Programs & forms | Program enrollments, application workflows, and form field answers.   |
| Tasks            | Task assignments and task comments.                                   |
| Comments         | Admin comments left on this profile.                                  |
| Relationships    | Linked entities defined by relationships.                             |
| Connections      | Profile-to-profile connections.                                       |
| Scores           | Scoring data and factors.                                             |
| Bookmarks        | Saved jobs and bookmarks.                                             |
| Event activity   | Event views, RSVPs (including cancels), and event redirect visits.    |
| Files            | Links to documents, images, and other files attached to this profile. |

Datetime columns include `(UTC)` in the header and are written as Excel date
cells in UTC (for example `Event start (UTC)` and `User action occurred at (UTC)`
on the Event activity sheet, shown next to each other for easy comparison).
Event activity Interaction values match the activity-log labels (`Event View`,
`Event RSVP`, `Event Redirect Visit`). The sheet is a historical log of what
the contact did; it does not report whether the event was later deleted. If an
event title can no longer be loaded, the title cell shows
`Not visible to exporter`. Joining via a trackable link does not require an
RSVP, and the join button is not gated on event start time.

Use **Select all** and **Clear all** in the modal footer to toggle every
section at once.

## Audit trail

Every export writes a `profile.export` activity to the target profile's
activity feed. The activity records:

* The admin or sub-admin who triggered the export.
* The workbook format (`xlsx`).
* The list of sections included in the download.

Audit entries appear in the profile's activity tab and are visible to anyone
who can view that profile's activity.

## Programmatic export

The profile page modal calls the `GET /api/export-profile` endpoint. You can
call it directly from a server-side script or scheduled job that already has
a Campground admin session.

### Request

```http theme={null}
GET /api/export-profile?profileId=<uuid>&groups=<comma-separated-ids>
```

### Query parameters

| Parameter   | Required | Description                                                                                                      |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `profileId` | Yes      | UUID of the profile to export. Invalid UUIDs return `400`.                                                       |
| `groups`    | No       | Comma-separated list of section ids to include. Omit to export every section. Empty or unknown ids return `400`. |

Valid section ids: `profile-details`, `programs-forms`, `tasks`, `comments`,
`relationships`, `connections`, `bookmarks`, `event-activity`, `files`.

### Response

A `200` response streams the workbook as
`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` with a
`Content-Disposition: attachment` header. Errors return JSON:

* `400` — missing or invalid `profileId`, or an unknown section id.
* `401` — caller isn't an admin or sub-admin, or the target profile is outside
  a sub-admin's scope.
* `404` — non-`GET` method.

### Example

```bash theme={null}
curl -L \
  -H "Cookie: <your-session-cookie>" \
  -o "candidate-dossier.xlsx" \
  "https://app.campground.fyi/api/export-profile?profileId=8f1c2c0e-1f24-4a5f-9d3a-7a2c2bb9d4f1&groups=profile-details,programs-forms,scores"
```

The example above downloads a workbook with only the **Profile details**,
**Programs & forms**, and **Scores** sheets for the given profile.
