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

# Start connecting an Instagram account

> The authorization URL is single use and expires after 15 minutes. The connection result comes
back to the frontend's `/integrations` page as `instagram=connected&instagram_channel=<id>` or
`instagram=error&reason=<error code>`, together with `tenant=<id>`.



## OpenAPI

````yaml /api-referansi/openapi.json post /v1/channels/instagram/connect
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/channels/instagram/connect:
    post:
      tags:
        - ChannelInstagram
      summary: Start connecting an Instagram account
      description: >-
        The authorization URL is single use and expires after 15 minutes. The
        connection result comes

        back to the frontend's `/integrations` page as
        `instagram=connected&instagram_channel=<id>` or

        `instagram=error&reason=<error code>`, together with `tenant=<id>`.
      operationId: channelInstagram.connect
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChannelInstagramConnectRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      authorize_url:
                        type: string
                      expires_at:
                        type: string
                        format: date-time
                    required:
                      - authorize_url
                      - expires_at
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ChannelInstagramConnectRequest:
      type: object
      properties:
        channel_id:
          type:
            - integer
            - 'null'
          description: >-
            The Instagram channel to reconnect. Omit it to connect a new
            account; signing in with an account the clinic already has renews
            that channel instead of creating another.
          minimum: 1
      title: ChannelInstagramConnectRequest
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.flextell.ai/oauth/authorize
          tokenUrl: https://app.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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