# iClosed

Connect or disconnect iClosed.

Connect or disconnect iClosed.

## Delete iClosed connection

`DELETE /v1/connections/iclosed/`

Required scope: `connections:write`

### Parameters

| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string (uuid) | Yes | UUID4 identifying one intended write. Reuse it only when retrying that same write. |

### Responses

- `204` Success
- `400` The request is invalid.
- `401` Authentication is missing, invalid, or revoked.
- `403` The authenticated identity lacks the required scope or capability.
- `404` The resource is unavailable or not visible to this organization.
- `409` The write conflicts with current state or an identical request is still running.
- `422` The write contains fields outside its closed input schema.
- `429` The request-rate budget is exhausted.

```bash
curl -X DELETE "https://api.themochi.app/v1/connections/iclosed/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)"
```

## Create iClosed connection

`POST /v1/connections/iclosed/`

Required scope: `connections:write`

### Parameters

| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string (uuid) | Yes | UUID4 identifying one intended write. Reuse it only when retrying that same write. |

### Request body

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `api_key` | string | Yes | max length 512 |

### Response (200)

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `category` | string | No | read-only |
| `id` | string | No | read-only |
| `provider` | string | No | read-only |
| `status` | string | No | read-only |

### Responses

- `200` Success
- `400` The request is invalid.
- `401` Authentication is missing, invalid, or revoked.
- `403` The authenticated identity lacks the required scope or capability.
- `404` The resource is unavailable or not visible to this organization.
- `409` The write conflicts with current state or an identical request is still running.
- `422` The write contains fields outside its closed input schema.
- `429` The request-rate budget is exhausted.

```bash
curl -X POST "https://api.themochi.app/v1/connections/iclosed/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
  -H "Content-Type: application/json" \
  -d '{"api_key":"string"}'
```

