# Rename, pause or resume a source

`PATCH https://evohub.io/api/v1/catalog/sources/{id}`

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

Renames a source, or pauses (`disabled`) and resumes (`active`) it. A
paused agent's reports are refused until it is resumed. `revoked`
cannot be set here: revoke the agent under **Organization → Agents**.
A revoked source answers 409 `SOURCE_REVOKED`.

Requires the `catalog:source: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

- `id` (string, required, example `src_4a6c8e0b2d4f6a8c1e3b5d7f9a2c4e6b`): The source's ID.

## Request body (required)

Content type: `application/json`

Type: `object`

- `name` (string, max length 128)
- `status` (string, one of `active`, `disabled`)

## Responses

### 200 — The source.

Content type: `application/json`

Type: `object`

- `data` (Source)
  - `id` (string)
  - `org_id` (string)
  - `kind` (string, one of `agent`, `cloud`)
  - `environment_id` (string | null)
  - `agent_id` (string | null)
  - `name` (string)
  - `status` (string, one of `active`, `disabled`, `revoked`)
  - `last_seen_at` (string (date-time) | null)
  - `agent_version` (string): What the agent last said it runs; empty for a cloud account.
  - `created_by` (string)
  - `created_at` (string (date-time))
  - `updated_at` (string (date-time))

### 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)

### 409 — The source is revoked (`SOURCE_REVOKED`).

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 PATCH 'https://evohub.io/api/v1/catalog/sources/src_4a6c8e0b2d4f6a8c1e3b5d7f9a2c4e6b' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "status": "disabled"
}'
```
