---
title: "Create Channel Token"
method: POST
path: "/workspaces/{workspace_id}/agent/channels/tokens"
tags: ["agent-channels"]
---

# Create Channel Token

`POST /workspaces/{workspace_id}/agent/channels/tokens`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/workspaces/{workspace_id}/agent/channels/tokens`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

## Path parameters

- `workspace_id` string, uuid, required

## Request body

- AgentChannelTokenCreate: Request schema for creating an external channel token.
  - `agent_preset_id` string, uuid, required: Preset to link this channel token to
  - `channel_type` 'slack', required: Supported external channel types.
  - `config` SlackChannelTokenConfig, required: Slack channel token configuration.
    - `slack_bot_token` string, required: Slack bot token used for API calls
    - `slack_client_id` string, nullable: Slack app client ID used for OAuth install
    - `slack_client_secret` string, nullable: Slack app client secret used for OAuth install
    - `slack_signing_secret` string, required: Slack signing secret used for request verification
  - `is_active` boolean: Whether this token is active

## Response `201`

Successful Response

- AgentChannelTokenRead: Response schema for an external channel token.
  - `id` string, uuid, required
  - `workspace_id` string, uuid, required
  - `agent_preset_id` string, uuid, required
  - `channel_type` 'slack', required: Supported external channel types.
  - `config` SlackChannelTokenConfig, required: Slack channel token configuration.
    - `slack_bot_token` string, required: Slack bot token used for API calls
    - `slack_client_id` string, nullable: Slack app client ID used for OAuth install
    - `slack_client_secret` string, nullable: Slack app client secret used for OAuth install
    - `slack_signing_secret` string, required: Slack signing secret used for request verification
  - `is_active` boolean, required
  - `public_token` string, required
  - `endpoint_url` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tracecat/apis/tracecat-api.md) - [All operations](https://skmtc.dev/tracecat/apis/tracecat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tracecat/apis/tracecat-api/revisions/2efdda25045f?raw)
