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

# Add Source

> Add a webhook or poll source of a catalog entry to the stream.

Credentials are write-only and held by reference; a webhook source's
response carries the public URL to give the provider.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspaces/{workspace}/streams/{stream_id}/sources
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/workspaces/{workspace}/streams/{stream_id}/sources:
    post:
      tags:
        - v1
        - protected
        - streams
      summary: Add Source
      description: |-
        Add a webhook or poll source of a catalog entry to the stream.

        Credentials are write-only and held by reference; a webhook source's
        response carries the public URL to give the provider.
      operationId: add_source_v1_streams__stream_id__sources_post
      parameters:
        - in: path
          name: stream_id
          required: true
          schema:
            format: uuid
            title: Stream Id
            type: string
        - description: Slug of the workspace the request acts in
          in: path
          name: workspace
          required: true
          schema:
            description: Slug of the workspace the request acts in
            maxLength: 120
            pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
            title: Workspace
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourceCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceCreated'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    SourceCreate:
      additionalProperties: false
      description: A webhook or poll source of a catalog entry on an existing stream.
      properties:
        config:
          additionalProperties:
            type: string
          description: The type's plain settings, e.g. shop_id.
          title: Config
          type: object
        credentials:
          additionalProperties:
            anyOf:
              - type: string
              - $ref: '#/components/schemas/SecretRef'
          description: >-
            The type's credential fields, each a value or {secret_id} of a
            workspace secret. Write-only: never returned.
          title: Credentials
          type: object
        event_templates:
          anyOf:
            - $ref: '#/components/schemas/EventOverrides'
            - type: 'null'
          description: >-
            This source's own kind, key and session_key templates ({body:a.b},
            {header:x}, {first_key:a|b}), in place of the type's. Without a key
            nothing is deduplicated.
        kind:
          $ref: '#/components/schemas/SourceKind'
          default: webhook
          description: >-
            webhook: the provider posts to the source's URL; poll: the platform
            fetches.
        source_type:
          description: A slug of GET /streams/source-types.
          maxLength: 50
          minLength: 1
          title: Source Type
          type: string
      required:
        - source_type
      title: SourceCreate
      type: object
    SourceCreated:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        event_templates:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: This source's own kind / key / session_key templates.
          title: Event Templates
        id:
          format: uuid
          title: Id
          type: string
        issued:
          additionalProperties:
            type: string
          description: >-
            Credentials generated because they were left out; shown this once
            only.
          title: Issued
          type: object
        kind:
          description: webhook or poll
          title: Kind
          type: string
        poll_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Poll Error
        polled_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Polled At
        registered:
          default: false
          description: >-
            The provider was pointed at webhook_url (entries with a
            registration).
          title: Registered
          type: boolean
        source_type:
          anyOf:
            - type: string
            - type: 'null'
          description: The catalog slug of GET /streams/source-types.
          title: Source Type
        webhook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Id
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          description: Public URL the provider posts to; null for a poll source.
          title: Webhook Url
      required:
        - id
        - kind
        - source_type
        - webhook_id
        - webhook_url
        - created_at
      title: SourceCreated
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SecretRef:
      additionalProperties: false
      description: >-
        A workspace secret named instead of its value; the value stays where it
        is.
      properties:
        secret_id:
          format: uuid
          title: Secret Id
          type: string
      required:
        - secret_id
      title: SecretRef
      type: object
    EventOverrides:
      additionalProperties: false
      description: >-
        What one source may set in place of its entry's templates (a generic
        webhook's own key).
      properties:
        key:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Key
        kind:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Kind
        session_key:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Session Key
      title: EventOverrides
      type: object
    SourceKind:
      enum:
        - webhook
        - poll
        - platform
      title: SourceKind
      type: string
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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