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

# Create Data Source

> Create a new data source.



## OpenAPI

````yaml https://spec.speakeasy.com/syllable/syllable/syllable-sdk-oas-with-code-samples post /api/v1/data_sources/
openapi: 3.1.0
info:
  title: SyllableSDK
  description: >

    # Syllable Platform SDK


    Syllable SDK gives you the power of awesome AI agentry. 🚀


    ## Overview


    The Syllable SDK provides a comprehensive set of tools and APIs to integrate
    powerful AI

    capabilities into your communication applications. Whether you're building
    phone agents, chatbots,

    virtual assistants, or any other AI-driven solutions, Syllable SDK has got
    you covered.


    ## Features


    - **Agent Configuration**: Create and manage agents that can interact with
    users across various 

    channels.

    - **Channel Management**: Configure channels like SMS, web chat, and more to
    connect agents with 

    users.

    - **Custom Messages**: Set up custom messages that agents can deliver as
    greetings or responses.

    - **Conversations**: Track and manage conversations between users and
    agents, including session 

    management.

    - **Tools and Workflows**: Leverage tools and workflows to enhance agent
    capabilities, such as data 

    processing and API calls.

    - **Data Sources**: Integrate data sources to provide agents with additional
    context and 

    information.

    - **Insights and Analytics**: Analyze conversations and sessions to gain
    insights into user 

    interactions.

    - **Permissions and Security**: Manage permissions to control access to
    various features and 

    functionalities.

    - **Language Support**: Define language groups to enable multilingual
    support for agents.

    - **Outbound Campaigns**: Create and manage outbound communication campaigns
    to reach users 

    effectively.

    - **Session Labels**: Label sessions with evaluations of quality and
    descriptions of issues 

    encountered.

    - **Incident Management**: Track and manage incidents related to agent
    interactions.
  version: 0.0.3
servers:
  - url: https://api.syllable.cloud
    description: API server
security: []
tags:
  - name: agents
    description: >-
      Operations related to agent configuration. When a user interacts with
      the           Syllable system, they do so by communicating with an
      agent.           An agent is linked to a prompt, a custom message, and one
      or more channel targets to           define its behavior and capabilities.
      For more information, see           [Console
      docs](https://docs.syllable.ai/workspaces/Agents).
  - name: agents.test
    description: >-
      Operations for testing agents with live text.           These endpoints
      allow sending messages to an agent and receiving its responses.
  - name: channels
    description: >-
      Operations related to channel configuration.           A channel is an
      organization-level point of communication, like a phone number or a
      web           chat. A channel can be associated with an agent by creating
      a channel target linking           them.
  - name: channels.twilio
    description: Operations related to Twilio channel configuration.
  - name: channels.twilio.numbers
    description: >-
      Operations related to setting up phone numbers in Twilio for use
      in           channels.
  - name: channels.targets
    description: >-
      Operations related to channel target configuration. A channel
      target           links a channel to an agent, allowing users to
      communicate with the agent through that           channel. For more
      information, see           [Console
      docs](https://docs.syllable.ai/Resources/Channels).
  - name: conversations
    description: >-
      Operations related to conversations.           A conversation is a record
      of messages between a user and an agent, and is composed of           one
      or more sessions.
  - name: custom_messages
    description: >-
      Operations related to custom message configuration.           A custom
      message is a pre-configured message delivered by an agent as a greeting at
      the           beginning of a conversation. Multiple agents can use the
      same custom mesasage. A custom           message has one or more rules
      defined, which allow for different messages to be           dynamically
      selected and delivered at runtime based on the current time and
      either           date or day of the week. For more information,
      see           [Console docs](https://docs.syllable.ai/Resources/Messages).
  - name: dashboards
    description: >-
      Operations related to dashboards. Currently the API/SDK           only
      supports fetching basic information about dashboards.
  - name: data_sources
    description: >-
      Operations related to data sources. A data source is a blob of text
      that           can be made available to an agent's general info tools to
      provide more context to the           agent when generating its responses.
      For more information, see           [Console
      docs](https://docs.syllable.ai/Resources/DataSources).
  - name: directory
    description: Operations related to directory
  - name: events
    description: >-
      Operations related to events. An event represents a specific
      occurrence           during a session. Currently the API/SDK only supports
      fetching logged events.
  - name: incidents
    description: Operations related to incidents.
  - name: insights
    description: >-
      Operations related to insights results. An insight is a tool that
      processes          conversation data to extract information and generate
      reports.
  - name: insights.folders
    description: >-
      Operations related to insights upload folders. An insight folder is
      used          to upload call recordings for insight workflow analysis.
  - name: insights.tools
    description: >-
      Operations related to insights tool configurationss. An insight is a
      tool           that processes conversation data to extract information and
      generate reports.
  - name: insights.workflows
    description: >-
      Operations related to insights workflows. An workflow is series of
      tool           invocations that processes conversation data to extract
      information and generate           reports.
  - name: language_groups
    description: >-
      Operations related to language groups. A language group is a          
      collection of language, voice, and DTMF configuration that can be linked
      to an agent to           define the languages and voices it supports. For
      more information, see           [Console
      docs](https://docs.syllable.ai/Resources/LanguageGroups).
  - name: organizations
    description: Operations related to organizations.
  - name: outbound.campaigns
    description: Operations related to outbound message campaigns
  - name: outbound.batches
    description: Operations related to outbound campaign batches
  - name: permissions
    description: >-
      Operations related to permissions. A permission is a specific          
      capability or access level granted to a user within the Syllable
      system.           Permissions are used to control access to various
      features and functionalities.
  - name: prompts
    description: >-
      Operations related to prompts. A prompt defines the behavior of
      an           agent by delivering instructions to the LLM about how the
      agent should behave.           A prompt can be linked to one or more
      agents. A prompt can also be linked to tools to           allow an agent
      using the prompt to use them. For more information, see           [Console
      docs](https://docs.syllable.ai/Resources/Prompts).
  - name: roles
    description: >-
      Operations related to roles. A role is a collection of
      permissions           that can be assigned to users to control their
      access to various features within the           Syllable system.
  - name: services
    description: >-
      Operations related to service configuration. A service is a collection
      of           tools. You can specify an authentication method and values on
      a service, and any linked           tools will use that auth information
      to generate headers for HTTP calls.
  - name: sessions
    description: >-
      Operations related to sessions. A session is a building block of
      a           conversation. For more information, see           [Console
      docs](https://docs.syllable.ai/workspaces/Sessions).
  - name: session_labels
    description: >-
      Operations related to labeling sessions with evaluations of quality
      and           descriptions of issues the user encountered or other
      details. For more information, see           [Console
      docs](https://docs.syllable.ai/workspaces/Sessions).
  - name: tools
    description: >-
      Operations related to tool configuration. A tool is a function that
      an           agent can call to perform actions like accessing databases,
      making API calls, or           processing data. For an agent to have
      access to a tool, the prompt associated with that           agent should
      be linked to the tool and include instructions to use it. For
      more           information, see [Console
      docs](https://docs.syllable.ai/Resources/Tools).
paths:
  /api/v1/data_sources/:
    post:
      tags:
        - data_sources
      summary: Create Data Source
      description: Create a new data source.
      operationId: data_sources_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSourceCreateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { SyllableSDK } from "syllable-sdk";

            const syllableSDK = new SyllableSDK({
              apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
            });

            async function run() {
              const result = await syllableSDK.dataSources.create({
                name: "Rain",
                description: "Information about rain.",
                labels: [
                  "Weather Info",
                ],
                chunk: false,
                chunkDelimiter: "",
                text: "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
              });

              console.log(result);
            }

            run();
        - lang: python
          label: Python (SDK)
          source: |-
            import os
            from syllable_sdk import SyllableSDK


            with SyllableSDK(
                api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
            ) as ss_client:

                res = ss_client.data_sources.create(request={
                    "name": "Rain",
                    "description": "Information about rain.",
                    "labels": [
                        "Weather Info",
                    ],
                    "chunk": False,
                    "chunk_delimiter": "",
                    "text": "The following are names and addresses of pizza shops.\n\nCool Pizza, 123 Main St.\n\nReally Good Pizza, 456 Water St.\n\nThe Best Pizza, 789 Circle Dr.",
                })

                # Handle response
                print(res)
components:
  schemas:
    DataSourceCreateRequest:
      properties:
        name:
          type: string
          title: Name
          description: >-
            The data source name. Must be unique within suborg. Cannot contain
            whitespace.
          examples:
            - Rain
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description of the data source.
          examples:
            - Information about rain.
        labels:
          items:
            type: string
          type: array
          title: Labels
          description: >-
            Searchable labels for the data source. Can be included in
            agent.prompt_tool_defaults for a given tool to give the agent access
            to data sources with those labels when calling that tool.
          default: []
          examples:
            - - Weather Info
        chunk:
          type: boolean
          title: Chunk
          description: >-
            Whether the content should be split into smaller chunks. (This
            feature is coming in the future - currently this value will always
            be treated as False.)
          examples:
            - false
        chunk_delimiter:
          anyOf:
            - type: string
            - type: 'null'
          title: Chunk Delimiter
          description: >-
            String that should be treated as delimiter between intended chunks.
            (This feature is coming in the future - currently this value will
            always be treated as None.)
          examples:
            - ''
        text:
          type: string
          title: Text
          description: >-
            Information that the data source will provide to the agent accessing
            it. It is recommended to include a sentence at the beginning
            providing context to the LLM for the information in the data source.
          examples:
            - |-
              The following are names and addresses of pizza shops.

              Cool Pizza, 123 Main St.

              Really Good Pizza, 456 Water St.

              The Best Pizza, 789 Circle Dr.
      type: object
      required:
        - name
        - chunk
        - text
      title: DataSourceCreateRequest
      description: Request model to create a data source.
    DataSourceDetailResponse:
      properties:
        name:
          type: string
          title: Name
          description: >-
            The data source name. Must be unique within suborg. Cannot contain
            whitespace.
          examples:
            - Rain
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description of the data source.
          examples:
            - Information about rain.
        labels:
          items:
            type: string
          type: array
          title: Labels
          description: >-
            Searchable labels for the data source. Can be included in
            agent.prompt_tool_defaults for a given tool to give the agent access
            to data sources with those labels when calling that tool.
          default: []
          examples:
            - - Weather Info
        chunk:
          type: boolean
          title: Chunk
          description: >-
            Whether the content should be split into smaller chunks. (This
            feature is coming in the future - currently this value will always
            be treated as False.)
          examples:
            - false
        chunk_delimiter:
          anyOf:
            - type: string
            - type: 'null'
          title: Chunk Delimiter
          description: >-
            String that should be treated as delimiter between intended chunks.
            (This feature is coming in the future - currently this value will
            always be treated as None.)
          examples:
            - ''
        id:
          type: integer
          title: Id
          description: The data source ID.
          examples:
            - 1
        edit_comments:
          anyOf:
            - type: string
            - type: 'null'
          title: Edit Comments
          description: The comments for the most recent edit to the data source
          examples:
            - Added new info
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp of most recent update
        last_updated_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Updated By
          description: Email of the user who last updated the data source
          examples:
            - user@email.com
        text:
          type: string
          title: Text
          description: >-
            Information that the data source will provide to the agent accessing
            it.
      type: object
      required:
        - name
        - chunk
        - id
        - updated_at
        - last_updated_by
        - text
      title: DataSourceDetailResponse
      description: >-
        Metadata about a data source, along with the text. A data source is a
        blob of text that

        can be made available to an agent's general info tools to provide more
        context to the agent when

        generating its responses. For more information, see

        [Console docs](https://docs.syllable.ai/Resources/DataSources).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Syllable-API-Key

````