---
title: "Create or replace a personal routine"
---

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

# Create or replace a personal routine

Path: CloudRaker Workspace API › My assistant

`PUT /me/assistant/routines/{routineId}`

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `routineId` (`saveMyAssistantRoutine.path.routineId`; string, required)
  - pattern `^[a-z0-9][a-z0-9-]{0,59}$`

## Request body

_Required._

- `markdown` (`saveMyAssistantRoutine.markdown`; string, required) — The whole `routines/<id>.md` file: frontmatter `name`, `schedule`, `enabled`.
  - minLength 1; maxLength 16000

## Example request

```json
{
  "markdown": "string"
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.cloudraker.com/me/assistant/routines/<routineId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "markdown": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/me/assistant/routines/<routineId>';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({markdown: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/me/assistant/routines/<routineId>"

payload = { "markdown": "string" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Create or replace a personal routine

#### Example

```json
{
  "data": {
    "id": "string",
    "tier": "cloudraker",
    "name": "string",
    "schedule": "string",
    "instruction": "string",
    "enabled": true,
    "markdown": "string",
    "nextRunAt": "2026-10-08T09:00:00-04:00",
    "lastRunAt": "2026-10-08T09:00:00-04:00",
    "lastOutcome": "queued"
  }
}
```

- `data` (`saveMyAssistantRoutine.response.200.data`; object, required)
  - `id` (`saveMyAssistantRoutine.response.200.data.id`; string, required)
  - `tier` (`saveMyAssistantRoutine.response.200.data.tier`; string, required)
    - one of `"cloudraker"`, `"company"`, `"user"`
  - `name` (`saveMyAssistantRoutine.response.200.data.name`; string, required)
  - `schedule` (`saveMyAssistantRoutine.response.200.data.schedule`; string, required)
  - `instruction` (`saveMyAssistantRoutine.response.200.data.instruction`; string, required)
  - `enabled` (`saveMyAssistantRoutine.response.200.data.enabled`; boolean, required)
  - `markdown` (`saveMyAssistantRoutine.response.200.data.markdown`; string, required)
  - `nextRunAt` (`saveMyAssistantRoutine.response.200.data.nextRunAt`; any of, required)
    - any of: `string`, `null`
  - `lastRunAt` (`saveMyAssistantRoutine.response.200.data.lastRunAt`; any of, required)
    - any of: `string`, `null`
  - `lastOutcome` (`saveMyAssistantRoutine.response.200.data.lastOutcome`; any of, required)
    - any of:
      - `string`: one of `"queued"`, `"running"`, `"completed"`, `"failed"`, `"refused"`, `"conflict"`, `"disabled"`
      - `null`

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`saveMyAssistantRoutine.response.400.success`; boolean, required)
  - one of `false`
- `error` (`saveMyAssistantRoutine.response.400.error`; array<unknown>, required)
- `data` (`saveMyAssistantRoutine.response.400.data`; unknown, required)

### 403

An active personal account is required.

### 404

The resource is unavailable to this user.

### 422

`invalid_routine` or `routine_limit`: the routine cannot be saved.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`saveMyAssistantRoutine.response.422.error`; string, required) — The sentence a human reads.
- `error_code` (`saveMyAssistantRoutine.response.422.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`saveMyAssistantRoutine.response.422.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`saveMyAssistantRoutine.response.422.issues.path`; string, required)
  - `code` (`saveMyAssistantRoutine.response.422.issues.code`; string, required)
  - `message` (`saveMyAssistantRoutine.response.422.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/my-assistant/save-my-assistant-routine/index.md
