---
title: "Get custom agents for an enterprise"
method: GET
path: "/enterprises/{enterprise}/copilot/custom-agents"
tags: ["copilot"]
---

# Get custom agents for an enterprise

`GET /enterprises/{enterprise}/copilot/custom-agents`

Gets the list of all custom agents defined in the /agents/*.md files in the .github-private repository for the enterprise.

If no source repository has been configured, returns `null` for `custom_agents`.

Enterprise owners with read access to AI Controls can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.

## Path parameters

- `enterprise` string, required

## Query parameters

- `per_page` integer
- `page` integer

## Response `200`

Success

- object
  - `custom_agents` object[], nullable — List of custom agents defined in the repository. Returns `null` if no source repository is configured.
    - `name` string — The display name of the custom agent (derived from filename).
    - `file_path` string — The path to the agent definition file.
    - `url` string — The URL to view the agent definition file.

## Other responses

- `401` — Requires authentication
- `403` — Forbidden
- `404` — Not found or source repository not found
- `500` — Internal Error

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
