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

# Create connection provider

> Create a new connection provider that specifies custom OAuth credentials for a connector. Verify that your OAuth app meets the connector's OAuth app settings requirements.



## OpenAPI

````yaml post /connection-providers
openapi: 3.0.3
info:
  version: 0.1.1
  title: Datagrid API
  description: Datagrid API
servers:
  - url: https://api.datagrid.com/v1
security:
  - BearerAuth: []
paths:
  /connection-providers:
    post:
      tags:
        - Connection Providers
      summary: Create connection provider
      description: >-
        Create a new connection provider that specifies custom OAuth credentials
        for a connector. Verify that your OAuth app meets the connector's OAuth
        app settings requirements.
      operationId: ConnectionProviders.createConnectionProvider
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - connector_id
                - client_id
                - client_secret
              properties:
                name:
                  type: string
                  description: The name of the connection provider.
                  maxLength: 300
                connector_id:
                  type: string
                  description: The connector ID this provider is configured for.
                client_id:
                  type: string
                  description: The OAuth client ID to use for this connector.
                client_secret:
                  type: string
                  description: The OAuth client secret to use for this connector.
      responses:
        '201':
          description: Successfully created connection provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionProvider'
        '429':
          description: >-
            Rate limit exceeded. The request has been throttled because the rate
            limit for this endpoint has been reached. Check the `Retry-After`
            response header and retry after the specified number of seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Datagrid from 'datagrid-ai';

            const client = new Datagrid({
              apiKey: process.env['DATAGRID_API_KEY'], // This is the default and can be omitted
            });

            const connectionProvider = await client.connectionProviders.create({
              client_id: 'client_id',
              client_secret: 'client_secret',
              connector_id: 'connector_id',
              name: 'name',
            });

            console.log(connectionProvider.id);
        - lang: Python
          source: |-
            import os
            from datagrid_ai import Datagrid

            client = Datagrid(
                api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
            )
            connection_provider = client.connection_providers.create(
                client_id="client_id",
                client_secret="client_secret",
                connector_id="connector_id",
                name="name",
            )
            print(connection_provider.id)
components:
  schemas:
    ConnectionProvider:
      type: object
      description: >-
        The `ConnectionProvider` object represents custom OAuth credentials for
        a connector. When creating a connection with a connection provider, the
        specified client ID and secret will be used instead of the default
        credentials.
      required:
        - object
        - id
        - name
        - connector_id
        - client_id
        - client_secret_id
        - created_at
        - updated_at
      properties:
        object:
          type: string
          enum:
            - connection_provider
          description: The object type, which is always `connection_provider`.
        id:
          type: string
          description: The connection provider identifier.
        name:
          type: string
          description: The name of the connection provider.
        connector_id:
          type: string
          description: The connector ID this provider is configured for.
        client_id:
          type: string
          description: The OAuth client ID to use for this connector.
        client_secret_id:
          type: string
          description: >-
            The ID of the secret containing the OAuth client secret to use for
            this connector.
        created_at:
          type: string
          format: date-time
          description: The date and time the connection provider was created.
        updated_at:
          type: string
          format: date-time
          description: The date and time the connection provider was last updated.
    RateLimitError:
      type: object
      description: >-
        Returned when the rate limit is exceeded. Rate limits are enforced per
        teamspace, endpoint path, and HTTP method over a 60-second sliding
        window. Each endpoint may have its own limit — check the
        X-RateLimit-Limit response header for the effective value.
      required:
        - error
        - message
        - retryable
        - status_code
      properties:
        status_code:
          type: integer
          description: The HTTP status code (429).
        statusCode:
          type: integer
          deprecated: true
          description: Deprecated. Use status_code instead.
        error:
          type: string
          enum:
            - rate_limit_exceeded
          description: The error code identifying this as a rate limit error.
        message:
          type: string
          description: A human-readable error message.
        mitigation:
          type: string
          description: Suggested action to resolve the error.
        retryable:
          type: boolean
          description: Whether the request can be retried after a delay.
        details:
          type: object
          properties:
            reason:
              type: string
              description: A detailed explanation of why the rate limit was exceeded.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````