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

# Create an auth provider.

> Fills the "Set on provider" fields of one authentication method of a published connector once, for every
connection signed in through the provider. The method must allow auth providers and be an OAuth2 method.
Password field values are write-only. clientId and clientSecret are not accepted (400): where a connector
lets you bring your own OAuth client, it marks those fields "Set on provider" and they go in fieldValues.



## OpenAPI

````yaml /developers/api-reference/openapi.json post /v1/auth-providers
openapi: 3.0.0
info:
  title: Engini API
  version: v1
  description: The Engini public API.
servers:
  - url: https://api.engini.io
security:
  - Bearer: []
  - ApiKey: []
tags:
  - name: Auth
    description: Identify the caller a Developer API request is authenticated as.
  - name: On-prem agents
    description: >-
      Provision and manage agents that run Engini tasks inside a customer's
      network.
  - name: Applications
    description: >-
      Discover the applications (toolkits) available in Engini and their
      connection requirements.
  - name: Tools
    description: Browse and execute the tools exposed by Engini applications.
  - name: Toolsets
    description: Manage toolsets - named groupings of connections and tools.
  - name: McpServers
    description: >-
      Inspect and maintain MCP servers - the account-wide endpoints that expose
      Engini tools and workflows over the Model Context Protocol. Distinct from
      the MCPClient connection kind, which is Engini consuming a third-party MCP
      server.
  - name: Connections
    description: >-
      Manage connections to applications, including OAuth sign-in and
      default-connection selection.
  - name: Triggers
    description: >-
      Create triggers that fire when something changes in a connected app, and
      manage the destinations their events are delivered to.
paths:
  /v1/auth-providers:
    post:
      tags:
        - AuthProviders
      summary: Create an auth provider.
      description: >-
        Fills the "Set on provider" fields of one authentication method of a
        published connector once, for every

        connection signed in through the provider. The method must allow auth
        providers and be an OAuth2 method.

        Password field values are write-only. clientId and clientSecret are not
        accepted (400): where a connector

        lets you bring your own OAuth client, it marks those fields "Set on
        provider" and they go in fieldValues.
      operationId: AuthProviders_Create
      parameters: []
      requestBody:
        x-name: request
        description: The provider to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAuthProviderRequest'
        required: true
        x-position: 1
      responses:
        '200':
          description: The created auth provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthProviderResponse'
        '400':
          description: Bad request - malformed body or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - missing or invalid bearer token or API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - the caller lacks access to the resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - the resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests - rate limit exceeded.
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error - an unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - Bearer: []
        - ApiKey: []
      x-codeSamples:
        - lang: python
          label: Python
          source: >-
            from engini import Engini


            client = Engini()  # reads ENGINI_API_KEY


            # source_authentication_id is the OAuth2 method id from
            auth_providers.sources()

            # secret slots are write-only: a read returns has_value, never the
            value

            provider = client.auth_providers.create(
                provider_name="Acme Salesforce",
                application_id=17,
                source_authentication_id=2,
                field_values={"Key1": "your-client-id", "Key2": "your-client-secret"},
            )
        - lang: typescript
          label: TypeScript
          source: >-
            import { Engini } from "@engini/sdk";


            const client = new Engini(); // reads ENGINI_API_KEY


            // sourceAuthenticationId is the OAuth2 method id from
            authProviders.sources()

            // secret slots are write-only: a read returns hasValue, never the
            value

            const provider = await client.authProviders.create({
              providerName: "Acme Salesforce",
              applicationId: 17,
              sourceAuthenticationId: 2,
              isDefault: false,
              isSandbox: false,
              fieldValues: { Key1: "your-client-id", Key2: "your-client-secret" },
            });
        - lang: bash
          label: CLI
          source: >-
            # --field-stdin keeps the secret out of your shell history

            echo "your-client-secret" | engini connections auth-providers create
            \
              --app salesforce --name "Acme Salesforce" --field Key1=your-client-id --field-stdin Key2
components:
  schemas:
    CreateAuthProviderRequest:
      type: object
      description: Creates an auth provider.
      additionalProperties: false
      required:
        - providerName
        - applicationId
        - sourceAuthenticationId
        - isDefault
        - isSandbox
      properties:
        providerName:
          type: string
          description: The account's label for the provider.
        applicationId:
          type: integer
          description: The application (published connector) to attach the provider to.
          format: int32
        sourceAuthenticationId:
          type: integer
          description: >-
            The authentication method of that application; it must allow auth
            providers.
          format: int32
        isDefault:
          type: boolean
          description: >-
            Make this the application's default provider; it replaces any other
            default of the application.
        isSandbox:
          type: boolean
          description: Whether the provider is for the vendor's sandbox environment.
        scopesOverride:
          type: string
          description: Scopes that replace the method's own scope option.
          nullable: true
        extraOptions:
          type: string
          description: >-
            Additional non-URL OAuth options as a JSON object of strings (for
            example tenant_id).
          nullable: true
        fieldValues:
          type: object
          description: >-
            Values for the source method's "Set on provider" fields, keyed by
            slot (Key1..Key10, ApiUser, ApiPassword,

            BaseUrl). Password values are write-only.
          nullable: true
          additionalProperties:
            type: string
    AuthProviderResponse:
      type: object
      description: >-
        An account's auth provider for one authentication method of one
        application: the values of the method's

        "Set on provider" connection fields, filled once and used by every
        connection signed in through it.

        A password field's value is write-only and never appears in a response.
      additionalProperties: false
      required:
        - id
        - providerName
        - applicationId
        - sourceAuthenticationId
        - isDefault
        - isSandbox
        - status
        - connectorRemoved
        - noLongerSupported
        - connectionCount
        - fields
        - fieldsNeedReview
      properties:
        id:
          type: integer
          description: Auth provider id.
          format: int32
        providerName:
          type: string
          description: The account's label for the provider.
        applicationId:
          type: integer
          description: The application (published connector) the provider belongs to.
          format: int32
        applicationName:
          type: string
          description: The application's name, when it is still available.
          nullable: true
        applicationLogo:
          type: string
          description: The application's logo file, when it is still available.
          nullable: true
        sourceAuthenticationId:
          type: integer
          description: >-
            The authentication method of the application this provider supplies
            an OAuth client for.
          format: int32
        sourceAuthenticationName:
          type: string
          description: Display name of that authentication method.
          nullable: true
        isDefault:
          type: boolean
          description: >-
            Whether this is the application's default provider: new connections
            to the application preselect it and

            its method. At most one per application.
        isSandbox:
          type: boolean
          description: Whether the provider is for the vendor's sandbox environment.
        status:
          type: integer
          description: 1 = active, 0 = disabled (no new sign-ins).
          format: int32
        scopesOverride:
          type: string
          description: >-
            Scopes that replace the method's own scope option; null keeps the
            method's scopes.
          nullable: true
        extraOptions:
          type: string
          description: Additional non-URL OAuth options as a JSON object of strings.
          nullable: true
        connectorRemoved:
          type: boolean
          description: >-
            True when the application has been removed; the provider can then
            only be deleted.
        noLongerSupported:
          type: boolean
          description: >-
            True when the connector no longer allows auth providers on this
            method. Connections already signed in

            keep working; new sign-ins are refused.
        connectionCount:
          type: integer
          description: Number of connections signed in through this provider.
          format: int32
        fields:
          type: array
          description: >-
            The source method's "Set on provider" connection fields and their
            values on this provider. A password

            field never carries its value - only HasValue.
          items:
            $ref: '#/components/schemas/AuthProviderFieldValue'
        fieldsNeedReview:
          type: boolean
          description: >-
            True when the provider fields need attention: the connector changed
            which fields are set on the provider

            (or whether one is secret) since the values were entered, or a
            required value is missing.
    ErrorResponse:
      type: object
      description: >-
        Unified machine-readable error envelope returned by every non-200
        Developer API response.
      additionalProperties: false
      required:
        - errorCode
        - message
        - requestId
        - timestamp
      properties:
        errorCode:
          type: string
          description: Machine-readable error code identifying the failure.
        message:
          type: string
          description: Human-readable error message.
        requestId:
          type: string
          description: Identifier of the request, for support/correlation.
        timestamp:
          type: string
          description: Timestamp when the error occurred (ISO 8601).
        details:
          type: array
          description: Per-field validation details, when applicable.
          nullable: true
          items:
            $ref: '#/components/schemas/ErrorDetail'
    AuthProviderFieldValue:
      allOf:
        - $ref: '#/components/schemas/AuthProviderFieldDefinition'
        - type: object
          description: >-
            One "Set on provider" field of an auth provider, with its value when
            it is not a secret.
          additionalProperties: false
          properties:
            value:
              type: string
              description: The stored value; always null for a secret field.
              nullable: true
            hasValue:
              type: boolean
              description: Whether a value is stored.
    ErrorDetail:
      type: object
      description: A single field-level error detail within an ErrorResponse.
      additionalProperties: false
      required:
        - field
        - issue
      properties:
        field:
          type: string
          description: Name of the field the issue relates to.
        issue:
          type: string
          description: Description of the issue with the field.
    AuthProviderFieldDefinition:
      type: object
      description: A connection field the connector author marked "Set on provider".
      additionalProperties: false
      required:
        - slot
        - isPassword
        - isRequired
        - isReadOnly
        - inputType
        - minValue
        - maxValue
      properties:
        slot:
          type: string
          description: >-
            The connection slot the value fills: Key1..Key10, ApiUser,
            ApiPassword or BaseUrl.
        label:
          type: string
          description: The field's label.
          nullable: true
        tooltip:
          type: string
          description: Help text for the field.
          nullable: true
        placeholder:
          type: string
          description: Placeholder text for the field.
          nullable: true
        isPassword:
          type: boolean
          description: >-
            A secret - the connector marks the field a password or masks it in
            logs: write-only, stored encrypted,

            never returned.
        isRequired:
          type: boolean
          description: The provider cannot be active without a value.
        isReadOnly:
          type: boolean
          description: The field cannot be edited.
        inputType:
          description: The field's input type.
          oneOf:
            - $ref: '#/components/schemas/AppConnectionFieldInputType'
        minValue:
          type: integer
          description: Minimum (number fields) or minimum length.
          format: int32
        maxValue:
          type: integer
          description: Maximum (number fields) or maximum length.
          format: int32
    AppConnectionFieldInputType:
      type: integer
      description: ''
      x-enumNames:
        - text
        - number
        - list
        - multiline
      enum:
        - 0
        - 1
        - 2
        - 3
  securitySchemes:
    Bearer:
      type: http
      description: Enter your JWT token
      scheme: bearer
      bearerFormat: JWT
    ApiKey:
      type: apiKey
      description: >-
        Opaque Developer API key (prefix `eng_`). Authenticates as the key's
        owner and resolves the account automatically.
      name: x-api-key
      in: header

````

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