---
title: "Create an agent"
method: POST
path: "/api/v4/projects/{id}/cluster_agents"
tags: ["cluster_agents"]
---

# Create an agent

`POST /api/v4/projects/{id}/cluster_agents`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/cluster_agents`
- Auth: none declared

Creates an agent for the project. You must have the Maintainer or Owner role to use this endpoint.

## Path parameters

- `id` string, required

## Request body

- PostApiV4ProjectsIdClusterAgents: Create an agent
  - `name` string, required: The name of the agent

## Response `201`

Create an agent

- APIEntitiesClustersAgent: API_Entities_Clusters_Agent model
  - `id` integer, required
  - `name` string, required
  - `config_project` APIEntitiesProjectIdentity, required
    - `id` integer, required
    - `description` string, required
    - `name` string, required
    - `name_with_namespace` string, required
    - `path` string, required
    - `path_with_namespace` string, required
    - `created_at` string, date-time, required
  - `created_at` string, date-time, required
  - `created_by_user_id` integer, required
  - `is_receptive` boolean, required

---

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