---
title: "POST /bots"
method: POST
path: "/bots"
tags: ["bot"]
---

# POST /bots

`POST /bots`

Botを作成します。

## Request body

- PostBot
  - `name` string, required — botユーザーID。自動的に先頭に"BOT_"が付与されます
  - `displayName` string, required — botユーザーの表示名
  - `description` string, required — botの説明
  - `postUrl` string, url, required — botのPOSTエンドポイント

## Response `201`

正常に作成できました。

- BotDetail
  - `botId` string, uuid — BOT UUID
  - `botUserId` string, uuid — BOTユーザーUUID
  - `description` string — BOT説明
  - `subscribeEvents` string[] — BOTが購読しているイベントの配列
  - `state` integer — BOT状態
  - `creatorId` string, uuid — BOT作成者UUID
  - `createdAt` string, date-time — BOT作成日時
  - `updatedAt` string, date-time — BOT更新日時
  - `verificationCode` string — BOT認証コード
  - `accessToken` string — BOTアクセストークン
  - `postUrl` string, uri — BOTサーバーエンドポイント
  - `privileged` boolean — 権限昇格されているかどうか
  - `botCode` string — BOTインストールコード

## Other responses

- `400` — 作成できませんでした。リクエスト内容が不正です。
- `403` — 作成できませんでした。権限がありません。
- `409` — 作成できませんでした。既に名前が使われています。

## Changes

- **2019-07-24** `66a69a1387ed` — 1 info
  - api operation id `createBots` was added
- **2019-07-22** `d2f7470b1a57` — 2 warning
  - the `displayName` request property's maxLength was set to `32`
  - the `name` request property's maxLength was set to `16`
- **2019-07-05** `6956f2622a20` — 9 info
  - api operation id `createBots` removed and replaced with ``
  - the endpoint scheme security `traqOAuth2` was added to the API
  - endpoint reactivated
  - added optional request body
  - …5 more

[Change history](https://skmtc.dev/traptitech/apis/traq-api/changes/bots/post.md)

---

[API](https://skmtc.dev/traptitech/apis/traq-api.md) · [All operations](https://skmtc.dev/traptitech/apis/traq-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/traptitech/traq-api/revisions/84d2b25db3ba/schema)
