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

# Create an integration

> Create an integration

> [!NOTE]
>
> Requires an API key with the `environment:integrations:create` scope. [Learn more about API key scopes](https://nango.dev/docs/reference/backend/http-api/api-keys.md#scopes).

## Use a Nango-managed developer app

To skip registering your own app with the provider, set `credentials` to `{ "type": "NANGO_MANAGED" }`. The integration then uses Nango's [managed developer app](https://nango.dev/docs/guides/auth/auth-guide.md#nango-managed-oauth-apps) for the provider.

```json theme={null}
{
  "provider": "github",
  "unique_key": "github",
  "credentials": { "type": "NANGO_MANAGED" }
}
```

This works for `OAUTH1`, `OAUTH2`, and `APP` providers that Nango has a managed app for. Other providers return a `400`. You can't combine it with `integration_config` or `custom`, and you can't edit the credentials afterwards.

```json Example Response theme={null}
{
  "data": {
    "unique_key": "slack-nango-community",
    "display_name": "Slack",
    "provider": "slack",
    "logo": "http://localhost:3003/images/template-logos/github.svg",
    "missing_fields": [],
    "created_at": "2023-10-16T08:45:26.241Z",
    "updated_at": "2023-10-16T08:45:26.241Z",
  }
}
```


## OpenAPI

````yaml POST /integrations
openapi: 3.1.0
info:
  title: Nango API
  description: Nango API specs used to authorize & sync data with external APIs.
  version: 1.0.0
servers:
  - url: https://api.nango.dev
    description: Production server
  - url: http://localhost:3003
    description: Local server
security:
  - bearerAuth: []
externalDocs:
  url: https://nango.dev/docs/reference/backend/http-api/authentication
paths:
  /integrations:
    post:
      summary: Create an integration
      description: Create an integration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - unique_key
                - provider
              properties:
                unique_key:
                  type: string
                  description: >-
                    A unique integration ID, which you will use in the other API
                    calls to reference this integration.
                provider:
                  type: string
                  description: The provider unique name.
                display_name:
                  type: string
                  description: The integration display name.
                forward_webhooks:
                  type: boolean
                  description: >-
                    Whether to forward webhooks received for this integration.
                    Defaults to true.
                credentials:
                  description: >
                    Developer app credentials for the integration. Omit them to
                    create the integration without credentials and provide them
                    later, either with an update request or per connection at
                    connection time. Set `type` to `NANGO_MANAGED` to use a
                    Nango-managed developer app instead.
                  oneOf:
                    - $ref: '#/components/schemas/IntegrationCredentialsInput'
                    - $ref: >-
                        #/components/schemas/IntegrationNangoManagedCredentialsInput
                integration_config:
                  type: object
                  additionalProperties:
                    type: string
                  description: >
                    Provider-specific configuration for providers that declare
                    an `integration_config` schema (e.g. `private-api-generic`,
                    `aws-sigv4`). Keys and required fields depend on the
                    provider; values are validated against the provider schema.
                custom:
                  type: object
                  additionalProperties:
                    type: string
                  description: >
                    Free-form key-value settings stored on the integration, for
                    providers without an `integration_config` schema. Rejected
                    for providers that declare one; use `integration_config`
                    instead.
      responses:
        '200':
          description: Successfully created an integration
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Integration'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    IntegrationCredentialsInput:
      description: >
        Integration credentials schema accepted in create/update request bodies.
        Only `type` is required: developer app credentials can be omitted at
        creation and supplied later, either with an update request or per
        connection at connection time. Fields left out of an update are kept
        as-is rather than cleared. MCP_OAUTH2 is the exception — static creation
        requires both client_id and client_secret, while dynamic and CIMD
        providers reject those fields because Nango manages them. Optional
        fields must not be null.
      oneOf:
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - OAUTH1
                - OAUTH2
                - TBA
            client_id:
              type: string
              minLength: 1
              maxLength: 255
            client_secret:
              type: string
              minLength: 1
            scopes:
              type: string
              pattern: ^(?:[0-9a-zA-Z:/_.*-]+(,[0-9a-zA-Z:/_.*-]+)*)?$
            webhook_secret:
              type: string
              maxLength: 255
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - APP
            app_id:
              type: string
              minLength: 1
              maxLength: 255
            app_link:
              type: string
              minLength: 1
            private_key:
              type: string
              pattern: >-
                ^-----BEGIN RSA PRIVATE KEY----[\s\S]*-----END RSA PRIVATE
                KEY-----$
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - CUSTOM
            client_id:
              type: string
              minLength: 1
              maxLength: 255
            client_secret:
              type: string
              minLength: 1
            app_id:
              type: string
              minLength: 1
              maxLength: 255
            app_link:
              type: string
              minLength: 1
            private_key:
              type: string
              pattern: >-
                ^-----BEGIN RSA PRIVATE KEY----[\s\S]*-----END RSA PRIVATE
                KEY-----$
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - MCP_OAUTH2_GENERIC
            client_name:
              type: string
              minLength: 1
              maxLength: 255
            client_uri:
              type: string
              description: A URL, or an empty string.
              maxLength: 255
            client_logo_uri:
              type: string
              format: uri
              maxLength: 255
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - MCP_OAUTH2
            client_id:
              type: string
              minLength: 1
              maxLength: 255
            client_secret:
              type: string
              minLength: 1
            scopes:
              type: string
              pattern: ^(?:[0-9a-zA-Z:/_.*-]+([, ]+[0-9a-zA-Z:/_.*-]+)*)?$
    IntegrationNangoManagedCredentialsInput:
      description: >
        Uses a Nango-managed developer app instead of your own credentials. Only
        available when creating an integration for an `OAUTH1`, `OAUTH2`, or
        `APP` provider that Nango has a managed app for. Can't be combined with
        `integration_config` or `custom`, and the credentials can't be edited
        afterwards.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - NANGO_MANAGED
    Integration:
      type: object
      additionalProperties: false
      required:
        - unique_key
        - display_name
        - provider
        - created_at
        - updated_at
      properties:
        unique_key:
          type: string
          description: The integration ID that you created in Nango.
        display_name:
          type: string
          description: The provider display name.
        provider:
          type: string
          description: The Nango API Configuration.
        logo:
          type: string
          description: Absolute path to the logo of this integration (svg)
        created_at:
          type: string
          format: date-time
          description: When it was created
        updated_at:
          type: string
          format: date-time
          description: Last time it was updated
        forward_webhooks:
          type: boolean
          description: >-
            Whether webhooks received from this integration's provider are
            forwarded to your backend.
        missing_fields:
          type: array
          items:
            type: string
          description: >
            Credential fields the integration is missing, e.g.
            `oauth_client_id`. Empty when the integration is fully configured,
            when it uses Nango-provided credentials, or when the auth mode
            collects everything at connection time. Field names only, never
            values.
    StdError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
          properties:
            code:
              type: string
            message:
              type: string
            errors:
              type: array
              items:
                type: object
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An Environment API key from your Nango environment, or an Account API
        key for account-level endpoints.

````

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