---
type: api
title: Set runner roles
description: Set runner roles.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-set-runner-roles
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-set-runner-roles
products:
  - Elastic Cloud Enterprise
---

# Set runner roles

## Paths

- `PUT` `/platform/infrastructure/runners/{runner_id}/roles`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#apikey)

#### Path Parameters

- `runner_id` (string)
  The identifier for the runner

## Description

Set runner roles.

## Query String Parameters

- `bless` (boolean)
  Assigns the runner to the roles.

## Request Body

`application/json`

The roles for the runner that you want to apply.

- `roles` ([] RunnerRoleInfo) — required
  List of roles
  - `role_name` (string) — required
    Name of the role

## Responses

#### `200`

The roles for the {runner_id} specified runner are assigned.

`application/json`

- `roles` ([] RunnerRoleInfo)
  List of roles
  - `role_name` (string)
    Name of the role
#### `400`

There was an error while assigning the roles for the {runner_id} specified runner. Try your request again. (code: `runners.runner_set_roles_failed`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `404`

Unable to find the {runner_id} specified runner. Edit your request, then try again. (code: `runners.runner_not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
PUT /platform/infrastructure/runners/{runner_id}/roles
```

#### curl

```curl
curl -X PUT "/platform/infrastructure/runners/{runner_id}/roles"
```

