# `Chatto.Api.V1.BotService`
[🔗](https://github.com/xtian/elixir-chatto/blob/v0.1.0/lib/chatto/generated/chatto_api_v1_bot_service.ex#L3)

Creates and manages bot accounts owned by human users. Bot API keys can
call this service with explicit permissions, bounded by their owner's authority.

# `batch_get_bots`

```elixir
@spec batch_get_bots(Req.Request.t(), Chatto.Api.V1.BatchGetBotsRequest.t()) ::
  {:ok, Chatto.Api.V1.BatchGetBotsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets several visible bots. Missing and inaccessible bots are omitted.

# `create_bot`

```elixir
@spec create_bot(Req.Request.t(), Chatto.Api.V1.CreateBotRequest.t()) ::
  {:ok, Chatto.Api.V1.CreateBotResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Creates a bot owned by the human caller or a bot caller's human owner.
Requires bot.create. The new bot starts without permission grants.

# `create_bot_api_key`

```elixir
@spec create_bot_api_key(Req.Request.t(), Chatto.Api.V1.CreateBotApiKeyRequest.t()) ::
  {:ok, Chatto.Api.V1.CreateBotApiKeyResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Creates one named API key. A bot can have at most 20 active API keys.
Requires bot ownership or bot.manage. The key uses the target bot's authority,
which can exceed the caller's authority.

# `create_bot_incoming_webhook`

```elixir
@spec create_bot_incoming_webhook(
  Req.Request.t(),
  Chatto.Api.V1.CreateBotIncomingWebhookRequest.t()
) ::
  {:ok, Chatto.Api.V1.CreateBotIncomingWebhookResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Creates a named incoming webhook. A bot can have at most 20 active
incoming webhooks.

# `create_bot_outbound_webhook`

```elixir
@spec create_bot_outbound_webhook(
  Req.Request.t(),
  Chatto.Api.V1.CreateBotOutboundWebhookRequest.t()
) ::
  {:ok, Chatto.Api.V1.CreateBotOutboundWebhookResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Creates an endpoint and returns its signing secret once. Requires bot ownership or bot.manage.

# `delete_bot`

```elixir
@spec delete_bot(Req.Request.t(), Chatto.Api.V1.DeleteBotRequest.t()) ::
  {:ok, Chatto.Api.V1.DeleteBotResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Deletes a bot and invalidates all of its API keys.

# `get_bot`

```elixir
@spec get_bot(Req.Request.t(), Chatto.Api.V1.GetBotRequest.t()) ::
  {:ok, Chatto.Api.V1.GetBotResponse.t()} | {:error, Chatto.Connect.Error.t()}
```

Gets one visible bot. Returns NOT_FOUND for an unknown bot. Returns
PERMISSION_DENIED when the caller is not the owner and has neither
bot.manage nor user.manage-accounts.

# `get_bot_outbound_webhook`

```elixir
@spec get_bot_outbound_webhook(
  Req.Request.t(),
  Chatto.Api.V1.GetBotOutboundWebhookRequest.t()
) ::
  {:ok, Chatto.Api.V1.GetBotOutboundWebhookResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets one endpoint. Requires bot ownership or bot.manage. Missing endpoints return NOT_FOUND.

# `list_bot_outbound_webhooks`

```elixir
@spec list_bot_outbound_webhooks(
  Req.Request.t(),
  Chatto.Api.V1.ListBotOutboundWebhooksRequest.t()
) ::
  {:ok, Chatto.Api.V1.ListBotOutboundWebhooksResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists all endpoints, including paused endpoints. Requires bot ownership or bot.manage.
Returns the complete bounded collection, so callers do not need batch hydration.

# `list_bot_webhook_failures`

```elixir
@spec list_bot_webhook_failures(
  Req.Request.t(),
  Chatto.Api.V1.ListBotWebhookFailuresRequest.t()
) ::
  {:ok, Chatto.Api.V1.ListBotWebhookFailuresResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

List retained failures for an endpoint of a bot you can manage. Returns full
records in recording order, oldest first. Expired records are omitted.
This history is diagnostic; an empty result does not prove successful delivery.

# `list_bots`

```elixir
@spec list_bots(Req.Request.t(), Chatto.Api.V1.ListBotsRequest.t()) ::
  {:ok, Chatto.Api.V1.ListBotsResponse.t()} | {:error, Chatto.Connect.Error.t()}
```

Lists bots visible to the authenticated caller.

# `reassign_bot_owner`

```elixir
@spec reassign_bot_owner(Req.Request.t(), Chatto.Api.V1.ReassignBotOwnerRequest.t()) ::
  {:ok, Chatto.Api.V1.ReassignBotOwnerResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Reassigns a bot to another active human owner. Requires bot.manage. The
current API keys and configured permission allowlist remain unchanged,
while effective permissions immediately use the new owner's ceiling.

# `revoke_bot_api_key`

```elixir
@spec revoke_bot_api_key(Req.Request.t(), Chatto.Api.V1.RevokeBotApiKeyRequest.t()) ::
  {:ok, Chatto.Api.V1.RevokeBotApiKeyResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Revokes one API key without changing other active keys.

# `revoke_bot_incoming_webhook`

```elixir
@spec revoke_bot_incoming_webhook(
  Req.Request.t(),
  Chatto.Api.V1.RevokeBotIncomingWebhookRequest.t()
) ::
  {:ok, Chatto.Api.V1.RevokeBotIncomingWebhookResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Revokes one incoming webhook without changing other webhooks.

# `revoke_bot_outbound_webhook`

```elixir
@spec revoke_bot_outbound_webhook(
  Req.Request.t(),
  Chatto.Api.V1.RevokeBotOutboundWebhookRequest.t()
) ::
  {:ok, Chatto.Api.V1.RevokeBotOutboundWebhookResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Permanently revokes an endpoint. Requires ownership or bot.manage.

# `update_bot_outbound_webhook`

```elixir
@spec update_bot_outbound_webhook(
  Req.Request.t(),
  Chatto.Api.V1.UpdateBotOutboundWebhookRequest.t()
) ::
  {:ok, Chatto.Api.V1.UpdateBotOutboundWebhookResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Edits delivery settings or pauses/resumes delivery. Requires ownership or bot.manage.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
