> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-reference/dap-cli-reference-snapshot.md).

# dap snapshot

Download complete snapshot of tables.

The `dap snapshot` command downloads full snapshots of datasets at a specific point in time. This is ideal for creating an initial full copy of the dataset or performing occasional full updates. Snapshots are useful for comprehensive analyses, audits, and backups.

{% hint style="warning" %}
Regular use of snapshots is not recommended, as they are resource-intensive for the API and costly to process on the client side.
{% endhint %}

### Usage

```
dap [arguments] snapshot [flags]
```

### Options

**`--namespace <string>`**\
Specifies the data source (namespace). Available options: {canvas, canvas\_logs, catalog, new\_quizzes}.

**`--table <string>`**\
Specifies the table(s) to fetch data from. Can be a single table name, a comma separated list of table names or the special `all` keyword to fetch all tables in the namespace.

**`--format <string> (default: JSONL)`**\
Defines the output format. Available options: {CSV, JSONL, Parquet, TSV}.

**`--output-directory <string>`**\
Specifies the absolute or relative path to the output directory where the snapshot will be stored.

### Global options

**`--client-id <string>`**\
Client ID obtained from the Identity Service. Skip, if `DAP_CLIENT_ID` environment variable is set.

**`--client-secret <string>`**\
Client Secret obtained from the Identity Service. Skip, if `DAP_CLIENT_SECRET` environment variable is set.

**`-h, --help`**\
Displays help information for the command.

### Output

Data files are written as gzipped files inside a `job_<uuid>/` subdirectory of the output directory. Nothing is printed to `stdout`.

```
downloads/job_9783c06d-00c1-431e-acec-9eee41c8ca1e/
  part-00000-a5f7a08d-4d2e-4674-910b-5557f8b56e5a-c000.json.gz
```

Each decompressed line (in JSONL format) is a JSON object with `key`, `value`, and `meta` fields:

```json
{"key":{"id":1358},"value":{"name":"Default Term","created_at":"2024-04-18T08:19:36.120Z","updated_at":"2024-04-18T08:19:36.120Z","workflow_state":"active"},"meta":{"ts":"2026-02-09T20:27:52.099Z"}}
```

* `meta.ts` is the CDC timestamp for the record (ISO 8601, UTC).
* In snapshot data, `meta.action` is absent (it only appears in incremental results for deletes).
* Files are always gzipped regardless of `--format`.
* Large tables may produce multiple `part-*` files.

### Error handling

| Scenario              | Exit code | Error output                                                                                                |
| --------------------- | --------- | ----------------------------------------------------------------------------------------------------------- |
| Invalid table name    | 5         | `ERROR - Operation snapshot failed. Reason: The table name '<name>' specified in the request is not valid.` |
| Invalid namespace     | 5         | `ERROR - The namespace '<name>' specified in the request is not valid.`                                     |
| Missing required flag | 2         | `Error: Missing option '--table'.`                                                                          |

### Examples

Get a snapshot of the `courses` table from the `canvas` namespace:\
`$ dap snapshot --namespace canvas --table courses`

Get a snapshot of multiple tables or all tables of the `canvas` namespace:\
`$ dap snapshot --namespace canvas --table courses,users,wikis`\
`$ dap snapshot --namespace canvas --table all`

Get a snapshot of the `web_logs` table from `canvas_logs` namespace in CSV format:\
`$ dap snapshot --namespace canvas_logs --table web_logs --format csv`

Get a snapshot to a specific directory for scripting:\
`$ dap --non-interactive --loglevel warning snapshot --namespace canvas --table accounts --output-directory ./data`

### Related Resources

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Key Concepts</strong></td><td>Get familiar with the key concepts in DAP.</td><td><a href="/services/dap/key-concepts.md">Key Concepts</a></td></tr><tr><td><strong>Rate Limits &#x26; Policies</strong></td><td>Learn more about the limits and our policies in DAP.</td><td><a href="/services/dap/limits-policies.md">Rate Limits &amp; Policies</a></td></tr><tr><td><strong>Datasets</strong></td><td>Discover the available namespaces and tables.</td><td><a href="/services/dap/dataset.md">Datasets</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-reference/dap-cli-reference-snapshot.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
