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

# Create Instagram instance

> Connect an Instagram account to your workspace — the profile that sends and receives DMs.

Pick an example:

- **Unofficial: password login** — Instagram username and password (accept terms).
- **Unofficial: 2FA resume** — when Meta asks for a verification code.
- **Official: link for the customer** — customer completes Meta login via link.
- **Official: Meta credentials now** — Meta signup already done in the browser.
- **Official: your own Meta token (BYOK)** — token, Page ID and IG Business ID you already have.

Scope: **instagram:instances:create**.



## OpenAPI

````yaml /en/instagram-api/api-reference/openapi-instagram.json post /v1/instagram/instances
openapi: 3.0.3
info:
  title: Notifique API — Instagram
  version: 1.0.0
  description: >-
    Send Instagram DMs and manage connections. Authenticate with `Authorization:
    Bearer sk_live_...` or `x-api-key`.
servers:
  - url: https://api.notifique.dev
    description: Production
security:
  - ntfIgBearerAuth: []
  - ntfIgApiKeyHeader: []
tags:
  - name: 'Instagram: instances'
    description: Criar, listar, desconectar e remover conexões Instagram.
  - name: 'Instagram: messages'
    description: Enviar, listar, editar, cancelar, apagar e inbound.
  - name: 'Instagram: comments'
    description: Listr, responder e moderar comentários.
paths:
  /v1/instagram/instances:
    post:
      tags:
        - 'Instagram: instâncias'
      summary: Create Instagram instance
      description: >-
        Connect an Instagram account to your workspace — the profile that sends
        and receives DMs.


        Pick an example:


        - **Unofficial: password login** — Instagram username and password
        (accept terms).

        - **Unofficial: 2FA resume** — when Meta asks for a verification code.

        - **Official: link for the customer** — customer completes Meta login
        via link.

        - **Official: Meta credentials now** — Meta signup already done in the
        browser.

        - **Official: your own Meta token (BYOK)** — token, Page ID and IG
        Business ID you already have.


        Scope: **instagram:instances:create**.
      operationId: ntfIg_createInstance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfIg_CreateInstanceBody'
            examples:
              unofficialPassword:
                summary: 'Unofficial: password login'
                description: Username/password connection. Terms acceptance required.
                value:
                  name: Instagram support
                  acceptInstagramTerms: true
                  auth:
                    mode: password
                    username: your_user
                    password: your_password
                  expectedUsername: your_user
              unofficialTwoFactor:
                summary: 'Unofficial: 2FA resume'
                description: >-
                  When Instagram asks for verification code after
                  username/password.
                value:
                  name: Instagram support
                  acceptInstagramTerms: true
                  auth:
                    mode: password
                    username: your_user
                    password: your_password
                    verificationCode: '123456'
              officialLinkForCustomer:
                summary: 'Official: link for customer Meta login'
                description: Customer opens the link and completes Meta login.
                value:
                  name: Official Instagram
                  mode: OFFICIAL
                  generateShareableLink: true
              officialWithMetaCredentials:
                summary: 'Official: Meta credentials now'
                description: Use when Facebook Login was already completed in the browser.
                value:
                  name: Official Instagram
                  mode: OFFICIAL
                  metaEmbeddedCode: EMBEDDED_SIGNUP_CODE
                  facebookPageId: '123456789012345'
                  igBusinessAccountId: '17841400000000000'
              officialByok:
                summary: 'Official: your own Meta token (BYOK)'
                description: Official line with token and IDs from your Meta account.
                value:
                  name: Instagram BYOK
                  mode: OFFICIAL_BYOK
                  metaAccessToken: EAAG...
                  facebookPageId: '123456789012345'
                  igBusinessAccountId: '17841400000000000'
      responses:
        '200':
          description: Instance criada (ACTIVE ou PENDING com shareableLink).
          content:
            application/json:
              examples:
                active:
                  summary: Conexão ACTIVE
                  value:
                    success: true
                    data:
                      id: inst_abc
                      name: Instagram atendimento
                      status: ACTIVE
                      mode: UNOFFICIAL
                      username: seu_usuario
                      igUserPk: '17841'
                officialShareable:
                  summary: Draft official com link (pending_signup)
                  value:
                    success: true
                    data:
                      id: inst_abc
                      name: Instagram official
                      status: PENDING
                      mode: OFFICIAL
                      connectionKind: META_EMBEDDED
                      instagramOfficialCloud: true
                      connection:
                        status: pending_signup
                        message: >-
                          Open shareableLink.hostedUrl for the customer to
                          complete Meta login.
                      shareableLink:
                        hostedUrl: >-
                          https://api.notifique.dev/w/instance-connect/...?token=...
                        embedUrl: >-
                          https://api.notifique.dev/w/embed/instance-connect/...?token=...
                        publicId: ...
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: inst_abc
                      name:
                        type: string
                        example: Instagram atendimento
                      status:
                        type: string
                        example: ACTIVE
                      mode:
                        type: string
                        example: UNOFFICIAL
                      username:
                        type: string
                        example: seu_usuario
                      igUserPk:
                        type: string
                        example: '17841'
        '400':
          description: Validação ou login failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
              examples:
                terms:
                  summary: Termos
                  value:
                    success: false
                    error: Bad Request
                    message: 'acceptInstagramTerms: true is required.'
                    code: INSTAGRAM_TERMS_REQUIRED
                login:
                  summary: Login
                  value:
                    success: false
                    error: Bad Request
                    message: Login failed
                    code: INSTAGRAM_LOGIN_FAILED
        '402':
          description: Plano expirado ou suspenso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
        '403':
          description: Sem escopo ou limite de instances do plano.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
        '409':
          description: Conta logada ≠ locked/expected (INSTAGRAM_ACCOUNT_MISMATCH).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
              example:
                success: false
                error: Conflict
                code: INSTAGRAM_ACCOUNT_MISMATCH
                message: >-
                  This Instagram account does not match the account locked to
                  this instance. Create a new instance to use a different
                  account.
                data:
                  id: inst_abc
                  status: PENDING
        '428':
          description: 2FA ou desafio de segurança.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
              examples:
                twoFactor:
                  summary: 2FA
                  value:
                    success: false
                    error: Authentication Required
                    code: INSTAGRAM_TWO_FACTOR_REQUIRED
                    message: Two-factor authentication required
                challenge:
                  summary: Challenge
                  value:
                    success: false
                    error: Authentication Required
                    code: INSTAGRAM_CHALLENGE_REQUIRED
                    message: Security challenge required
                    data:
                      challenge:
                        step_name: verify_code
        '429':
          description: >-
            Muitas criações em paralelo, cooldown de reconexão
            (INSTAGRAM_RECONNECT_COOLDOWN) ou pause por abuso
            (INSTAGRAM_ABUSE_PAUSE). Pode incluir retryAfterSec.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NtfIg_ErrorResponse'
                  - type: object
                    properties:
                      retryAfterSec:
                        type: integer
                        description: Segundos até poder tentar connect/challenge de novo.
              examples:
                cooldown:
                  summary: Cooldown
                  value:
                    success: false
                    error: Too Many Requests
                    code: INSTAGRAM_RECONNECT_COOLDOWN
                    message: >-
                      Reconnection is temporarily blocked after an involuntary
                      disconnect. Wait before logging in again, or create a new
                      instance.
                    retryAfterSec: 43200
                abuse:
                  summary: Abuse pause
                  value:
                    success: false
                    error: Too Many Requests
                    code: INSTAGRAM_ABUSE_PAUSE
                    message: >-
                      This Instagram account is temporarily paused after an
                      abuse or rate-limit signal.
                    retryAfterSec: 43200
        '503':
          description: Capacidade global de conexões cheia.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfIg_ErrorResponse'
components:
  schemas:
    NtfIg_CreateInstanceBody:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 2
          example: Instagram atendimento
        acceptInstagramTerms:
          type: boolean
          enum:
            - true
          description: >-
            Obrigatório no modo UNOFFICIAL. Confirma ciência do risco de
            restrição pela plataforma.
        mode:
          type: string
          enum:
            - UNOFFICIAL
            - OFFICIAL
            - OFFICIAL_BYOK
          description: >-
            Connection type. **UNOFFICIAL** (default): Instagram login.
            **OFFICIAL**: Meta line. **OFFICIAL_BYOK**: your own Meta token and
            IDs.
          default: UNOFFICIAL
        generateShareableLink:
          type: boolean
          default: false
          description: >-
            Returns a link for someone else to finish Meta connection. Omit when
            sending credentials in this request.
        metaAccessToken:
          type: string
          description: Page Access Token (OFFICIAL_BYOK).
        facebookPageId:
          type: string
          description: Facebook Page ID vinculada à conta IG (OFFICIAL_BYOK).
        igBusinessAccountId:
          type: string
          description: Instagram Business Account ID (OFFICIAL_BYOK).
        metaAppSecret:
          type: string
          description: App Secret Meta para validar webhooks (OFFICIAL_BYOK).
        metaEmbeddedCode:
          type: string
          description: >-
            Código do Facebook Login (OFFICIAL). Alternativa:
            generateShareableLink=true.
        expectedUsername:
          type: string
          description: >-
            Optional. Username esperado no login (conexão unofficial). Se o
            login conectar outra conta, a API responde 409
            (INSTAGRAM_ACCOUNT_MISMATCH).
          example: seu_usuario
        termsVersion:
          type: string
          example: v1
        locale:
          type: string
          example: pt-BR
        timezone:
          type: string
          example: America/Sao_Paulo
        auth:
          type: object
          required:
            - mode
            - username
            - password
          properties:
            mode:
              type: string
              enum:
                - password
            username:
              type: string
            password:
              type: string
              format: password
            verificationCode:
              type: string
              description: Código 2FA quando a API retornou INSTAGRAM_TWO_FACTOR_REQUIRED.
    NtfIg_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        message:
          type: string
        code:
          type: string
        details:
          type: object
          additionalProperties: true
        data:
          type: object
          additionalProperties: true
        retryAfterSec:
          type: integer
          description: >-
            Segundos até poder tentar de novo (presente em 429 de cooldown/abuse
            pause).
  securitySchemes:
    ntfIgBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Authorization: Bearer sk_live_...'
    ntfIgApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````