> ## 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.

# Update Project Instructions

> Upsert the per-workspace instructions for a project owned by the user.

The trimmed value is bounded by ``MAX_CUSTOM_INSTRUCTIONS_LENGTH`` (the same
cap as the global instructions store); an over-length value is rejected
with 422 before any write. An empty or null value clears the field (stored
as NULL). ``user_id`` is always the authenticated principal's, never the
body. Returns 404 (not 403) on a missing or cross-tenant project.

# IDOR AUDIT PASS - the write is gated by ensure_project_writable's user_id
# filter and re-filtered by user_id in the WHERE clause.



## OpenAPI

````yaml patch /api/v1/projects/{project_id}/instructions
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}/instructions:
    patch:
      summary: Update Project Instructions
      description: >-
        Upsert the per-workspace instructions for a project owned by the user.


        The trimmed value is bounded by ``MAX_CUSTOM_INSTRUCTIONS_LENGTH`` (the
        same

        cap as the global instructions store); an over-length value is rejected

        with 422 before any write. An empty or null value clears the field
        (stored

        as NULL). ``user_id`` is always the authenticated principal's, never the

        body. Returns 404 (not 403) on a missing or cross-tenant project.


        # IDOR AUDIT PASS - the write is gated by ensure_project_writable's
        user_id

        # filter and re-filtered by user_id in the WHERE clause.
      operationId: >-
        update_project_instructions_api_v1_projects__project_id__instructions_patch
      parameters:
        - in: path
          name: project_id
          required: true
          schema:
            title: Project Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspaceInstructionsUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceInstructionsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    WorkspaceInstructionsUpdate:
      additionalProperties: false
      properties:
        custom_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Instructions
      title: WorkspaceInstructionsUpdate
      type: object
    WorkspaceInstructionsResponse:
      properties:
        custom_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Instructions
      title: WorkspaceInstructionsResponse
      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

````