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

# Repos API: list Detail repositories and user account info

> List repositories connected to Detail and retrieve the authenticated user's account information, including organization memberships.

The repos and user endpoints give you the reference data you need to work with the rest of the API. Use the repos endpoint to discover `repo_id` values, which are required parameters for the bugs, scans, and rules endpoints. Use the user endpoint to verify your API key and inspect your organization memberships.

***

## GET /public/v1/repos

Returns a paginated list of repositories connected to Detail that the authenticated user can access.

```bash theme={null}
curl "https://api.detail.dev/public/v1/repos" \
  -H "Authorization: Bearer dtl_live_YOUR_KEY"
```

### Query parameters

<ParamField query="limit" type="integer">
  Number of results to return. Between `1` and `100`. Defaults to `50`.
</ParamField>

<ParamField query="offset" type="integer">
  Number of results to skip for pagination. Defaults to `0`.
</ParamField>

### Response

<ResponseField name="repos" type="Repo[]">
  Array of repository objects accessible to the authenticated user.

  <Expandable title="Repo fields">
    <ResponseField name="id" type="string">
      Unique repository identifier, prefixed with `repo_`. Use this as the `repo_id` parameter in other endpoints.
    </ResponseField>

    <ResponseField name="name" type="string">
      Short repository name (without the owner prefix). Example: `my-repo`.
    </ResponseField>

    <ResponseField name="ownerName" type="string">
      GitHub user or organization that owns the repository. Example: `myorg`.
    </ResponseField>

    <ResponseField name="fullName" type="string">
      Fully qualified repository name in `owner/repo` format. Example: `myorg/my-repo`.
    </ResponseField>

    <ResponseField name="visibility" type="string">
      Whether the repository is `public` or `private` on GitHub.
    </ResponseField>

    <ResponseField name="primaryBranch" type="string">
      The default branch Detail scans. Example: `main`.
    </ResponseField>

    <ResponseField name="orgId" type="string">
      ID of the Detail organization that owns this repository connection, prefixed with `org_`.
    </ResponseField>

    <ResponseField name="orgName" type="string">
      Name of the Detail organization that owns this repository connection.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of repositories accessible to the user, regardless of `limit` and `offset`.
</ResponseField>

### Example response

```json theme={null}
{
  "repos": [
    {
      "id": "repo_abc123",
      "name": "my-repo",
      "ownerName": "myorg",
      "fullName": "myorg/my-repo",
      "visibility": "private",
      "primaryBranch": "main",
      "orgId": "org_xyz789",
      "orgName": "My Organization"
    },
    {
      "id": "repo_def456",
      "name": "api-service",
      "ownerName": "myorg",
      "fullName": "myorg/api-service",
      "visibility": "private",
      "primaryBranch": "main",
      "orgId": "org_xyz789",
      "orgName": "My Organization"
    }
  ],
  "total": 2
}
```

<Tip>
  If you already know the `owner/repo` slug for a repository, fetch the full list and filter by `fullName` client-side to find its `repo_id`. Alternatively, look up the repo ID in **Settings → Repositories** in the Detail dashboard.
</Tip>

***

## GET /public/v1/user

Returns the authenticated user's email address and their Detail organization memberships. This is a useful endpoint to verify that your API key is valid and to inspect which organizations you have access to.

```bash theme={null}
curl https://api.detail.dev/public/v1/user \
  -H "Authorization: Bearer dtl_live_YOUR_KEY"
```

### Response

<ResponseField name="email" type="string">
  The email address associated with the authenticated account.
</ResponseField>

<ResponseField name="orgs" type="Org[]">
  The Detail organizations this user belongs to.

  <Expandable title="Org fields">
    <ResponseField name="id" type="string">
      Unique organization identifier, prefixed with `org_`.
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name of the organization.
    </ResponseField>
  </Expandable>
</ResponseField>

### Example response

```json theme={null}
{
  "email": "user@example.com",
  "orgs": [
    {
      "id": "org_xyz789",
      "name": "My Organization"
    }
  ]
}
```
