---
title: "Create or reuse an immutable repository snapshot"
method: POST
path: "/v1/repositories/{repository_id}/snapshots"
tags: ["Repository Intelligence"]
---

# Create or reuse an immutable repository snapshot

`POST /v1/repositories/{repository_id}/snapshots`

## Request

- Base URL: `https://api.algenta.ai`
- URL: `https://api.algenta.ai/v1/repositories/{repository_id}/snapshots`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Path parameters

- `repository_id` string, uuid, required

## Request body

- RepositorySnapshotCreateRequest
  - `ref` string, nullable
  - `focus_paths` string[]
  - `prefer_concrete_focus_paths` boolean
  - `include_patterns` string[]
  - `exclude_patterns` string[]
  - `max_files` integer
  - `max_file_size_bytes` integer
  - `max_total_bytes` integer, nullable

## Response `200`

Successful Response

- RepositorySnapshotResponse
  - `repository_id` string, required
  - `snapshot_id` string, required
  - `connector_type` string, required
  - `ref` string, nullable
  - `resolved_revision` string, required
  - `content_hash` string, required
  - `status` 'created' | 'existing', required
  - `created_at` string, date-time, required
  - `file_count` integer, required
  - `requested_focus_paths` string[]
  - `effective_focus_paths` string[]
  - `language_counts` object, required
  - `raw_repo_token_estimate` integer, required
  - `repository_snapshot_artifact` RepositoryArtifactRef, required
    - `artifact_id` string, required
    - `artifact_kind` string, required
    - `content_hash` string, required
    - `storage_path` string, required
    - `schema_revision` string, nullable
    - `created_at` string, date-time, required
  - `repository_graph_artifact` RepositoryArtifactRef, required
    - `artifact_id` string, required
    - `artifact_kind` string, required
    - `content_hash` string, required
    - `storage_path` string, required
    - `schema_revision` string, nullable
    - `created_at` string, date-time, required
  - `symbol_graph_artifact` RepositoryArtifactRef, required
    - `artifact_id` string, required
    - `artifact_kind` string, required
    - `content_hash` string, required
    - `storage_path` string, required
    - `schema_revision` string, nullable
    - `created_at` string, date-time, required
  - `dependency_graph_artifact` RepositoryArtifactRef, required
    - `artifact_id` string, required
    - `artifact_kind` string, required
    - `content_hash` string, required
    - `storage_path` string, required
    - `schema_revision` string, nullable
    - `created_at` string, date-time, required
  - `symbol_reference_artifact` RepositoryArtifactRef
    - `artifact_id` string, required
    - `artifact_kind` string, required
    - `content_hash` string, required
    - `storage_path` string, required
    - `schema_revision` string, nullable
    - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/codna/apis/algenta-api.md) · [All operations](https://skmtc.dev/codna/apis/algenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codna/apis/algenta-api/revisions/35d30f84a5df?raw)
