# Справочник API: Аккаунт и команда

Аккаунт и команда: все операции API v1 с нужным scope, параметрами, примерами на curl, JavaScript и Python и ответами. Аутентификация, ошибки, постраничная выдача, лимиты и идемпотентность описаны в [обзоре справочника API](/docs/api-reference); см. также [SDK](/docs/sdks) и [командную строку](/docs/cli).

> Попробуйте со своим ключом: создайте API-ключ в консоли, выполните в терминале `export APIDLY_API_KEY=...` и вставьте любой пример curl ниже. Значения в примерах условные. На этой странице нет поля для ввода ключа.

Описания операций и полей взяты из определения API и приведены на английском.

| Операция | Требуемый scope | Описание |
| --- | --- | --- |
| `GET /me` | `read` | Организация, ключ и кошелёк |
| `GET /team/members` | `read` | Участники организации |
| `GET /team/roles` | `full` | Встроенные и пользовательские роли с их правами |
| `POST /team/roles` | `full` | Создать пользовательскую роль |
| `GET /notification-preferences` | `read` | Переключатели уведомлений |
| `PUT /notification-preferences` | `full` | Изменить переключатели уведомлений |
| `GET /activity` | `read` | Журнал действий организации, сначала новые |
| `GET /team/invitations` | `full` | Ожидающие приглашения, сначала новые |
| `POST /team/invitations` | `full` | Пригласить человека по электронной почте |
| `DELETE /team/invitations/{id}` | `full` | Отозвать ожидающее приглашение |
| `PATCH /team/members/{userId}` | `full` | Изменить роль участника |
| `DELETE /team/members/{userId}` | `full` | Удалить участника из организации |
| `PUT /team/members/{userId}/spending-limit` | `full` | Задать или снять месячный лимит расходов участника |
| `PATCH /team/roles/{id}` | `full` | Заменить название, описание и права пользовательской роли |
| `DELETE /team/roles/{id}` | `full` | Удалить пользовательскую роль |
| `POST /team/invitations/{id}/resend` | `full` | Повторно отправить приглашение |
| `GET /notifications` | `read` | Уведомления в приложении для участника, от имени которого действует ключ |
| `POST /notifications/read` | `servers` | Отметить все уведомления в приложении как прочитанные |
| `PATCH /organization` | `full` | Переименовать организацию или изменить её адрес для счетов или страну |
| `GET /organization/defaults` | `read` | Настройки запуска организации по умолчанию |
| `PATCH /organization/defaults` | `full` | Изменить настройки запуска по умолчанию |
| `GET /me/profile` | `full` | Профиль участника, которому принадлежит ключ |
| `PATCH /me/profile` | `full` | Изменить отображаемое имя, язык или часовой пояс |
| `GET /activity/export` | `read` | Журнал действий в файле CSV |
| `GET /openapi.json` | `read` | Этот документ |

## Аккаунт

### GET /me

Организация, ключ и кошелёк

A per-server token (`apc_srv_...`, from "Allow this server to stop itself") may call this too; it then gets `{ org, key: { kind: "server" }, server }` without a balance.

**Требуемый scope:** `read`

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/me" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.me()
```

**Утилита командной строки:** `apidly init`, `apidly status`, `apidly login`, `apidly whoami`, `apidly doctor` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "org": {
    "id": "example",
    "name": "example",
    "slug": "example",
    "status": "example",
    "requireTwoFactor": false,
    "memberEmailsVisible": false
  },
  "key": {
    "id": "example",
    "name": "example",
    "prefix": "example",
    "scope": "read",
    "expiresAt": "2026-11-21T10:00:00.000Z",
    "createdAt": "2026-11-21T10:00:00.000Z",
    "creatorRole": "owner",
    "permissions": [
      "example"
    ],
    "permissionList": [
      "example"
    ]
  },
  "balance": {
    "balanceMicros": "1000000",
    "balanceUsd": "1.000000",
    "burnPerHourMicros": "1000000",
    "burnPerHourUsd": "1.000000",
    "runwayHours": 1,
    "state": "ok",
    "graceUntil": "2026-11-21T10:00:00.000Z",
    "monthToDateMicros": "1000000",
    "monthToDateUsd": "1.000000"
  }
}
```

Статусы ошибок: `401`, `403`, `429`.

### GET /team/members

Участники организации

**Требуемый scope:** `read`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | нет |  |
| `cursor` | query | string | нет |  |

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/team/members?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.list_members()
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "members": [
    {
      "userId": "id_example",
      "name": "example",
      "email": "dev@example.com",
      "role": "owner",
      "roleId": "id_example",
      "roleName": "example",
      "permissions": [
        "example"
      ],
      "joinedAt": "2026-11-21T10:00:00.000Z",
      "spendingLimit": {
        "monthlyLimitMicros": "1000000",
        "monthlyLimitUsd": "1.000000",
        "monthToDateMicros": "1000000",
        "monthToDateUsd": "1.000000"
      }
    }
  ],
  "nextCursor": "example"
}
```

Статусы ошибок: `401`, `403`, `429`.

### GET /team/roles

Встроенные и пользовательские роли с их правами

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/team/roles" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.list_roles()
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "roles": [
    {
      "id": "example",
      "name": "example",
      "description": "example",
      "builtin": false,
      "permissions": [
        "example"
      ],
      "memberCount": 1
    }
  ]
}
```

Статусы ошибок: `401`, `403`, `429`.

### POST /team/roles

Создать пользовательскую роль

At most 10 per organization. The key's creator must be the owner, and cannot grant permissions they lack.

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `name` | string | да |  |
| `description` | string | нет |  |
| `permissions` | массив из `servers.view` \| `servers.deploy` \| `servers.manage` \| `servers.destroy` \| `servers.exec` \| `templates.manage` \| `endpoints.manage` \| `endpoints.invoke` \| `storage.manage` \| `ssh_keys.manage` \| `secrets.manage` \| `api_keys.manage` \| `webhooks.manage` \| `automation.manage` \| `billing.view` \| `billing.topup` \| `billing.manage` \| `team.manage` \| `settings.manage` \| `activity.view` | да |  |

**Пример запроса (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/team/roles" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","permissions":["servers.view"]}'
```

**Python (SDK)**

```python
client.team.create_role(name="example", permissions=["servers.view"])
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (201)

```json
{
  "role": {
    "id": "example",
    "name": "example",
    "description": "example",
    "builtin": false,
    "permissions": [
      "example"
    ],
    "memberCount": 1
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `409`, `429`.

### GET /notification-preferences

Переключатели уведомлений

Email and in-app switches and the running-server reminder belong to the member the key acts as; the webhook switch belongs to the organization.

**Требуемый scope:** `read`

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/notification-preferences" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.notifications.get();
```

**Python (SDK)**

```python
client.notifications.get()
```

**Утилита командной строки:** `apidly notifications` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "categories": [
    {
      "id": "example",
      "forcedMail": false,
      "email": {
        "value": false
      },
      "inApp": {
        "value": false
      },
      "webhook": {
        "value": false
      },
      "webhookEvents": [
        "example"
      ]
    }
  ],
  "runningReminderHours": 1,
  "weeklySummary": false,
  "canEditWebhooks": false
}
```

Статусы ошибок: `401`, `403`, `429`.

### PUT /notification-preferences

Изменить переключатели уведомлений

`org` rows (webhook) need webhook management; categories you leave out are unchanged.

**Требуемый scope:** `full`

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `weeklySummary` | boolean | нет |  |
| `runningReminderHours` | integer или null | нет |  |
| `user` | object | нет |  |
| `org` | object | нет |  |

**Пример запроса (curl)**

```bash
curl -X PUT "https://apidly.com/api/v1/notification-preferences" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"weeklySummary":false,"runningReminderHours":1,"user":{}}'
```

**JavaScript (SDK)**

```js
await apidly.notifications.set({
  weeklySummary: false,
  runningReminderHours: 1,
  user: {}
});
```

**Python (SDK)**

```python
client.notifications.set(body={
    "weeklySummary": False,
    "runningReminderHours": 1,
    "user": {},
})
```

**Утилита командной строки:** `apidly notifications` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "categories": [
    {
      "id": "example",
      "forcedMail": false,
      "email": {
        "value": false
      },
      "inApp": {
        "value": false
      },
      "webhook": {
        "value": false
      },
      "webhookEvents": [
        "example"
      ]
    }
  ],
  "runningReminderHours": 1,
  "weeklySummary": false,
  "canEditWebhooks": false
}
```

Статусы ошибок: `400`, `401`, `403`, `429`.

### GET /activity

Журнал действий организации, сначала новые

Addresses are masked to the /24 unless the key's creator is the owner.

**Требуемый scope:** `read` · **Разрешение:** `activity.view`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `actor` | query | string | нет | Exactly one actor id: a member user id or an API key id. |
| `category` | query | `signIn` \| `team` \| `keys` \| `servers` \| `billing` \| `settings` | нет |  |
| `cursor` | query | string | нет |  |
| `from` | query | string | нет | YYYY-MM-DD, UTC. |
| `to` | query | string | нет | YYYY-MM-DD, UTC, inclusive. |
| `limit` | query | integer | нет |  |

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/activity?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.activity.list({ limit: 20 });
```

**Python (SDK)**

```python
client.activity.list()
```

**Утилита командной строки:** `apidly activity` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "activity": [
    {
      "id": "example",
      "at": "2026-11-21T10:00:00.000Z",
      "category": "signIn",
      "action": "example",
      "actor": {
        "kind": "example",
        "label": "example"
      },
      "ip": "example",
      "params": {
        "key": null
      }
    }
  ],
  "nextCursor": "example"
}
```

Статусы ошибок: `401`, `403`, `429`.

### GET /team/invitations

Ожидающие приглашения, сначала новые

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | нет |  |
| `cursor` | query | string | нет |  |

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/team/invitations?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.list_invitations()
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "invitations": [
    {
      "id": "example",
      "email": "dev@example.com",
      "role": "owner",
      "roleKey": "example",
      "roleName": "example",
      "customRoleId": "id_example",
      "customRoleName": "example",
      "invitedByName": "example",
      "invitedByEmail": "dev@example.com",
      "expiresAt": "2026-11-21T10:00:00.000Z",
      "createdAt": "2026-11-21T10:00:00.000Z",
      "expired": false,
      "mailSent": false
    }
  ],
  "nextCursor": "example"
}
```

Статусы ошибок: `401`, `403`, `429`.

### POST /team/invitations

Пригласить человека по электронной почте

`role` is `admin`, `member` (default) or a custom role id from `GET /team/roles`. The key's creator cannot grant permissions they lack (403 `role_escalation`). The invitation mail is sent and the link is valid for 7 days.

**Требуемый scope:** `full` · **Разрешение:** `team.manage` · **Безопасный повтор с:** `Idempotency-Key`

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `email` | string | да |  |
| `role` | string | нет |  |

**Пример запроса (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/team/invitations" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"email":"dev@example.com"}'
```

**Python (SDK)**

```python
client.team.invite(email="dev@example.com")
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (201)

```json
{
  "invitation": {
    "id": "example",
    "email": "dev@example.com",
    "role": "owner",
    "roleKey": "example",
    "roleName": "example",
    "customRoleId": "id_example",
    "customRoleName": "example",
    "invitedByName": "example",
    "invitedByEmail": "dev@example.com",
    "expiresAt": "2026-11-21T10:00:00.000Z",
    "createdAt": "2026-11-21T10:00:00.000Z",
    "expired": false,
    "mailSent": false
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `409`, `422`, `429`.

### DELETE /team/invitations/{id}

Отозвать ожидающее приглашение

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `id` | path | string | да |  |

**Пример запроса (curl)**

```bash
curl -X DELETE "https://apidly.com/api/v1/team/invitations/team_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.revoke_invitation("team_example")
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "deleted": false,
  "id": "example"
}
```

Статусы ошибок: `401`, `403`, `404`, `429`.

### PATCH /team/members/{userId}

Изменить роль участника

Same rules as the console: no escalation beyond the key creator's own permissions (403 `role_escalation`), the last owner keeps the role (403 `last_owner`).

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `userId` | path | string | да |  |

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `role` | string | да |  |

**Пример запроса (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/team/members/team_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"role":"example"}'
```

**Python (SDK)**

```python
client.team.update_member("team_example", role="example")
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "userId": "id_example",
  "role": "owner",
  "roleKey": "example",
  "roleName": "example"
}
```

Статусы ошибок: `400`, `401`, `403`, `404`, `429`.

### DELETE /team/members/{userId}

Удалить участника из организации

A key cannot remove the member who created it (403 `forbidden`); leave from the console.

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `userId` | path | string | да |  |

**Пример запроса (curl)**

```bash
curl -X DELETE "https://apidly.com/api/v1/team/members/team_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.remove_member("team_example")
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "deleted": false,
  "userId": "id_example"
}
```

Статусы ошибок: `401`, `403`, `404`, `429`.

### PUT /team/members/{userId}/spending-limit

Задать или снять месячный лимит расходов участника

`monthlyLimitCents` in US cents; `null` removes the limit. A member's month-to-date usage is the usage this UTC month of the servers they launched, from the console or with any key. At the limit, their new launches (servers, copies, launch again) and the starts of their stopped servers answer 403 `member_limit_reached` until the limit is raised or the month ends; servers already running are not stopped, and workers that a serverless endpoint or server group starts by itself are not refused. Needs `team.manage` and `billing.manage`. Only an owner may change their own limit (403 `forbidden`). 404 `not_found` for someone who is not a member; 404 `feature_unavailable` while spending limits are not available.

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `userId` | path | string | да |  |

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `monthlyLimitCents` | integer или null | да |  |

**Пример запроса (curl)**

```bash
curl -X PUT "https://apidly.com/api/v1/team/members/team_example/spending-limit" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"monthlyLimitCents":1}'
```

**Python (SDK)**

```python
client.team.set_member_spending_limit("team_example", monthly_limit_cents=1)
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "userId": "id_example",
  "spendingLimit": {
    "monthlyLimitMicros": "1000000",
    "monthlyLimitUsd": "1.000000",
    "monthToDateMicros": "1000000",
    "monthToDateUsd": "1.000000"
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `404`, `429`.

### PATCH /team/roles/{id}

Заменить название, описание и права пользовательской роли

Every member who holds the role follows the new permissions on their next request. Owner only.

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `id` | path | string | да |  |

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `name` | string | да |  |
| `description` | string | нет |  |
| `permissions` | массив из `servers.view` \| `servers.deploy` \| `servers.manage` \| `servers.destroy` \| `servers.exec` \| `templates.manage` \| `endpoints.manage` \| `endpoints.invoke` \| `storage.manage` \| `ssh_keys.manage` \| `secrets.manage` \| `api_keys.manage` \| `webhooks.manage` \| `automation.manage` \| `billing.view` \| `billing.topup` \| `billing.manage` \| `team.manage` \| `settings.manage` \| `activity.view` | да |  |

**Пример запроса (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/team/roles/team_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","permissions":["servers.view"]}'
```

**Python (SDK)**

```python
client.team.update_role("team_example", name="example", permissions=["servers.view"])
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "role": {
    "id": "example",
    "name": "example",
    "description": "example",
    "builtin": false,
    "permissions": [
      "example"
    ],
    "memberCount": 1
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `404`, `429`.

### DELETE /team/roles/{id}

Удалить пользовательскую роль

409 `role_in_use` while members or invitations hold it. Owner only.

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `id` | path | string | да |  |

**Пример запроса (curl)**

```bash
curl -X DELETE "https://apidly.com/api/v1/team/roles/team_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.delete_role("team_example")
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "ok": false
}
```

Статусы ошибок: `401`, `403`, `404`, `409`, `429`.

### POST /team/invitations/{id}/resend

Повторно отправить приглашение

A fresh link valid for 7 days; the old link stops working.

**Требуемый scope:** `full` · **Разрешение:** `team.manage`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `id` | path | string | да |  |

**Пример запроса (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/team/invitations/team_example/resend" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.team.resend_invitation("team_example")
```

**Утилита командной строки:** `apidly team` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "id": "example",
  "expiresAt": "2026-11-21T10:00:00.000Z",
  "mailSent": false
}
```

Статусы ошибок: `401`, `403`, `404`, `429`.

### GET /notifications

Уведомления в приложении для участника, от имени которого действует ключ

Newest first, with the unread count.

**Требуемый scope:** `read`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | нет |  |

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/notifications?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.notifications.inbox({ limit: 20 });
```

**Python (SDK)**

```python
client.notifications.inbox()
```

**Утилита командной строки:** `apidly notifications` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "items": [
    {
      "id": "example",
      "category": "example",
      "title": "example",
      "path": "example",
      "readAt": "2026-11-21T10:00:00.000Z",
      "createdAt": "2026-11-21T10:00:00.000Z"
    }
  ],
  "unread": 1
}
```

Статусы ошибок: `400`, `401`, `403`, `429`.

### POST /notifications/read

Отметить все уведомления в приложении как прочитанные

**Требуемый scope:** `servers`

**Пример запроса (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/notifications/read" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.notifications.markRead();
```

**Python (SDK)**

```python
client.notifications.mark_read()
```

**Утилита командной строки:** `apidly notifications` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "ok": false
}
```

Статусы ошибок: `401`, `403`, `429`.

### PATCH /organization

Переименовать организацию или изменить её адрес для счетов или страну

Send only the fields to change. `country` is a two-letter code; `billingEmail` and `country` take null to clear.

**Требуемый scope:** `full` · **Разрешение:** `settings.manage`

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `name` | string | нет |  |
| `billingEmail` | string или null | нет |  |
| `country` | string или null | нет |  |

**Пример запроса (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/organization" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","billingEmail":"dev@example.com","country":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.organization.update({
  name: "example",
  billingEmail: "dev@example.com",
  country: "example"
});
```

**Python (SDK)**

```python
client.organization.update()
```

**Утилита командной строки:** `apidly org` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "organization": {
    "id": "example",
    "name": "example",
    "billingEmail": "dev@example.com",
    "country": "example"
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `429`.

### GET /organization/defaults

Настройки запуска организации по умолчанию

What every launch starts with when the request leaves it out: `sshKeyIds` (installed by `POST /servers` without `sshKeyIds`, preselected in the console), `autoStopHours` (when 1 or more, added by `POST /servers` without `automation`, and prefilled in the console; `0` and `null` add no automatic stop to an API launch. The 2-hour stop on an account's first server is a console form default only: while this is null, Quick start and the deploy wizard switch it on in the form and set it on the new server after the launch; `POST /servers` itself never adds it) and `region` (a soft preference: Quick start and `GET /quickstart` suggest a plan offered there when one fits; it never limits where a server runs). Any key may read them.

**Требуемый scope:** `read`

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/organization/defaults" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.organization.defaults();
```

**Python (SDK)**

```python
client.organization.defaults()
```

**Утилита командной строки:** `apidly org` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "defaults": {
    "sshKeyIds": [
      "example"
    ],
    "autoStopHours": 1,
    "region": "na"
  }
}
```

Статусы ошибок: `401`, `403`, `429`.

### PATCH /organization/defaults

Изменить настройки запуска по умолчанию

Send only the fields to change; `null` resets one to not chosen. 400 `invalid_ssh_key` for a key that is not in this organization.

**Требуемый scope:** `full` · **Разрешение:** `settings.manage`

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `sshKeyIds` | массив из string или null | нет | SSH keys preselected on every launch (ids from `GET /ssh-keys`), used by `POST /servers` when the request has no `sshKeyIds`. `[]` = none; `null` = not chosen. |
| `autoStopHours` | integer или null | нет | Automatic stop for new servers after this many hours of running (1 to 720), applied when a launch sends no `automation`. `0` = no automatic stop; `null` = not chosen: an API launch then gets no automatic stop (the console's Quick start and deploy wizard still switch on a 2-hour stop in the form for an account's first server and set it after the launch). |
| `region` | `na` \| `eu` \| `ap` \| `other` или null | нет | Preferred region (`na`, `eu`, `ap`, `other`). Soft: only orders plan suggestions, never limits where a server runs. `null` = no preference. |

**Пример запроса (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/organization/defaults" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sshKeyIds":["example"],"autoStopHours":0,"region":"na"}'
```

**JavaScript (SDK)**

```js
await apidly.organization.setDefaults({
  sshKeyIds: [
    "example"
  ],
  autoStopHours: 0,
  region: "na"
});
```

**Python (SDK)**

```python
client.organization.set_defaults()
```

**Утилита командной строки:** `apidly org` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "defaults": {
    "sshKeyIds": [
      "example"
    ],
    "autoStopHours": 1,
    "region": "na"
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `429`.

### GET /me/profile

Профиль участника, которому принадлежит ключ

Display name, language and time zone of the member who created the key. The e-mail address, password, two-factor and passkeys are never readable or changeable with an API key: change them in the console, signed in. Notification switches: `GET /notification-preferences`.

**Требуемый scope:** `full`

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/me/profile" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.profile.get();
```

**Python (SDK)**

```python
client.profile.get()
```

**Утилита командной строки:** `apidly profile` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "profile": {
    "name": "example",
    "locale": "example",
    "timeZone": "example"
  }
}
```

Статусы ошибок: `401`, `403`, `429`.

### PATCH /me/profile

Изменить отображаемое имя, язык или часовой пояс

Send only the fields to change. `locale` is one of the site's languages; `timeZone` an IANA name such as `Europe/Berlin` (null = UTC). Nothing else of the account can change through an API key.

**Требуемый scope:** `full`

**Тело запроса**

| Имя | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `name` | string | нет | Display name, 1 to 80 characters. |
| `locale` | `en` \| `nl` \| `it` \| `es` \| `id` \| `fr` \| `pt-BR` \| `ru` \| `uk` \| `nb` \| `ro` \| `fi` \| `sv` \| `da` \| `cs` \| `hu` \| `tr` \| `ar` \| `vi` \| `th` \| `ko` \| `ja` \| `pl` \| `el` \| `de` | нет | Language of mail sent without a request (for example `de`, `pt-BR`). |
| `timeZone` | string или null | нет | IANA time zone (for example `Europe/Berlin`) for dates in mail; `null` = UTC. The console shows times in the browser's zone. |

**Пример запроса (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/me/profile" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","locale":"en","timeZone":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.profile.update({
  name: "example",
  locale: "en",
  timeZone: "example"
});
```

**Python (SDK)**

```python
client.profile.update()
```

**Утилита командной строки:** `apidly profile` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "profile": {
    "name": "example",
    "locale": "example",
    "timeZone": "example"
  }
}
```

Статусы ошибок: `400`, `401`, `403`, `429`.

### GET /activity/export

Журнал действий в файле CSV

Returns `text/csv` with the same filters as `GET /activity` (`limit` is ignored), at most 5,000 rows. Ten exports an hour per key and twenty an hour per organization, across all its keys.

**Требуемый scope:** `read` · **Разрешение:** `activity.view`

**Параметры**

| Имя | Где | Тип | Обязательный | Описание |
| --- | --- | --- | --- | --- |
| `actor` | query | string | нет |  |
| `category` | query | `signIn` \| `team` \| `keys` \| `servers` \| `billing` \| `settings` | нет |  |
| `from` | query | string | нет |  |
| `to` | query | string | нет |  |

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/activity/export" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.activity.export();
```

**Python (SDK)**

```python
client.activity.export()
```

**Утилита командной строки:** `apidly export` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

`text/csv`

Статусы ошибок: `400`, `401`, `403`, `429`.

## Описание API

### GET /openapi.json

Этот документ

Public: no API key needed.

**Требуемый scope:** `read`

**Пример запроса (curl)**

```bash
curl "https://apidly.com/api/v1/openapi.json" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**Python (SDK)**

```python
client.openapi()
```

**Утилита командной строки:** `apidly openapi` ([Справочник CLI](/docs/cli))

**Пример ответа** (200)

```json
{
  "key": null
}
```

Статусы ошибок: `401`, `403`, `429`.
