# Customer portal

Every customer company can have a **portal**: a private page where they see their sites, jobs, proposals, invoices and documents. These calls are the portal switch on the company page in TruTec. The portal's link is also on the customer object as `portal_url` (`null` while the portal is off).

Nothing here emails anyone. Share the link yourself, for example with [`POST /v1/client-accounts/{id}/send-email`](messages.md). Anyone with the link can open the portal unless the office set a portal password in TruTec (`password_protected`); passwords are set in TruTec only.

All three need **Write jobs** and return:

```json
{
  "data": {
    "client_account_id": 812,
    "enabled": true,
    "portal_url": "https://trutec.ai/portal/account/0d6c1f6f0b6a4f59a1f0c2b4e8d1a7c3",
    "password_protected": false
  }
}
```

A customer from another workspace is `404` `Customer not found`.

### Turn on the portal

`POST /v1/client-accounts/{id}/portal/enable`

**Permission:** Write jobs

Turns the portal on and returns its link. The link is made the first time and kept, so calling this again returns the same link.

### Turn off the portal

`POST /v1/client-accounts/{id}/portal/disable`

**Permission:** Write jobs

The link stops working. Turning the portal back on revives the same link.

### Reset the portal link

`POST /v1/client-accounts/{id}/portal/reset-link`

**Permission:** Write jobs

Gives the portal a new link and turns it on. The old link stops working for everyone it was shared with.

```bash
curl -X POST "https://trutec.ai/api/v1/client-accounts/812/portal/reset-link" \
  -H "X-API-Key: sk_your_api_key_here"
```
