> ## 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.

# Connect one of my accounts

> Connects the account, either outright or by returning a URL to open in a browser popup — `connected` says which happened. Send `accountFields` (see GET /:app/auth) for apps that take an API key; those need no popup at all. `returnTo` must match the origin the request came from; the callback posts the result back to it when the user is done.



## OpenAPI

````yaml POST /v1/tenant-integrations/{app}/connect
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: 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
paths:
  /v1/tenant-integrations/{app}/connect:
    post:
      tags:
        - Tenant Integrations
      summary: Connect one of my accounts
      description: >-
        Connects the account, either outright or by returning a URL to open in a
        browser popup — `connected` says which happened. Send `accountFields`
        (see GET /:app/auth) for apps that take an API key; those need no popup
        at all. `returnTo` must match the origin the request came from; the
        callback posts the result back to it when the user is done.
      operationId: connectMyAccount
      parameters:
        - name: app
          required: true
          in: path
          description: App slug
          schema:
            type: string
        - name: origin
          required: false
          in: header
          schema:
            type: string
          description: Sent by the browser. Used to validate `returnTo`.
        - name: assistantId
          required: false
          in: query
          schema:
            type: string
          description: >-
            Assistant this applies to. Send exactly one of `assistantId` or
            `agentId`.
        - name: agentId
          required: false
          in: query
          schema:
            type: string
          description: >-
            Agent this applies to. Send exactly one of `assistantId` or
            `agentId`.
        - name: tenantId
          required: false
          in: query
          schema:
            type: string
          description: >-
            End-user tenant. Ignored when the call carries a signed tenant
            session, which already names the tenant.
        - name: subtenantId
          required: false
          in: query
          schema:
            type: string
          description: Subtenant within the tenant.
        - name: returnTo
          required: false
          in: query
          schema:
            type: string
          description: >-
            Origin the OAuth popup posts its result back to. Must match the
            request origin.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectMyAccountDto'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectIntegrationResponseDto'
        '401':
          description: Unauthorized - Invalid or missing token
        '429':
          description: Too Many Requests - Rate limit exceeded
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    ConnectMyAccountDto:
      type: object
      properties:
        authScheme:
          type: string
          description: Which scheme to connect through, from GET /:app/auth
          example: API_KEY
        accountFields:
          type: object
          description: What this account supplies, keyed by the scheme's accountFields
          example:
            generic_api_key: fc-…
    ConnectIntegrationResponseDto:
      type: object
      properties:
        connected:
          type: boolean
          description: >-
            True when the account is connected already — API-key apps have
            nothing to authorise, so no browser is involved
        authorizationUrl:
          type: string
          description: >-
            Open this URL in a browser to authorise the account. Absent when
            connected is already true
      required:
        - connected
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use JWT token for authentication

````