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

# Remove Project Source

> Remove a source from a project: soft-delete the source and its records.

Two soft-deletes in one transaction:

- the ``project_sources`` row is marked ``is_active = False``;
- every ``memory_records`` row derived from that source (matched exactly
  on ``source_id``, never heuristically) is marked ``is_active = False``,
  so no orphaned record for this source stays retrievable.

Other sources in the project and the general (project_id IS NULL) pool
are never touched. Returns 404 when the project or the source is not
owned by the authenticated user, so cross-tenant existence is not leaked.

# IDOR AUDIT PASS - project + source ownership and both writes filter by
# the authenticated user_id.



## OpenAPI

````yaml delete /api/v1/projects/{project_id}/sources/{source_id}
openapi: 3.1.0
info:
  title: EDN Memory Engine
  version: 0.1.0
servers:
  - description: EDN evaluation endpoint
    url: https://api.tensorpro.ai
security:
  - EDNApiKey: []
paths:
  /api/v1/projects/{project_id}/sources/{source_id}:
    delete:
      summary: Remove Project Source
      description: >-
        Remove a source from a project: soft-delete the source and its records.


        Two soft-deletes in one transaction:


        - the ``project_sources`` row is marked ``is_active = False``;

        - every ``memory_records`` row derived from that source (matched exactly
          on ``source_id``, never heuristically) is marked ``is_active = False``,
          so no orphaned record for this source stays retrievable.

        Other sources in the project and the general (project_id IS NULL) pool

        are never touched. Returns 404 when the project or the source is not

        owned by the authenticated user, so cross-tenant existence is not
        leaked.


        # IDOR AUDIT PASS - project + source ownership and both writes filter by

        # the authenticated user_id.
      operationId: >-
        remove_project_source_api_v1_projects__project_id__sources__source_id__delete
      parameters:
        - in: path
          name: project_id
          required: true
          schema:
            title: Project Id
            type: string
        - in: path
          name: source_id
          required: true
          schema:
            title: Source Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoveSourceResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    RemoveSourceResponse:
      properties:
        project_id:
          title: Project Id
          type: string
        records_removed:
          title: Records Removed
          type: integer
        source_id:
          title: Source Id
          type: string
        status:
          title: Status
          type: string
      required:
        - source_id
        - project_id
        - status
        - records_removed
      title: RemoveSourceResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    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:
    EDNApiKey:
      description: >-
        EDN API key presented as 'Bearer <key>' in the Authorization header.
        Create and manage keys from the Console.
      in: header
      name: Authorization
      type: apiKey

````