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

# Issue a link that ties a channel to one of my tenants

> Slack comes back with a `url` to a page that installs the bot. WhatsApp comes back with a `waUrl` — a click-to-chat link that opens the number with a short `joinCode` already written in the box — and with that code on its own, for somebody who would rather type it. The person sends the message, and from that message on the conversation belongs to the tenant. Email sends the invitation from the chosen agent or assistant mailbox and returns its `delivery` status; once accepted, mail from that exact address is attributed to the tenant and subtenant. Links and codes are returned ONCE, here: only their hashes are stored, so a link that is lost is reissued, never recovered.



## OpenAPI

````yaml POST /v1/channels/invites
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Environments
    description: >-
      The machine an agent works on and everything it may reach: sandbox,
      snapshot, knowledge, tools and encrypted variables
  - name: Sandboxes
    description: >-
      Start a real Linux machine on an environment, run commands and files on
      it, and save its snapshot
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
  - name: Integrations
    description: Connect third-party apps and turn them into tools
  - name: Triggers
    description: Start an agent or an assistant from an app event
  - name: Tenant Integrations
    description: Apps that each end user connects for themselves
  - name: Memory
    description: What an assistant remembers between conversations
  - name: Skills
    description: Reusable instruction packs for agents and assistants
  - name: Speech to Text
    description: Audio transcription
  - name: Tenants
    description: Tenants, subtenants and their usage
  - name: MCP Gateway
    description: One MCP endpoint over many servers, with visibility per user
  - name: Tenant Sessions
    description: Tokens that prove which end user is calling
  - name: Workspaces
    description: Shared spaces where people and assistants work in threads
  - name: Workspace Threads
    description: Threads, messages, read state and assistant runs
  - name: Workspace Files
    description: Files and documents of workspaces and threads
  - name: Workspace Configuration
    description: Members, assistants, knowledge, skills and rules
  - name: Workspace Memory
    description: Core memory of the assistants of a workspace
  - name: Workspace Automations
    description: Scheduled and triggered work of a workspace
  - name: Workspace Integrations
    description: >-
      App accounts a workspace can use, and connecting a new one through an
      authorization link.
  - name: Channels
    description: >-
      Attach the places your customers already write from — a WhatsApp number, a
      Slack workspace — to the tenants you already have. The tenant is frozen
      into the link when it is made and never read from a request.
paths:
  /v1/channels/invites:
    post:
      tags:
        - Channels
      summary: Issue a link that ties a channel to one of my tenants
      description: >-
        Slack comes back with a `url` to a page that installs the bot. WhatsApp
        comes back with a `waUrl` — a click-to-chat link that opens the number
        with a short `joinCode` already written in the box — and with that code
        on its own, for somebody who would rather type it. The person sends the
        message, and from that message on the conversation belongs to the
        tenant. Email sends the invitation from the chosen agent or assistant
        mailbox and returns its `delivery` status; once accepted, mail from that
        exact address is attributed to the tenant and subtenant. Links and codes
        are returned ONCE, here: only their hashes are stored, so a link that is
        lost is reissued, never recovered.
      operationId: PublicChannelsV1Controller_createInvite
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChannelInviteDto'
      responses:
        '201':
          description: The link, said once
        '404':
          description: No such app, or no such number
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateChannelInviteDto:
      type: object
      properties:
        tenantId:
          type: string
          description: >-
            The customer this link belongs to. Frozen into the link when it is
            made: whoever opens it decides whether to connect, never to whom.
        subtenantId:
          type: string
          description: >-
            The person inside that customer, when you know which one. Send the
            same id your product already uses for them (for example in the chat
            widget), so every channel attributes to the same person. Without it,
            WhatsApp falls back to the contact id and email to the invited
            address.
        platform:
          type: string
          description: >-
            Which channel. Defaults to slack. Microsoft Teams links are issued
            from the console, not from this endpoint.
          enum:
            - slack
            - whatsapp
            - email
        channelAppId:
          type: string
          description: >-
            The presence the link connects to — a Slack bot or a WhatsApp app.
            Omit for email, which has no installable app.
        accountId:
          type: string
          description: >-
            WhatsApp only, and required there: the connected number the person
            is to write to. The code only works on that number.
        greeting:
          type: string
          description: >-
            WhatsApp only: what the pre-written message says in front of the
            code. The person can edit it before sending, so treat it as a
            suggestion.
        expiresInHours:
          type: integer
          description: How long the link works for. A week by default, a month at most.
          minimum: 1
          maximum: 720
        maxBindings:
          type: number
          description: >-
            How many distinct identities may connect through it: 1 by default,
            20 at most. Always 1 for email.
        requireApproval:
          type: boolean
          description: >-
            Hold what connects as pending until somebody approves it in the
            console. On WhatsApp the person is told they are waiting rather than
            left without an answer.
        purpose:
          type: string
          description: Your own note. Nobody else sees it.
        email:
          type: object
          description: >-
            Required when platform=email. The exact address that will be
            attributed, and the agent or assistant whose mailbox sends the
            invitation. The target is frozen into the link.
          properties:
            targetAddress:
              type: string
              format: email
              description: Exact address that will be attributed.
            senderEntityType:
              type: string
              enum:
                - agent
                - assistant
            senderEntityId:
              type: string
              description: >-
                Identifier of an active agent or assistant that listens on an
                email channel with sending enabled.
          required:
            - targetAddress
            - senderEntityType
            - senderEntityId
        runtimeMetadata:
          type: object
          description: >-
            Persistent runtime metadata, saved when the invitation is created
            and stored on the subtenant when subtenantId is given, otherwise on
            the tenant. Omit to preserve; {} clears. Identity keys are reserved.
            Precedence: request metadata < tenant < subtenant.
        runtimeSecretMetadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            String credentials injected into the same runtime metadata. Stored
            encrypted and returned masked; never included in the link or its
            public page. Omit to preserve; {} clears.
      required:
        - tenantId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from your Devic console, sent as `Authorization: Bearer
        <key>`. An embedded front end sends a tenant-session token instead, so
        no API key reaches the browser, and an OAuth integration sends its
        access token. Missing, invalid or expired credentials get a `401`. See
        [Authentication](/api-reference/introduction#authentication).

````

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