> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set a Discord channel-to-project mapping

> Create or replace one Discord channel's mapping. Idempotent on (connection, channel). New conversations in the channel and its threads then run in the project; existing conversations keep theirs.



## OpenAPI

````yaml /openapi.json put /integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}
openapi: 3.1.1
info:
  title: Sazabi Public API
  version: 1.0.0
  description: >
    Public REST API for Sazabi. Authenticate using a secret API key in the
    Authorization header.


    ## Pagination


    This API uses two pagination strategies depending on the endpoint type:


    ### Cursor-Based Pagination (List Endpoints)


    List endpoints (threads, messages, keys) use cursor-based pagination for
    efficient, consistent results:


    - **Parameters**: `limit` (items per page, default 50, max 100), `cursor`
    (opaque pagination token)

    - **Response**: Includes `nextCursor` field - pass this as `cursor` in the
    next request

    - **End of results**: When `nextCursor` is `null`, there are no more results

    - **Example**: `GET
    /v1/threads?limit=20&cursor=01234567-89ab-cdef-0123-456789abcdef`


    ### Page-Based Pagination (Search Endpoints)


    Search endpoints use page-based pagination due to the underlying search
    engine:


    - **Parameters**: `limit` (items per page, default 20, max 100), `page`
    (1-indexed page number)

    - **Response**: Includes `pagination` object with `page`, `limit`,
    `totalResults`, `totalPages`

    - **Example**: `GET /v1/search/threads?q=error&limit=10&page=2`
servers:
  - url: https://api.sazabi.com/v1
    description: Production
security: []
paths:
  /integrations/connections/{connectionId}/discord-channel-project-mappings/{discordChannelId}:
    put:
      tags:
        - Integrations
      summary: Set a Discord channel-to-project mapping
      description: >-
        Create or replace one Discord channel's mapping. Idempotent on
        (connection, channel). New conversations in the channel and its threads
        then run in the project; existing conversations keep theirs.
      operationId: integrations.discordChannelProjectMappings.upsert
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              Discord bot integration connection ID (the
              `integration_connections.id`).
        - name: discordChannelId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            description: >-
              Discord channel ID. Must be a text or announcement channel the
              Sazabi bot can see in the connection's server; a thread uses its
              channel's mapping.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
                  minLength: 1
                  description: >-
                    Organization the connection belongs to. Auto-filled from CLI
                    and SDK context when omitted.
                projectId:
                  type: string
                  format: uuid
                  description: >-
                    Project the channel's conversations run in. Must belong to
                    the organization.
              required:
                - projectId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  connectionId:
                    type: string
                    format: uuid
                  discordGuildId:
                    type: string
                    description: The Discord server (guild) the channel belongs to.
                  discordChannelId:
                    type: string
                    description: >-
                      Discord channel ID (a snowflake, e.g.
                      1234567890123456789).
                  discordChannelName:
                    type: string
                    description: >-
                      The channel's name, as Discord named it when the mapping
                      was set.
                  projectId:
                    type: string
                    format: uuid
                required:
                  - connectionId
                  - discordGuildId
                  - discordChannelId
                  - discordChannelName
                  - projectId

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.