> ## 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 knowledge from connection

> Initiates knowledge creation from a connection by returning a redirect URL. The organization must have enough credits to start this flow. The downstream ingestion and indexing that follow still run asynchronously, and the actual credit consumption remains variable based on the volume of data processed.



## OpenAPI

````yaml post /knowledge/connect
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:
  /knowledge/connect:
    post:
      tags:
        - Knowledge
      summary: Create knowledge from connection
      description: >-
        Initiates knowledge creation from a connection by returning a redirect
        URL. The organization must have enough credits to start this flow. The
        downstream ingestion and indexing that follow still run asynchronously,
        and the actual credit consumption remains variable based on the volume
        of data processed.
      operationId: Knowledge.createKnowledgeFromConnection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - connection_id
              properties:
                connection_id:
                  type: string
                  description: The id of the connection to be used to create the knowledge.
      responses:
        '201':
          description: Successfully generated a redirect URL to start knowledge creation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedirectURLResponse'
        '402':
          description: >-
            Credit limit exceeded. The organization does not have enough credits
            to start this operation. Check your billing status and add credits
            to your account.
        '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 redirectURLResponse = await client.knowledge.connect({
            connection_id: 'connection_id' });


            console.log(redirectURLResponse.redirect_url);
        - 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
            )
            redirect_url_response = client.knowledge.connect(
                connection_id="connection_id",
            )
            print(redirect_url_response.redirect_url)
components:
  schemas:
    RedirectURLResponse:
      type: object
      description: The `redirect_url` object represents a redirect url for a connection.
      required:
        - object
        - redirect_url
      properties:
        object:
          type: string
          enum:
            - redirect_url
        redirect_url:
          type: string
          description: The redirect url for a connection.
    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

````