# Check a cloud account

`POST https://evohub.io/api/v1/catalog/connections/{id}/check`

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

Tries the access the way a read would: assumes the AWS role, or
signs in and finds the marked subscriptions or projects. The answer
is 200 either way: `{"ok": true, "account_id": "…"}` or
`{"ok": false, "error": "…"}` with what the cloud said.

Requires the `identity:cloudaccount: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 `con_7d9f1b3a5c7e9a2c4e6b8d0f2a4c6e8b`): The cloud account's ID.

## Responses

### 200 — What the cloud answered.

Content type: `application/json`

Type: `object`

- `data` (object)
  - `ok` (boolean, required)
  - `account_id` (string)
  - `error` (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)

### 503 — Cloud accounts for this provider cannot be connected on this EvoHub (`CLOUD_NOT_CONFIGURED`).

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 POST 'https://evohub.io/api/v1/catalog/connections/con_7d9f1b3a5c7e9a2c4e6b8d0f2a4c6e8b/check' \
  -H 'Authorization: Bearer <TOKEN>'
```
