# Manage VisitReport events

A VisitReport **event** contains the questionnaire and settings used to capture visit reports. Use these requests to find an event by name, read its configuration, and check whether it’s available in the VisitReport app.

Use a [personal API token](/authentication/#personal-api-token) in the `x-api-key` header. Your account’s organization, role, and event access determine which events you can see. [VisitReport roles](https://portal.snapaddy.com/knowledge/what-do-the-user-roles-reporter-user-template-curator-template-manager-and-admin-mean)

To make existing CRM contacts available at an event, [upload an inventory data list](/visitreport/inventory-data/).

## Find events by name

This request looks for events whose names match **Spring Expo** and returns up to ten summaries. Remove `searchTerm` to list accessible events without a name filter.

```bash
curl --fail-with-body --get \
  'https://backend.snapaddy.com/questionnaire/v1/questionnaire-management/find-questionnaires' \
  -H "x-api-key: $SNAPADDY_API_KEY" \
  --data-urlencode 'searchTerm=Spring Expo' \
  --data-urlencode 'limit=10'
```

```typescript
const base = 'https://backend.snapaddy.com/questionnaire';
const url = new URL(base + '/v1/questionnaire-management/find-questionnaires');
url.search = new URLSearchParams({ searchTerm: 'Spring Expo', limit: '10' }).toString();
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error('Set SNAPADDY_API_KEY');
const response = await fetch(url, {
  headers: { 'x-api-key': apiKey },
});
if (!response.ok) throw new Error(`VisitReport request failed (${response.status})`);
console.log(await response.json());
```

```python
import json
import os
from urllib.parse import urlencode
from urllib.request import Request, urlopen

base = "https://backend.snapaddy.com/questionnaire"
query = urlencode({"searchTerm": "Spring Expo", "limit": 10})
request = Request(
    f"{base}/v1/questionnaire-management/find-questionnaires?{query}",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]},
)
with urlopen(request, timeout=20) as response:
    print(json.load(response))
```

The response uses `questionnaires` for the summaries and `total` for the total matching events. Event titles are keyed by language, and `defaultLanguage` tells you which title to use by default. This example shows selected fields.

```json
{
  "questionnaires": [
    {
      "id": "ExampleEvent0001",
      "titles": { "en": "Spring Expo" },
      "defaultLanguage": "en"
    }
  ],
  "total": 1
}
```

For subsequent pages, keep the same search, filters, and sort order. Advance `offset` by the number of summaries returned and stop when you reach `total` or receive an empty page. The default `limit` is 50 and the maximum is 1,000. The list defaults to most recently updated first.

Use `filterByStatus=FINALIZED` to find live events. Other filter values are `DRAFT`, `ARCHIVED`, and `MASTER`. `filterByTags` matches events containing every tag ID you provide.

## Get the event configuration

Take an `id` from the list and put it in the detail URL. The reference calls this path parameter `questionnaireId`.

```bash
curl --fail-with-body \
  'https://backend.snapaddy.com/questionnaire/v1/ExampleEvent0001' \
  -H "x-api-key: $SNAPADDY_API_KEY"
```

```typescript
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");

const response = await fetch("https://backend.snapaddy.com/questionnaire/v1/ExampleEvent0001", {
  headers: { "x-api-key": apiKey },
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
console.log(await response.json());
```

```python
import json
import os
from urllib.request import Request, urlopen

request = Request(
    "https://backend.snapaddy.com/questionnaire/v1/ExampleEvent0001",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]},
)
with urlopen(request, timeout=20) as response:
    print(json.load(response))
```

The response contains event settings and `questionGroups`, which describe the questionnaire. Use the reports API when you need submitted reports or their answers.

## Read the questionnaire structure

To turn a question and option into an answer, [prefill a questionnaire and hand the report to a colleague](/visitreport/questionnaires/).

Use `questionGroups` from the event response to inspect the questionnaire. Each group contains questions, and each question can contain `questionOptions`. Use [Get a question group or Get a question](/reference/visitreport-questionnaire/) when you already have that ID. To resolve an option, read its parent question and look up the option ID in `questionOptions`.

## Check event status and availability

Use the same event ID in the status URL.

```bash
curl --fail-with-body \
  'https://backend.snapaddy.com/questionnaire/event/v1/ExampleEvent0001/status' \
  -H "x-api-key: $SNAPADDY_API_KEY"
```

```typescript
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");

const response = await fetch("https://backend.snapaddy.com/questionnaire/event/v1/ExampleEvent0001/status", {
  headers: { "x-api-key": apiKey },
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
console.log(await response.json());
```

```python
import json
import os
from urllib.request import Request, urlopen

request = Request(
    "https://backend.snapaddy.com/questionnaire/event/v1/ExampleEvent0001/status",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]},
)
with urlopen(request, timeout=20) as response:
    print(json.load(response))
```

`eventState` is `DRAFT` for an event in preparation, `LIVE` for a published event, `ARCHIVED` for an event removed from the app’s event list, or `MASTER` for a reusable template.

When `lifespanActive` is true, use `lifespanStart` and `lifespanEnd` when checking availability. These fields contain Unix timestamps in milliseconds or `null`. A live event can be outside its availability window.

```json
{
  "eventState": "LIVE",
  "lifespanActive": false,
  "lifespanStart": null,
  "lifespanEnd": null
}
```

The detail request accepts app or dashboard access. The status request requires app access. If status returns `403` for an event you can read in the dashboard, check the event’s app visibility settings. [Event statuses](https://portal.snapaddy.com/knowledge/status-of-a-template-draft-/-final) · [Restrict event access](https://portal.snapaddy.com/knowledge/how-to-restrict-the-template-visibility-to-defined-users-and-or-guests)

## Duplicate a master event into a draft

To reuse an existing questionnaire for a new event, call **Find events** with `filterByStatus=MASTER`. Use the master event’s `id` as `questionnaireId` in the duplicate request. Use a VisitReport role that can duplicate the source event in the dashboard. [Master events in VisitReport](https://portal.snapaddy.com/knowledge/how-can-i-create-a-master-template)

Set `createMaster` to `false` to create a draft. Supply the titles for the languages you want to use. If you omit `titles`, the API generates copy titles from the source.

See the [API reference](/reference/visitreport-events/) for the full request schema.

```bash
curl --fail-with-body \
  'https://backend.snapaddy.com/questionnaire/v1/ExampleMaster001/duplicate' \
  -H "x-api-key: $SNAPADDY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"titles":{"en":"Spring Expo 2027"},"createMaster":false}'
```

```typescript
const apiKey = process.env.SNAPADDY_API_KEY;
if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");

const payload = {
  titles: {
    en: "Spring Expo 2027"
  },
  createMaster: false
};
const response = await fetch("https://backend.snapaddy.com/questionnaire/v1/ExampleMaster001/duplicate", {
  method: "POST",
  headers: { "x-api-key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify(payload),
});
if (!response.ok) throw new Error(`Request failed (${response.status})`);
console.log(await response.json());
```

```python
import json
import os
from urllib.request import Request, urlopen

payload = {
    "titles": {
        "en": "Spring Expo 2027"
    },
    "createMaster": False
}
request = Request(
    "https://backend.snapaddy.com/questionnaire/v1/ExampleMaster001/duplicate",
    method="POST",
    headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"},
    data=json.dumps(payload).encode(),
)
with urlopen(request, timeout=20) as response:
    print(json.load(response))
```

A successful duplication returns `201 Created` with the new event ID in `questionnaireId`.

```json
{
  "success": true,
  "questionnaireId": "ExampleDraft0001"
}
```

Use **Get an event** with the new ID to review its questionnaire and settings before taking it live. Existing reports stay with the source event. If the request times out, look for the new draft before retrying. Each successful duplicate request can create another event. [Duplicate an event](https://portal.snapaddy.com/knowledge/how-to-archive-duplicate-or-delete-a-template)

[Open the VisitReport Events API reference](/reference/visitreport-events/) for the full parameter and response schemas.
