---
title: "Generate a new Test Distribution pool-specific agent registration key."
method: POST
path: "/api/test-distribution/agent-pools/{poolId}/registration-keys"
tags: ["TestDistribution", "GradleEnterprise", "Develocity"]
---

# Generate a new Test Distribution pool-specific agent registration key.

`POST /api/test-distribution/agent-pools/{poolId}/registration-keys`

## Request

- Base URL: `https://develocity.example.com`
- URL: `https://develocity.example.com/api/test-distribution/agent-pools/{poolId}/registration-keys`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/develocity/apis/develocity-api/docs/api/test-distribution/agent-pools/:poolId/registration-keys/post.ts> (a function with typed inputs; its response is checked against the schema)

Generate a new Test Distribution pool-specific agent registration key to connect agents and query the agent pool API.

## Request body

- TestDistributionAgentPoolRegistrationKeyDescription: Optional description of a Test Distribution pool-specific agent registration key.
  - `description` string: Description of the registration key to help identify it later.

## Response `200`

A new registration key was successfully generated and contained in the response.

- TestDistributionAgentPoolRegistrationKey: A Test Distribution pool-specific agent registration key.
  - `key` string, required: The agent API key.
  - `description` string: Description of the registration key to help identify it later.

## Other responses

- `403`: The authenticated user has insufficient permissions.
- `404`: No API key was specified in the request, the key has been revoked, or the user bearing the key lacks permissions for this operation.

---

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