# Update server settings

`opensend.server.update(input?)`

Opens or closes sign-ups, or changes what each workspace may use. Only the owner of the server can, signed in: a key belongs to one workspace, and these settings govern all of them.

Needs the scope: `workspace:write`

This method answers a person who is signed in to the dashboard. A call with an API key is refused with 403.

## Input

- `signUps` (string): `open` to let anybody who reaches the address make an account, `closed` to let people in by invitation only. One of: `open`, `closed`.
- `limits` (object): Limits for every workspace on the server, the ones that exist already included. Send only the ones to change.
- `limits.transactional` (integer | null): Emails a workspace may send in a month through the API and its automations. `null` removes the limit. From 0 to 999,999,999,999,999.
- `limits.marketing` (integer | null): Emails a workspace may send in a month as broadcasts. `null` removes the limit. From 0 to 999,999,999,999,999.
- `limits.contacts` (integer | null): Contacts a workspace may hold. `null` removes the limit. From 0 to 999,999,999,999,999.
- `limits.domains` (integer | null): Domains a workspace may add. `null` removes the limit. From 0 to 999,999,999,999,999.
- `limits.members` (integer | null): People a workspace may have, invitations included. `null` removes the limit. From 0 to 999,999,999,999,999.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("server"): Always `server`.
- `selfHosted` (boolean): Whether a team hosts this server itself. `false` where the product is hosted for you, and nothing here can be changed there.
- `owner` (boolean): Whether the signed-in person asking owns the server. `false` for an API key.
- `signUps` (string): `open` when anybody who reaches the address may make an account, `closed` when people come in by invitation only. One of: `open`, `closed`.
- `limits` (object[]): What each workspace on the server may use, one entry for every limit that can be set. Empty where the product is hosted for you: a workspace takes its limits from its plan there.
- `limits[].id` (string): Which limit this is: `transactional`, `marketing`, `contacts`, `domains` or `members`.
- `limits[].limit` (integer | null): How much each workspace may use, or `null` where there is no limit.

## Example

TypeScript:

```ts
await opensend.server.update({
  signUps: 'closed',
  limits: {
    transactional: 50000,
    members: 25,
  },
})
```

CLI:

```bash
opensend server update \
  --sign-ups closed \
  --limits '{"transactional":50000,"members":25}'
```

Answer:

```json
{
  "object": "server",
  "selfHosted": true,
  "owner": true,
  "signUps": "closed",
  "limits": [
    {
      "id": "transactional",
      "limit": 50000
    },
    {
      "id": "marketing",
      "limit": null
    },
    {
      "id": "contacts",
      "limit": 10000
    },
    {
      "id": "domains",
      "limit": null
    },
    {
      "id": "members",
      "limit": 25
    }
  ]
}
```
