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

# Retrieve Datasources

> Retrieve a JSON list of all Datasources the user has access to within the specified team.



## OpenAPI

````yaml get /{resourceSlug}/datasources.json
openapi: 3.0.0
info:
  title: Agentcloud Webapp API Docs
  description: The API docs for Agentcloud's webapp.
  version: 0.2.1
servers:
  - url: https://app.agentcloud.dev
    description: Use our public api endpoints!
  - url: '{custom_url}'
    description: Test the endpoints on your own instance of Agent Cloud!
    variables:
      custom_url:
        default: https://app.agentcloud.dev
security: []
tags: []
paths:
  /{resourceSlug}/datasources.json:
    get:
      tags:
        - Datasources
      summary: Retrieve Datasources
      description: >-
        Retrieve a JSON list of all Datasources the user has access to within
        the specified team.
      operationId: datasourcesJson
      parameters:
        - name: resourceSlug
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ObjectId'
          description: >-
            The resourceSlug is a URL parameter of the teamId associated with
            the user.
      responses:
        '200':
          description: >-
            JSON object containing an array of all the models and datasources
            associated with that teamId. Will return empty arrays if the request
            is successful but there is no associated results for that teamId.
          content:
            datasources.json:
              schema:
                properties:
                  datasources:
                    type: array
                    items:
                      $ref: '#/components/schemas/Datasource'
                    description: >-
                      An array object of all the datasources the user has access
                      to
                  models:
                    type: array
                    items:
                      $ref: '#/components/schemas/Model'
                    description: >-
                      An array object of all models the user has access to, this
                      is used to identify the embedding model of the datasource
                      and to have a list of all available embedding models to
                      allow for easy modification of the selected embedding
                      model.
        '403':
          description: >-
            Invalid permissions on the resourceSlug, attempting to access models
            outside the permissions of the team.
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '500':
          description: Internal server error.
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
components:
  schemas:
    ObjectId:
      description: >-
        Mongodb Object id, unique identifier, length of 24 characters fitting
        the following regex; [a-f0-9]{24}
      type: string
    Datasource:
      type: object
      description: >-
        Represents a data source configuration within the system, including
        connection details, status, chunking configurations, and record counts.
      required:
        - name
        - originalName
        - sourceType
        - sourceId
        - destinationId
        - workspaceId
        - connectionId
        - createdDate
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
          description: Unique identifier for the datasource.
        orgId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the organization to which the datasource belongs.
        teamId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the team to which the datasource belongs.
        name:
          description: The name of the datasource.
          type: string
        description:
          description: Optional description of the datasource.
          type: string
        originalName:
          description: The original name of the datasource.
          type: string
        filename:
          description: The name of the file associated with the datasource, if applicable.
          type: string
          nullable: true
        sourceType:
          description: The type of source for the datasource.
          type: string
        sourceId:
          description: The identifier of the data source.
          type: string
        destinationId:
          description: The identifier of the data destination.
          type: string
        workspaceId:
          description: The identifier of the workspace associated with the datasource.
          type: string
        connectionId:
          description: The identifier of the connection associated with the datasource.
          type: string
        recordCount:
          $ref: '#/components/schemas/DatasourceRecordCount'
          description: >-
            The record count details for the datasource, including total,
            successful, and failed records.
        connectionSettings:
          $ref: '#/components/schemas/DatasourceConnectionSettings'
          description: Configuration settings for the datasource connection.
        createdDate:
          description: The date and time when the datasource was created.
          type: string
          format: date-time
        lastSyncedDate:
          description: >-
            The date and time when the datasource was last synced. Null
            indicates it has never been synced.
          type: string
          format: date-time
          nullable: true
        status:
          description: The current status of the datasource.
          type: string
          enum:
            - draft
            - processing
            - embedding
            - ready
        discoveredSchema:
          description: >-
            Schema discovered during the data source connection. The structure
            depends on the source type.
          type: object
          nullable: true
        chunkingConfig:
          $ref: '#/components/schemas/UnstructuredChunkingConfig'
          description: >-
            Configuration settings for chunking unstructured data, including
            partitioning and chunking strategies, character limits, and
            similarity thresholds.
        embeddingField:
          description: The field used for embedding within the datasource.
          type: string
        timeWeightField:
          description: The field used to apply time weighting within the datasource.
          type: string
        modelId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the embedding model used, if applicable.
        hidden:
          description: Indicates whether the datasource is hidden from standard views.
          type: boolean
        streamConfig:
          $ref: '#/components/schemas/StreamConfigMap'
          description: >-
            Configuration settings for processing streams of data, breaking them
            into smaller chunks for more manageable processing.
        timeUnit:
          description: >-
            A temporary field to limit CRON frequency based on the plan. This
            will be replaced with a more robust solution in the future.
          type: string
    Model:
      type: object
      description: Represents an AI model used within a team or organization.
      required:
        - _id
        - orgId
        - teamId
        - name
        - model
        - embeddingLength
        - modelType
        - type
        - config
      properties:
        _id:
          description: Unique identifier for the model.
          type: string
        orgId:
          description: Identifier of the organization to which the model belongs.
          type: string
        teamId:
          description: Identifier of the team to which the model belongs.
          type: string
        name:
          description: The name of the model.
          type: string
        model:
          description: The specific AI model used.
          type: string
        embeddingLength:
          description: The length of the embeddings generated by the model.
          type: integer
        modelType:
          description: The type of the model.
          type: string
        type:
          description: The general type of the model (e.g., embedding, language model).
          type: string
        config:
          type: object
          description: Configuration settings for the model.
          required:
            - model
            - api_key
            - base_url
            - cohere_api_key
            - groq_api_key
          properties:
            model:
              description: The model configuration setting.
              type: string
            api_key:
              description: API key for accessing the model.
              type: string
            base_url:
              description: The base URL for the model's API.
              type: string
            cohere_api_key:
              description: API key for accessing Cohere services.
              type: string
            groq_api_key:
              description: API key for accessing Groq services.
              type: string
    dynamicResponse:
      description: Server response
      properties:
        message:
          type: string
          description: Error message to provide more detail
        code:
          type: integer
          description: the error code
    DatasourceRecordCount:
      type: object
      description: >-
        Represents the record count information for a datasource, including
        total, successful, and failed records.
      properties:
        total:
          description: The total number of records processed.
          type: integer
          format: int32
        success:
          description: The number of successfully processed records.
          type: integer
          format: int32
        failure:
          description: The number of records that failed to process.
          type: integer
          format: int32
    DatasourceConnectionSettings:
      type: object
      description: >-
        Configuration settings for a datasource connection, including
        scheduling, data residency, and namespace details.
      required:
        - prefix
        - name
        - sourceId
        - destinationId
        - status
        - configurations
        - nonBreakingSchemaUpdatesBehavior
      properties:
        prefix:
          description: >-
            Optional prefix to be added to the destination's namespace. Can be
            null.
          type: string
          nullable: true
        name:
          description: The name of the datasource connection.
          type: string
        sourceId:
          description: The identifier of the data source.
          type: string
        destinationId:
          description: The identifier of the data destination.
          type: string
        status:
          description: >-
            The status of the datasource connection. This should match the enum
            values defined by the Airbyte API and should allow creation in a
            paused state.
          type: string
        configurations:
          description: >-
            Configuration settings for the datasource connection. Structure is
            dependent on the datasource type.
          type: object
        schedule:
          type: object
          description: Scheduling information for the datasource connection.
          properties:
            scheduleType:
              description: The type of schedule for the datasource connection.
              type: string
              enum:
                - cron
                - manual
            cronExpression:
              description: >-
                The CRON expression for scheduling, required if the schedule
                type is 'cron'.
              type: string
              nullable: true
        dataResidency:
          description: Specifies where the data should be stored geographically.
          type: string
          nullable: true
        namespaceDefinition:
          description: Defines how the namespace should be determined for the data.
          type: string
          nullable: true
        namespaceFormat:
          description: The format of the namespace, can be null if not applicable.
          type: string
          nullable: true
        nonBreakingSchemaUpdatesBehavior:
          description: Specifies the behavior for handling non-breaking schema updates.
          type: string
    UnstructuredChunkingConfig:
      type: object
      description: >-
        Configuration for chunking unstructured data, including partitioning and
        chunking strategies, character limits, and similarity thresholds.
      required:
        - partitioning
        - strategy
        - max_characters
        - new_after_n_chars
        - overlap
        - similarity_threshold
        - overlap_all
      properties:
        partitioning:
          $ref: '#/components/schemas/UnstructuredPartitioningStrategy'
          description: The partitioning strategy used for unstructured data.
        strategy:
          $ref: '#/components/schemas/UnstructuredChunkingStrategy'
          description: The chunking strategy used for unstructured data.
        max_characters:
          description: The maximum number of characters allowed per chunk.
          type: integer
          format: int32
        new_after_n_chars:
          description: The number of characters after which a new chunk is created.
          type: integer
          format: int32
        overlap:
          description: The number of characters to overlap between chunks.
          type: integer
          format: int32
        similarity_threshold:
          description: >-
            Threshold for similarity when chunking by similarity, with a value
            between 0.0 and 1.0.
          type: number
          format: float
          minimum: 0
          maximum: 1
        overlap_all:
          description: >-
            Indicates whether to apply overlap to all chunks or only between
            adjacent chunks.
          type: boolean
    StreamConfigMap:
      type: object
      description: A mapping of stream names to their respective configuration settings.
      additionalProperties:
        $ref: '#/components/schemas/StreamConfig'
    UnstructuredPartitioningStrategy:
      type: string
      description: Enum representing the strategy used for unstructured data partitioning.
      enum:
        - auto
        - fast
        - hi_res
        - ocr_only
    UnstructuredChunkingStrategy:
      type: string
      description: Enum representing the strategy used for unstructured data chunking.
      enum:
        - basic
        - by_title
        - by_page
        - by_similarity
    StreamConfig:
      type: object
      description: >-
        Configuration settings for a specific stream, used to break down large
        volumes of data into smaller, manageable chunks for processing.
      required:
        - checkedChildren
        - primaryKey
        - syncMode
        - cursorField
        - descriptionsMap
      properties:
        checkedChildren:
          description: >-
            List of child stream identifiers that are checked for inclusion in
            the sync.
          type: array
          items:
            type: string
        primaryKey:
          description: List of fields that make up the primary key for the stream.
          type: array
          items:
            type: string
        syncMode:
          description: The synchronization mode used for the stream.
          type: string
        cursorField:
          description: List of fields that act as the cursor for incremental syncs.
          type: array
          items:
            type: string
        descriptionsMap:
          $ref: '#/components/schemas/FieldDescriptionMap'
          description: A map of field names to their descriptions.
    FieldDescriptionMap:
      type: object
      description: A mapping of field names to their descriptions.
      additionalProperties:
        $ref: '#/components/schemas/FieldDescription'
    FieldDescription:
      type: object
      description: >-
        Provides details about a specific field, including its description and
        type.
      required:
        - description
        - type
      properties:
        description:
          description: A textual description of the field.
          type: string
        type:
          description: The data type of the field.
          type: string

````