# Get a resource

`GET https://evohub.io/api/v1/catalog/resources/{id}`

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

One resource with its current `state` (the redacted document its
source sent), its `connections` to other resources, its
`application` and, for a workload, its latest `live` report. For a
key that also holds `catalog:component:read`, `proposals` lists the
match proposals waiting on it.

Requires the `catalog:resource:read` 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 `res_6b8d0f2a4c6e8a1c3e5b7d9f1a3c5e7b`): The resource's ID.

## Responses

### 200 — The resource.

Content type: `application/json`

Type: `object`

- `data` (ResourceDetail)
  - `id` (string, example `res_6b8d0f2a4c6e8a1c3e5b7d9f1a3c5e7b`)
  - `environment_id` (string)
  - `source_id` (string)
  - `external_id` (string, example `k8s://5f0c2a7e-…/apps/v1/Deployment/payments/payments-api`)
  - `provider` (string, example `k8s`)
  - `kind` (string, example `Deployment`)
  - `name` (string, example `payments-api`)
  - `namespace` (string, example `payments`)
  - `component_id` (string | null)
  - `component_bound_by` (string | null): What bound it to its service, when something did.
  - `status` (string, one of `live`, `missing`, `gone`, `stale`)
  - `missing_since` (string (date-time) | null)
  - `first_seen_at` (string (date-time))
  - `last_seen_at` (string (date-time))
  - `images` (array of string)
  - `state` (object | null)
    - `id` (string)
    - `content_hash` (string)
    - `payload` (object): The redacted document its source sent.
    - `observed_at` (string (date-time))
  - `proposals` (array of Match): Only with `catalog:component:read`.
    - `id` (string)
    - `resource_id` (string | null)
    - `application_id` (string | null)
    - `component_id` (string | null): The service proposed, when it exists.
    - `proposed_slug` (string | null): A slug nobody declared yet; accepting creates that service.
    - `reason` (string): Which rule proposed it.
    - `confidence` (number)
    - `status` (string, one of `proposed`, `accepted`, `rejected`)
    - `decided_by` (string | null)
    - `decided_at` (string (date-time) | null)
    - `created_at` (string (date-time))
    - `resource` (object | null)
      - `environment_id` (string)
      - `provider` (string)
      - `kind` (string)
      - `name` (string)
      - `namespace` (string)
      - `status` (string)
    - `application` (object | null)
      - `environment_id` (string)
      - `namespace` (string)
      - `name` (string)
      - `key_source` (string)
      - `owner_hint` (string | null)
    - `component` (object | null)
      - `slug` (string)
      - `display_name` (string)
  - `connections` (array of object)
    - `direction` (string, one of `in`, `out`)
    - `type` (string, example `exposes`)
    - `other_id` (string | null)
    - `other_kind` (string)
    - `other_name` (string)
    - `other_namespace` (string)
    - `declared` (boolean): True for a link people declared, false for one observed.
  - `connections_truncated` (boolean)
  - `application` (object | null)
    - `id` (string)
    - `name` (string)
    - `key_source` (string)
  - `live` (Live | null)
    - One of:
      - Live
        - `desired` (integer)
        - `ready` (integer)
        - `available` (integer)
        - `updated` (integer)
        - `pods` (object): Pods by phase.
          - Other keys: integer
        - `restarts` (integer)
        - `reasons` (object): Containers in each failing state, such as `CrashLoopBackOff`.
          - Other keys: integer
        - `pods_seen` (boolean)
        - `observed_at` (string (date-time))
        - `health` (Health, one of `healthy`, `degraded`, `down`, `idle`, `unknown`)
      - null

### 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 GET 'https://evohub.io/api/v1/catalog/resources/res_6b8d0f2a4c6e8a1c3e5b7d9f1a3c5e7b' \
  -H 'Authorization: Bearer <TOKEN>'
```
