> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# SLC in Cabine

> The Lerian SLC workspace in Lerian Cabine.

The Lerian Cabine workspace for Lerian SLC shows as **SLC**. Operators use it to follow operations, send them to Núclea, read clearing positions and card deposits, answer settlements as an IF Domicílio, answer LBTR results, and administer the rail.

Cabine reads the operator's Lerian SLC permissions from Access Manager and hides what the operator may not use. [Permissions by control](#permissions-by-control) lists the permission each control needs. See [Access and roles in Lerian Cabine](https://docs.lerian.studio/en/rails/cabine/cabine-access-and-roles.md).

## The SLC edge

***

The browser does not call Lerian SLC. It calls the Lerian SLC edge, a component that you install. The edge requires a bearer token in the `Authorization` header. It forwards the paths `/v1/*`, `/webhooks*` and `/admin/*` to Lerian SLC without change, and Lerian SLC decides what the operator may do. When Lerian SLC does not answer, the edge answers `503`.

* Set the address of the edge in `VITE_SLC_EDGE_URL`. See [Configuring Lerian Cabine](https://docs.lerian.studio/en/rails/cabine/cabine-configuration.md). Without it, Cabine hides the workspace and makes no call.
* Set the address of Lerian SLC in `SLC_UPSTREAM_URL` on the edge. The edge does not start without it.
* Set `SLC_EDGE_CORS_ALLOWED_ORIGINS` on the edge to the origin where operators open Cabine.
* The edge needs a license. It does not start without `LICENSE_KEY` or `LICENSE_FILE_PATH`. When both are set, the edge uses the file and ignores the key.

The edge answers `/health` and `/readyz`. `/readyz` reports the connection to Lerian SLC and the license.

## Operations

***

The **Operações** screen lists the operations of Lerian SLC. It reads `GET /v1/operations`. You can search by external ID and narrow the list by type, batch and period. A search by NUliquid reads `GET /v1/operations/nuliquid/{nuliquid}` and shows the answer of Núclea (SLC0908).

The operation detail reads `GET /v1/operations/{operationId}`. It shows the state, what the operation waits for, the last error, the ESLC errors, and the history from `GET /v1/operations/{operationId}/history`.

An operator with the permission can act on an operation. A button is off, with the reason, in a state that does not allow the action.

| Action | When | What it does |
| - | - | - |
| **Cancelar** | **CREATED** or **QUEUED** | Cancels the operation before it is sent, with `DELETE /v1/operations/{operationId}`. |
| **Requeue** | **CREATED** | Puts the operation in the queue, with `POST /v1/operations/{operationId}/requeue`. |
| **Retry** | **REJECTED** | Sends the operation again as a new operation linked to the first, with `POST /v1/operations/{operationId}/retry`. Cabine opens the new operation. |
| **Advance (override)** | Any state | Moves the operation along an existing transition of the state machine, with `POST /v1/operations/{operationId}/advance`. The operator gives a justification and an evidence reference. The history shows the audit. |
| **Retransmitir** | **QUEUED** | Sends the queued operation again, with `POST /v1/connectivity/operations/{id}/retransmit`. The send does not duplicate. |

## Send operations

***

The **Intake** screen shows as **Enviar operações**. It has three ways to send:

* **Enviar arquivo assinado** sends a signed ASLC file with `POST /v1/files`. The form asks for the participant, the issuer control, the file name and a reason. The screen **Arquivo de intake** reads the file with `GET /v1/files/{id}` and lists the operations that came from it.
* **Criar operação** creates one operation with `POST /v1/operations`.
* **Enviar lote** sends operations as NDJSON, from a file or from the text box, with `POST /v1/operations/batch`. When Lerian SLC refuses lines, a table shows each one with its line number, external ID, code and message.

## Clearing and deposits

***

The **Posições de clearing** screen reads `GET /v1/clearing/positions`. You can filter by reference date, cycle and stage.

The **Depósitos de cartão** screen lists the deposit instructions. It reads `GET /v1/funding/settlement-instructions`. You can filter by date, cycle and state. The **Instrução de depósito** screen reads `GET /v1/funding/settlement-instructions/{instructionId}`. It has two views:

* **Rodadas** shows each round with its amount, its deadline and the STR launches that Lerian SPB recorded for it.
* **Pedido de depósito** shows the deposit request of the instruction.

When the last launch of Lerian SPB for the current round was refused, the round offers **Depositar de novo a rodada N (LDL0022)**. It sends the deposit with `POST /v1/str/operations/card-deposits` to Lerian SPB, not to the SLC edge.

## IF Domicílio

***

The **Domicílio** screen lists the settlements that Núclea notified to your institution as an IF Domicílio. It reads `GET /v1/domicile/settlements`. You can filter by type, answer (including **Estacionada**), payment date and file. The **Liquidação** screen reads `GET /v1/domicile/settlements/{nuLiquid}` and shows the answers sent for it.

* **Confirmar** and **Recusar** answer one settlement, or the settlements that you select in the list. **Recusar** asks for a refusal code (**Código de recusa**). Cabine sends each answer with `POST /v1/domicile/responses` and shows the result for each settlement.
* Each answer shows its phase, decision, state, file and the errors of Núclea. **Liberar arquivo** releases a parked answer file with `POST /v1/domicile/responses/unpark`.

## LBTR

***

The **Resultados LBTR** screen lists the results that the clearing house announced. It reads `GET /v1/lbtr/results`. The **Resultado LBTR** screen reads `GET /v1/lbtr/results/{resultId}` and the answers sent so far from `GET /v1/lbtr/commands`.

* **Responder** answers the result with an LTR0002. The operator chooses **Confirmar** or **Divergir** and checks the announced amount. Cabine sends it with `POST /v1/lbtr/results/{resultId}/decision`.
* **Pagar com LTR0004** pays the result with an LTR0004. Cabine sends it to Lerian SPB with `POST /v1/str/operations/ltr-transfers`.

## Reference

***

* The **Relatórios** screen lists the reports of Núclea with `GET /v1/reports`.
* The **Participantes** screen lists the participants with `GET /v1/participants`. **Novo participante** creates one. The detail screen edits or deletes the participant and has two views. **Arranjos** lists, creates, edits and deletes the arrangements of the participant. **Conectividade** shows the state of the Núclea API, the C:D connection, the RSFN connection and the certificate. It also sends the AGEN001 test with `POST /v1/participants/{participantIspb}/test-connectivity`.
* The **Catálogo XSD** screen lists the schemas with `GET /v1/xsd-schemas` and shows one document with `GET /v1/xsd-schemas/{type}`.

## Administration

***

The **Admin** menu has these screens.

* **Webhooks** lists the webhook subscriptions with `GET /webhooks`. **Novo webhook** creates one, and you can edit, delete or test it with **Testar**. The secret is write-only: Cabine does not show it. The detail screen lists the deliveries of the webhook. **Reenviar** sends a delivery again with `POST /webhooks/{id}/deliveries/{deliveryId}/replay`.
* **DLQ** shows as **Mensagens mortas**. It lists a queue with `GET /admin/dlq/{queue}`. **Reprocessar** returns a message to processing with `POST /admin/dlq/{queue}/{id}/replay`.
* **Drenagem** runs the recovery actions of the connectivity: **Despacho** sends the credit backlog in the queue, **Retornos** processes the returns received, and **Reprocessar participante** works on one ISPB.

## Permissions by control

***

Cabine hides each control below from an operator who lacks its permission. Lerian SLC refuses the call with `403` as well.

| Control | Permission | Roles |
| - | - | - |
| **Intake**, **Cancelar**, **Requeue** and **Retry** | `operations:write` | `admin`, `operator` |
| **Advance (override)** | `operations:admin` | `admin` |
| **Retransmitir**, **Drenagem** and **Liberar arquivo** | `connectivity:admin` | `admin` |
| **Depósitos de cartão** | `funding:read` | `admin`, `operator` |
| **Confirmar** and **Recusar** in **Domicílio** | `domicile:write` | `admin`, `operator` |
| **Responder** | `lbtr:write` | `admin`, `operator` |
| **Pagar com LTR0004** | `str-operations:write` on Lerian SPB | The Lerian SPB roles that hold it |
| **Participantes** | `participants:read` | `admin` |
| **Webhooks** | `webhooks:admin` | `admin` |
| **DLQ** | `dlq:read` | `admin` |

In BYOC, Access Manager grants `domicile:read` and `domicile:write` after Lerian SLC publishes its permission declaration. Create the machine-to-machine application of Lerian SLC in Access Manager, with the name `br-slc`. Then set `IDP_DECLARATION_ENABLED=true` on Lerian SLC, with `IDP_HOST`, `IDP_M2M_CLIENT_ID` and `IDP_M2M_CLIENT_SECRET` of that application. `PLUGIN_AUTH_ENABLED` must be `true`.

## Related

***

* [Operating Lerian SLC](https://docs.lerian.studio/en/rails/slc/slc-operations.md)
* [Lerian SLC integration](https://docs.lerian.studio/en/rails/slc/slc-integration.md)
* [Access and roles in Lerian Cabine](https://docs.lerian.studio/en/rails/cabine/cabine-access-and-roles.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.