# Set a service's RACI

`PUT https://evohub.io/api/v1/catalog/components/{ref}/responsibilities`

Part of the [Catalog API](https://docs.evohub.io/catalog.md) reference · operationId `setComponentResponsibilities`.

Replaces the service's RACI as a whole; an empty list clears it. Each
entry is a role (`responsible`, `accountable`, `consulted`,
`informed`) and exactly one of `team_id` or `user_id`. At most 50
entries, none twice, and exactly one `accountable` when there are
any. The owner team stays the owner.

Requires the `catalog:component:write` scope.

## Authorization

Any one of:

- `bearerKey`
- `headerKey`

Where:

- `bearerKey`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `headerKey`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Path parameters

- `ref` (string, required, example `payments-api`): The service's ID (`cmp_…`) or its slug.

## Request body (required)

Content type: `application/json`

Type: `object`

- `responsibilities` (array of Responsibility, required, max items 50)
  - `role` (string, required, one of `responsible`, `accountable`, `consulted`, `informed`)
  - `team_id` (string | null)
  - `user_id` (string | null)

## Responses

### 200 — The RACI as stored.

Content type: `application/json`

Type: `object`

- `data` (array of Responsibility)
  - `role` (string, required, one of `responsible`, `accountable`, `consulted`, `informed`)
  - `team_id` (string | null)
  - `user_id` (string | null)

### 400 — The request is not valid: a field or filter value is wrong (`VALIDATION_ERROR`, with a sentence saying what), the body is not the expected JSON or carries an unknown field (`INVALID_BODY`), the cursor is not one this list gave (`INVALID_CURSOR`), a binding names a service that does not exist (`UNKNOWN_COMPONENT`), or a `PATCH` tries to change a slug (`SLUG_IMMUTABLE`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 403 — The key lacks a scope this endpoint needs (`FORBIDDEN`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 404 — Nothing with this ID (or slug) exists in the organization (`NOT_FOUND`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 429 — Too many requests (`RATE_LIMITED`). Wait for `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

## Example request

```bash
curl -X PUT 'https://evohub.io/api/v1/catalog/components/payments-api/responsibilities' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "responsibilities": [
    {
      "role": "accountable",
      "team_id": "team_3b6f0e2a-1c4d-4e8f-9a7b-2d5c6e8f0a1b"
    },
    {
      "role": "consulted",
      "user_id": "usr_9f2d4c6b-8a1e-4f3d-b5c7-0e2a4c6e8b1d"
    }
  ]
}'
```
