# Instructions

## Retrieve

**get** `/projects/{projectId}/instructions`

Get the project's assistant instructions (markdown). Returns 404 if not set. Any project member can read.

### Path Parameters

- `projectId: string`

### Returns

- `memory: object { id, content, createdAt, 3 more }`

  Public JSON shape returned by GET endpoints

  - `id: string`

    The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

  - `content: string`

    Markdown content of the memory

  - `createdAt: string`

    ISO 8601 timestamp when the memory was first written

  - `sizeBytes: number`

    UTF-8 byte length of the content — used for quota enforcement

  - `updatedAt: string`

    ISO 8601 timestamp when the memory was last updated

  - `updatedBy: string`

    The userId of the last writer — useful for audit/UI

### Example

```http
curl https://api.cloud.scenario.com/v1/projects/$PROJECT_ID/instructions \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

```json
{
  "memory": {
    "id": "id",
    "content": "content",
    "createdAt": "createdAt",
    "sizeBytes": 0,
    "updatedAt": "updatedAt",
    "updatedBy": "updatedBy"
  }
}
```

## Update

**put** `/projects/{projectId}/instructions`

Set the project's assistant instructions (markdown, max 50KB). Set content to null to clear. Team or project admins only.

### Path Parameters

- `projectId: string`

### Body Parameters

- `content: optional string`

  Markdown content of the memory. Set to null to clear.
  Max size depends on the scope (20-50 KB).

### Returns

- `memory: optional object { id, content, createdAt, 3 more }`

  Public JSON shape returned by GET endpoints

  - `id: string`

    The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

  - `content: string`

    Markdown content of the memory

  - `createdAt: string`

    ISO 8601 timestamp when the memory was first written

  - `sizeBytes: number`

    UTF-8 byte length of the content — used for quota enforcement

  - `updatedAt: string`

    ISO 8601 timestamp when the memory was last updated

  - `updatedBy: string`

    The userId of the last writer — useful for audit/UI

### Example

```http
curl https://api.cloud.scenario.com/v1/projects/$PROJECT_ID/instructions \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

```json
{
  "memory": {
    "id": "id",
    "content": "content",
    "createdAt": "createdAt",
    "sizeBytes": 0,
    "updatedAt": "updatedAt",
    "updatedBy": "updatedBy"
  }
}
```

## Domain Types

### Instruction Retrieve Response

- `InstructionRetrieveResponse object { memory }`

  - `memory: object { id, content, createdAt, 3 more }`

    Public JSON shape returned by GET endpoints

    - `id: string`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: string`

      Markdown content of the memory

    - `createdAt: string`

      ISO 8601 timestamp when the memory was first written

    - `sizeBytes: number`

      UTF-8 byte length of the content — used for quota enforcement

    - `updatedAt: string`

      ISO 8601 timestamp when the memory was last updated

    - `updatedBy: string`

      The userId of the last writer — useful for audit/UI

### Instruction Update Response

- `InstructionUpdateResponse object { memory }`

  - `memory: optional object { id, content, createdAt, 3 more }`

    Public JSON shape returned by GET endpoints

    - `id: string`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: string`

      Markdown content of the memory

    - `createdAt: string`

      ISO 8601 timestamp when the memory was first written

    - `sizeBytes: number`

      UTF-8 byte length of the content — used for quota enforcement

    - `updatedAt: string`

      ISO 8601 timestamp when the memory was last updated

    - `updatedBy: string`

      The userId of the last writer — useful for audit/UI
