---
title: "Get Policy Repo"
method: GET
path: "/v2/projects/{proj_id}/repos/{repo_id}"
tags: ["Policy Git Repositories"]
---

# Get Policy Repo

`GET /v2/projects/{proj_id}/repos/{repo_id}`

## Request

- Base URL: `https://api.permit.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.permit.io/v2/projects/{proj_id}/repos/{repo_id}`
- Auth: HTTP bearer

Gets a single repository matching the given repo_id, if such repository exists.

## Path parameters

- `proj_id` string, required: Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").
- `repo_id` string, required: Either the unique id of the policy repo, or the URL-friendly key of the policy repo (i.e: the "slug").

## Response `200`

Successful Response

- PolicyRepoRead
  - `id` string, uuid, required: Unique id of the policy repo
  - `status` 'invalid' | 'pending' | 'valid', required: An enumeration.
  - `key` string, required: A URL-friendly name of the policy repo (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the policy repo.
  - `url` string, required: The SSH URL of the git repository (e.g. git@github.com:username/repository.git)
  - `main_branch_name` string
  - `credentials` SSHAuthDataRead, required
    - `auth_type` 'ssh'
    - `username` string, required: SSH username
    - `public_key` string: SSH public key
    - `private_key` string, required: SSH private key
  - `activate_when_validated` boolean: if you want to change your policy repository to this repo right after it is validated

## Other responses

- `422`: Validation Error

## Changes

- **2025-09-16** `05b99f06db87`: 2 info
  - api tag `Policy Git Repositories` added
  - api tag `Policy Git Repositories (EAP)` removed

[Operation history](https://skmtc.dev/permit/apis/permit-io-api/changes/v2/projects/:proj_id/repos/:repo_id/get.md)

---

[API](https://skmtc.dev/permit/apis/permit-io-api.md) - [All operations](https://skmtc.dev/permit/apis/permit-io-api/llms.txt) - [OpenAPI document](https://skmtc.dev/permit/apis/permit-io-api/revisions/fa0edf4238b3?raw)
