### Get Tasks Response Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index An example response for retrieving tasks. This JSON structure shows an array of task items, each with an ID, markdown content, state, and scheduled date. ```json { "items": [ { "id": "1", "markdown": "Review project proposal", "state": "todo", "scheduleDate": "2025-01-15" } ] } ``` -------------------------------- ### Add Task Request Body Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Example JSON request body for creating a new task. It includes the task markdown and optional scheduling information, specifying the location as 'inbox'. ```json { "tasks": [ { "markdown": "Prepare presentation slides", "taskInfo": { "scheduleDate": "tomorrow" }, "location": { "type": "inbox" } } ] } ``` -------------------------------- ### Date Range Search Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Illustrates a search query within a specified date range. The response includes items found within the daily notes between the given start and end dates. ```json { "items": [ { "dailyNoteDate": "2025-01-10", "markdown": "Working on project Alpha" } ] } ``` -------------------------------- ### Update Task Request Body Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Example JSON request body for updating existing tasks. It specifies the task ID and the fields to be modified, such as the task state. ```json { "tasksToUpdate": [ { "id": "1", "taskInfo": { "state": "done" } } ] } ``` -------------------------------- ### Update Task Response Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Sample JSON response after updating tasks. It returns an array of updated task items, reflecting the changes made. ```json { "items": [ { "id": "string", "markdown": "string", "taskInfo": { "state": "todo", "scheduleDate": "2024-01-01", "deadlineDate": "2024-01-01" } } ] } ``` -------------------------------- ### Add Task Response Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Sample JSON response after successfully adding a task. It confirms the creation with details like ID, markdown, task info (state, dates), and location. ```json { "items": [ { "id": "string", "markdown": "string", "taskInfo": { "state": "todo", "scheduleDate": "2024-01-01", "deadlineDate": "2024-01-01" }, "location": { "type": "inbox" } } ] } ``` -------------------------------- ### Delete Task Request Body Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Example JSON request body for deleting tasks. It requires an array of task IDs to be removed. ```json { "idsToDelete": [ "1", "2" ] } ``` -------------------------------- ### Basic Search Example (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Demonstrates a basic search query for the term 'meeting' across daily notes. The response is a JSON object containing an array of items, each with a date and the corresponding markdown content. ```json { "items": [ { "dailyNoteDate": "2025-01-15", "markdown": "Team meeting at 2pm" }, { "dailyNoteDate": "2025-01-12", "markdown": "Sprint planning meeting" } ] } ``` -------------------------------- ### GET /blocks Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Fetches content from daily notes. By default, it returns blocks from today's daily note. The 'date' parameter can be used to fetch content from other dates. ```APIDOC ## GET /blocks ### Description Fetches content from daily notes. By default returns blocks from today's daily note. Use 'date' parameter to fetch from other dates. Use `Accept` header `application/json` for structured data, `text/markdown` for rendered content. ### Method GET ### Endpoint /blocks ### Parameters #### Query Parameters - **date** (string) - Optional - Fetches the root page of a Daily Note for the specified date. Accepts ISO format YYYY-MM-DD or relative dates: 'today', 'tomorrow', 'yesterday'. Defaults to 'today' if both 'date' and 'id' not provided. Mutually exclusive with 'id'. - **id** (string) - Optional - Fetches a specific page block by its ID. Mutually exclusive with 'date'. - **maxDepth** (number) - Optional - The maximum depth of blocks to fetch. Default is -1 (all descendants). - **fetchMetadata** (boolean) - Optional - Whether to fetch metadata (comments, createdBy, lastModifiedBy, lastModifiedAt, createdAt) for the blocks. Default is false. ### Request Example ``` GET /blocks?date=today Accept: application/json ``` ### Response #### Success Response (200) - **content** (array) - Array of fetched blocks. #### Response Example (JSON) ```json { "id": "0", "type": "page", "textStyle": "page", "markdown": "2025.01.15", "content": [ { "id": "1", "type": "text", "textStyle": "h1", "markdown": "# Today's Goals" }, { "id": "2", "type": "text", "markdown": "- Complete project planning" }, { "id": "3", "type": "text", "markdown": "- Review pull requests" } ] } ``` #### Response Example (Markdown) ```markdown # Today's Goals - Complete project planning - Review pull requests ``` ``` -------------------------------- ### GET /collections Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves a list of all collections with their associated metadata. This endpoint is useful for discovering available collections and understanding their basic properties. ```APIDOC ## GET /collections ### Description List of collections with metadata. ### Method GET ### Endpoint /collections ### Parameters #### Query Parameters - **filter_date_start** (string) - Optional - Filter collections created after this date. - **filter_date_end** (string) - Optional - Filter collections created before this date. ### Request Example (No request body needed for GET request) ### Response #### Success Response (200) - **items** (array) - An array of collection objects. - **id** (string) - The unique identifier for the collection. - **name** (string) - The name of the collection. - **itemCount** (number) - The number of items within the collection. - **dailyNoteDate** (string) - The date associated with the collection (e.g., for daily notes). #### Response Example ```json { "items": [ { "id": "41", "name": "Project Tasks", "itemCount": 5, "dailyNoteDate": "2025-01-15" }, { "id": "52", "name": "Meeting Notes", "itemCount": 3, "dailyNoteDate": "2025-01-14" } ] } ``` ``` -------------------------------- ### Get All Collections Metadata Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves a list of all collections along with their metadata such as ID, name, item count, and the date of the last daily note. This is useful for an overview of available collections. ```json { "items": [ { "id": "41", "name": "Project Tasks", "itemCount": 5, "dailyNoteDate": "2025-01-15" }, { "id": "52", "name": "Meeting Notes", "itemCount": 3, "dailyNoteDate": "2025-01-14" } ] } ``` -------------------------------- ### GET /collections/{collectionId}/items Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves all items from a specific collection. You can control the depth of nested content fetched and handle potential collection deletion errors. ```APIDOC ## GET /collections/{collectionId}/items ### Description Retrieve all items from a specific collection. Use the collection ID from the `/collections` endpoint. Each item includes its properties, nested content blocks, and a unique item ID. Backend document changes may cause collections to be deleted (404 errors) - handle gracefully. ### Method GET ### Endpoint /collections/{collectionId}/items ### Parameters #### Path Parameters - **collectionId** (string) - Required - The unique ID of the collection (obtained from /collections endpoint). #### Query Parameters - **maxDepth** (number) - Optional - The maximum depth of nested content to fetch for each collection item. Defaults to -1 (all descendants). A depth of 0 fetches only item properties without nested content. ### Request Example (No request body needed for GET request) ### Response #### Success Response (200) - **items** (array) - An array of item objects within the collection. - **id** (string) - The unique identifier for the item. - **title** (string) - The title of the item. - **properties** (object) - An object containing the item's properties. - **content** (array) - An array of content blocks associated with the item. #### Response Example ```json { "items": [ { "id": "56", "title": "Example Item", "properties": { "status": "Active", "priority": "High", "relation": { "relations": [ { "blockId": "58", "title": "Related Item" } ] }, "linkToBlock": { "title": "Linked Block Title", "reference": { "blockId": "60" } } }, "content": [ { "id": "57", "type": "text", "markdown": "Item description and details" } ] } ] } ``` ``` -------------------------------- ### Get Collection Items Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves all items from a specified collection, including their properties, nested content blocks, and unique item IDs. Supports fetching nested content up to a specified depth. ```json { "items": [ { "id": "56", "title": "Example Item", "properties": { "status": "Active", "priority": "High", "relation": { "relations": [ { "blockId": "58", "title": "Related Item" } ] }, "linkToBlock": { "title": "Linked Block Title", "reference": { "blockId": "60" } } }, "content": [ { "id": "57", "type": "text", "markdown": "Item description and details" } ] } ] } ``` -------------------------------- ### Get Collection Schema (Schema Structure Format) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves the editable schema structure for a collection, detailing its properties, types, and options. This is useful for understanding and modifying the structure of collection data. ```json { "name": "Project Tasks", "properties": [ { "name": "Status", "type": "singleSelect", "options": [ { "name": "To Do" }, { "name": "In Progress" }, { "name": "Done" } ] }, { "name": "Due Date", "type": "date" } ] } ``` -------------------------------- ### GET /collections/{collectionId}/schema Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves the schema for a specific collection. You can request the schema in different formats, including JSON Schema for validation or the collection's structural schema. ```APIDOC ## GET /collections/{collectionId}/schema ### Description Get the schema for a collection by its ID. ### Method GET ### Endpoint /collections/{collectionId}/schema ### Parameters #### Path Parameters - **collectionId** (string) - Required - The unique ID of the collection (obtained from /collections endpoint). #### Query Parameters - **format** (string) - Optional - The format to return the schema in. Defaults to `json-schema-items`. - `json-schema-items`: Returns JSON Schema for validating collection items (use with add/update endpoints). - `schema`: Returns the collection's schema structure (name, properties, types). ### Request Example (No request body needed for GET request) ### Response #### Success Response (200) Collection schema in the requested format. #### Response Example (format=json-schema-items) ```json { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "properties": { "type": "object" } }, "required": [ "title" ] } } }, "required": [ "items" ] } ``` #### Response Example (format=schema) ```json { "name": "Project Tasks", "properties": [ { "name": "Status", "type": "singleSelect", "options": [ { "name": "To Do" }, { "name": "In Progress" }, { "name": "Done" } ] }, { "name": "Due Date", "type": "date" } ] } ``` ``` -------------------------------- ### Get Collections Within Date Range Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves collections that have a daily note within a specified date range. This is useful for filtering collections based on recent activity or specific timeframes. ```json { "items": [ { "id": "41", "name": "Project Tasks", "itemCount": 5, "dailyNoteDate": "2025-01-15" } ] } ``` -------------------------------- ### Get Collection Schema (JSON Schema Items Format) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves the JSON Schema format for a specific collection, used for validating items when adding or updating them. This schema ensures data integrity for collection entries. ```json { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "properties": { "type": "object" } }, "required": [ "title" ] } } }, "required": [ "items" ] } ``` -------------------------------- ### POST /blocks Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Inserts content into a daily note. This endpoint handles both structured blocks via JSON and raw markdown text via Content-Type header negotiation. ```APIDOC ## POST /blocks ### Description Insert content into a daily note. This single endpoint handles both structured blocks and markdown insertion via Content-Type header negotiation. **Content-Type: application/json** - Insert structured block objects with position in request body **Content-Type: text/markdown** - Insert raw markdown text with position specified via query parameter (`?position={"position":"end","date":"today"}`) Returns the inserted blocks with their assigned block IDs for later reference. ### Method POST ### Endpoint /blocks ### Parameters #### Query Parameters - **position** (object) - Optional (required when Content-Type is text/markdown) - Specifies the insertion position. Example: `{"position":"end","date":"today"}`. #### Request Body **Content-Type:** `application/json` - **blocks** (array) - Required - An array of block objects to insert. - **type** (string) - Required - The type of the block (e.g., 'text'). - **markdown** (string) - Required - The markdown content of the block. - **position** (object) - Required - Specifies the insertion position. - **position** (string) - Required - Insertion position (e.g., 'end', 'start', 'afterBlockId', 'beforeBlockId'). - **date** (string) - Optional - The date for the insertion (e.g., 'today'). - **blockId** (string) - Optional - The ID of a block to insert after or before. **Content-Type:** `text/markdown` - Raw markdown text to be inserted. ### Request Example (JSON) ```json { "blocks": [ { "type": "text", "markdown": "## Meeting Notes\n\n- Discussed Q1 goals\n- Action items assigned" } ], "position": { "position": "end", "date": "today" } } ``` ### Request Example (Markdown) ``` POST /blocks?position={"position":"end","date":"today"} Content-Type: text/markdown # New Section - Item 1 - Item 2 ``` ### Response #### Success Response (200) - **insertedBlocks** (array) - An array of the newly inserted blocks with their assigned IDs. ``` -------------------------------- ### Blocks API Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/editor Endpoints for managing blocks, including CRUD operations, moving blocks, and searching. ```APIDOC ## GET /blocks ### Description Retrieves a list of blocks. ### Method GET ### Endpoint /blocks ### Parameters #### Query Parameters - **maxDepth** (integer) - Optional - The maximum depth of blocks to fetch. Default is -1 (all descendants). - **fetchMetadata** (boolean) - Optional - Whether to fetch metadata (comments, createdBy, lastModifiedBy, lastModifiedAt, createdAt) for the blocks. Default is false. ### Response #### Success Response (200) - **blocks** (array) - A list of block objects. #### Response Example { "blocks": [ { "id": "block_id_1", "type": "paragraph", "content": "Example block content" } ] } ## POST /blocks ### Description Creates a new block. ### Method POST ### Endpoint /blocks ### Parameters #### Request Body - **type** (string) - Required - The type of the block (e.g., 'paragraph', 'heading'). - **content** (string) - Optional - The content of the block. - **parentId** (string) - Optional - The ID of the parent block. ### Request Example { "type": "paragraph", "content": "This is a new block." } ### Response #### Success Response (200) - **id** (string) - The ID of the newly created block. #### Response Example { "id": "new_block_id" } ## PUT /blocks ### Description Updates an existing block. ### Method PUT ### Endpoint /blocks ### Parameters #### Request Body - **id** (string) - Required - The ID of the block to update. - **content** (string) - Optional - The new content for the block. ### Request Example { "id": "block_id_to_update", "content": "Updated block content." } ### Response #### Success Response (200) - **message** (string) - A success message indicating the block was updated. #### Response Example { "message": "Block updated successfully." } ## DELETE /blocks ### Description Deletes a block. ### Method DELETE ### Endpoint /blocks ### Parameters #### Request Body - **id** (string) - Required - The ID of the block to delete. ### Request Example { "id": "block_id_to_delete" } ### Response #### Success Response (200) - **message** (string) - A success message indicating the block was deleted. #### Response Example { "message": "Block deleted successfully." } ## PUT /blocks/move ### Description Moves a block to a new parent or position. ### Method PUT ### Endpoint /blocks/move ### Parameters #### Request Body - **id** (string) - Required - The ID of the block to move. - **newParentId** (string) - Optional - The ID of the new parent block. - **position** (integer) - Optional - The new position within the parent. ### Request Example { "id": "block_id_to_move", "newParentId": "new_parent_block_id" } ### Response #### Success Response (200) - **message** (string) - A success message indicating the block was moved. #### Response Example { "message": "Block moved successfully." } ## GET /blocks/search ### Description Searches for blocks based on a query. ### Method GET ### Endpoint /blocks/search ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. ### Response #### Success Response (200) - **results** (array) - A list of blocks matching the search query. #### Response Example { "results": [ { "id": "matching_block_id", "content": "Content matching the query." } ] } ``` -------------------------------- ### Tasks API Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/editor Endpoints for managing tasks, including CRUD operations. ```APIDOC ## GET /tasks ### Description Retrieves a list of tasks. ### Method GET ### Endpoint /tasks ### Response #### Success Response (200) - **tasks** (array) - A list of task objects. #### Response Example { "tasks": [ { "id": "task_id_1", "description": "Example task description", "completed": false } ] } ## POST /tasks ### Description Creates a new task. ### Method POST ### Endpoint /tasks ### Parameters #### Request Body - **description** (string) - Required - The description of the task. ### Request Example { "description": "New task to be done." } ### Response #### Success Response (200) - **id** (string) - The ID of the newly created task. #### Response Example { "id": "new_task_id" } ## PUT /tasks ### Description Updates an existing task. ### Method PUT ### Endpoint /tasks ### Parameters #### Request Body - **id** (string) - Required - The ID of the task to update. - **completed** (boolean) - Optional - The completion status of the task. ### Request Example { "id": "task_id_to_update", "completed": true } ### Response #### Success Response (200) - **message** (string) - A success message indicating the task was updated. #### Response Example { "message": "Task updated successfully." } ## DELETE /tasks ### Description Deletes a task. ### Method DELETE ### Endpoint /tasks ### Parameters #### Request Body - **id** (string) - Required - The ID of the task to delete. ### Request Example { "id": "task_id_to_delete" } ### Response #### Success Response (200) - **message** (string) - A success message indicating the task was deleted. #### Response Example { "message": "Task deleted successfully." } ``` -------------------------------- ### Fetch Blocks from Daily Notes (Markdown) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves content from daily notes as rendered markdown. This format is suitable for direct display or simple text processing. Content can be fetched for specific dates or by block ID. ```markdown # Today's Goals - Complete project planning - Review pull requests ``` -------------------------------- ### Fetch Blocks from Daily Notes (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Retrieves content from daily notes, defaulting to today's note. Supports fetching from specific dates or by block ID. Can return structured JSON or rendered markdown. Metadata fetching is optional. ```json { "id": "0", "type": "page", "textStyle": "page", "markdown": "2025.01.15", "content": [ { "id": "1", "type": "text", "textStyle": "h1", "markdown": "# Today's Goals" }, { "id": "2", "type": "text", "markdown": "- Complete project planning" }, { "id": "3", "type": "text", "markdown": "- Review pull requests" } ] } ``` -------------------------------- ### Search across Daily Notes Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Search content across multiple daily notes using relevance-based ranking. This endpoint uses FlexiSpaceSearch for comprehensive searching within an optional date range. ```APIDOC ## GET /daily-notes/search ### Description Searches content across multiple daily notes using relevance-based ranking. Supports term filtering, optional date range filtering, and returns context blocks before/after each match. ### Method GET ### Endpoint /daily-notes/search ### Query Parameters - **query** (string) - Required - The search query string. - **startDate** (string) - Optional - The start date for the search range (YYYY-MM-DD or relative dates like 'today', 'yesterday'). - **endDate** (string) - Optional - The end date for the search range (YYYY-MM-DD or relative dates like 'today', 'yesterday'). - **beforeBlockCount** (number) - Optional - The number of blocks to include before the matched block. - **afterBlockCount** (number) - Optional - The number of blocks to include after the matched block. ### Response #### Success Response (200) - **items** (array) - An array of search results ranked by relevance. - **dailyNoteDate** (string) - The date of the daily note where the match was found. - **markdown** (string) - The content of the block that matched the search query. - **contextBefore** (array) - Blocks appearing before the match (if requested). - **contextAfter** (array) - Blocks appearing after the match (if requested). #### Response Example ```json { "items": [ { "dailyNoteDate": "2025-01-14", "markdown": "Project Alpha status update.", "contextBefore": [{"markdown": "Daily stand-up notes"}], "contextAfter": [{"markdown": "Next steps defined"}] } ] } ``` ``` -------------------------------- ### Daily Notes API Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/editor Endpoints for retrieving daily notes, either by date or by a specific block ID. ```APIDOC ## GET /daily-notes/search ### Description Fetches the root page of a Daily Note for the specified date or a specific block by its ID. ### Method GET ### Endpoint /daily-notes/search ### Parameters #### Query Parameters - **date** (string) - Optional - Fetches the root page of a Daily Note for the specified date. Accepts ISO format YYYY-MM-DD or relative dates: 'today', 'tomorrow', 'yesterday'. Defaults to 'today' if both 'date' and 'id' not provided. Mutually exclusive with 'id'. - **id** (string) - Optional - Fetches a specific page block by its ID. Use this when you want to retrieve a particular block directly, regardless of which Daily Note it belongs to. Mutually exclusive with 'date'. - **maxDepth** (integer) - Optional - The maximum depth of blocks to fetch. Default is -1 (all descendants). With a depth of 0, only the specified block is fetched. With a depth of 1, only direct children are returned. - **fetchMetadata** (boolean) - Optional - Whether to fetch metadata (comments, createdBy, lastModifiedBy, lastModifiedAt, createdAt) for the blocks. Default is false. ### Response #### Success Response (200) - **block** (object) - The requested block or daily note root page. #### Response Example { "block": { "id": "block_id_or_daily_note_id", "type": "page", "title": "Daily Note Title", "content": "Content of the daily note or block" } } ``` -------------------------------- ### Tasks API Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index Provides endpoints for retrieving, creating, deleting, and updating tasks. Tasks can be filtered by scope and managed across different categories. ```APIDOC ## GET /tasks ### Description Retrieves tasks filtered by scope. Tasks are automatically organized into inbox, active, upcoming, and logbook categories. ### Method GET ### Endpoint /tasks ### Parameters #### Query Parameters - **scope** (string) - Required - Filter tasks by scope: - 'active': Active tasks from inbox and other documents (tasks due before now that are not completed/cancelled) - 'upcoming': Upcoming tasks from inbox and other documents (tasks scheduled after now) - 'inbox': Only tasks in the task inbox - 'logbook': Only tasks in the task logbook (completed and cancelled tasks) ### Response #### Success Response (200) - **items** (array) - Array of tasks. - **id** (string) - The unique identifier of the task. - **markdown** (string) - The content of the task. - **state** (string) - The current state of the task (e.g., 'todo'). - **scheduleDate** (string) - The scheduled date for the task. #### Response Example ```json { "items": [ { "id": "1", "markdown": "Review project proposal", "state": "todo", "scheduleDate": "2025-01-15" } ] } ``` ``` ```APIDOC ## POST /tasks ### Description Create new tasks in inbox or daily notes. Tasks can include schedule dates and deadlines. ### Method POST ### Endpoint /tasks ### Request Body - **tasks** (array) - Required - An array of tasks to create. - **markdown** (string) - Required - The content of the task. - **taskInfo** (object) - Optional - Information about the task's schedule and deadline. - **scheduleDate** (string) - Optional - The date the task should be scheduled. - **deadlineDate** (string) - Optional - The deadline for the task. - **location** (object) - Required - Specifies where the task should be created. - **type** (string) - Required - The type of location (e.g., 'inbox', 'dailyNote'). ### Request Example ```json { "tasks": [ { "markdown": "Prepare presentation slides", "taskInfo": { "scheduleDate": "tomorrow" }, "location": { "type": "inbox" } } ] } ``` ### Response #### Success Response (200) - **items** (array) - Result of the task creation. - **id** (string) - The unique identifier of the created task. - **markdown** (string) - The content of the created task. - **taskInfo** (object) - Information about the created task. - **state** (string) - The state of the task. - **scheduleDate** (string) - The scheduled date of the task. - **deadlineDate** (string) - The deadline date of the task. - **location** (object) - The location where the task was created. - **type** (string) - The type of location. #### Response Example ```json { "items": [ { "id": "string", "markdown": "string", "taskInfo": { "state": "todo", "scheduleDate": "2024-01-01", "deadlineDate": "2024-01-01" }, "location": { "type": "inbox" } } ] } ``` ``` ```APIDOC ## DELETE /tasks ### Description Delete tasks by their IDs. Only tasks in inbox, logbook, or daily notes can be deleted. ### Method DELETE ### Endpoint /tasks ### Request Body - **idsToDelete** (array) - Required - An array of task IDs to delete. - **id** (string) - Required - The ID of the task to delete. ### Request Example ```json { "idsToDelete": [ "1", "2" ] } ``` ### Response #### Success Response (200) - **items** (array) - Result of the task deletion. - **id** (string) - The ID of the deleted task. #### Response Example ```json { "items": [ { "id": "string" } ] } ``` ``` ```APIDOC ## PUT /tasks ### Description Update existing tasks. Can modify task content, state, schedule dates, and deadlines. Marking tasks as done/canceled moves them to logbook. ### Method PUT ### Endpoint /tasks ### Request Body - **tasksToUpdate** (array) - Required - An array of tasks to update. - **id** (string) - Required - The ID of the task to update. - **markdown** (string) - Optional - The new content for the task. - **taskInfo** (object) - Optional - Information about the task's state, schedule, and deadline. - **state** (string) - Optional - The new state of the task (e.g., 'done', 'canceled'). - **scheduleDate** (string) - Optional - The new scheduled date for the task. - **deadlineDate** (string) - Optional - The new deadline for the task. ### Request Example ```json { "tasksToUpdate": [ { "id": "1", "taskInfo": { "state": "done" } } ] } ``` ### Response #### Success Response (200) - **items** (array) - Result of the task update. - **id** (string) - The ID of the updated task. - **markdown** (string) - The updated content of the task. - **taskInfo** (object) - Information about the updated task. - **state** (string) - The state of the task. - **scheduleDate** (string) - The scheduled date of the task. - **deadlineDate** (string) - The deadline date of the task. #### Response Example ```json { "items": [ { "id": "string", "markdown": "string", "taskInfo": { "state": "todo", "scheduleDate": "2024-01-01", "deadlineDate": "2024-01-01" } } ] } ``` ``` -------------------------------- ### Collections API Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/editor Endpoints for managing collections, including retrieving collection schemas and items, and CRUD operations on items. ```APIDOC ## GET /collections ### Description Retrieves a list of all collections. ### Method GET ### Endpoint /collections ### Response #### Success Response (200) - **collections** (array) - A list of collection objects. #### Response Example { "collections": [ { "id": "collection_id_1", "name": "Example Collection" } ] } ## GET /collections/{collectionId}/schema ### Description Retrieves the schema for a specific collection. ### Method GET ### Endpoint /collections/{collectionId}/schema ### Parameters #### Path Parameters - **collectionId** (string) - Required - The ID of the collection. ### Response #### Success Response (200) - **schema** (object) - The schema definition for the collection. #### Response Example { "schema": { "fields": [ { "name": "title", "type": "text" } ] } } ## GET /collections/{collectionId}/items ### Description Retrieves a list of items within a specific collection. ### Method GET ### Endpoint /collections/{collectionId}/items ### Parameters #### Path Parameters - **collectionId** (string) - Required - The ID of the collection. ### Response #### Success Response (200) - **items** (array) - A list of items in the collection. #### Response Example { "items": [ { "id": "item_id_1", "title": "Example Item" } ] } ## POST /collections/{collectionId}/items ### Description Creates a new item within a specific collection. ### Method POST ### Endpoint /collections/{collectionId}/items ### Parameters #### Path Parameters - **collectionId** (string) - Required - The ID of the collection. #### Request Body - **itemData** (object) - Required - The data for the new item, conforming to the collection's schema. ### Request Example { "collectionId": "collection_id_for_item", "itemData": { "title": "New Item" } } ### Response #### Success Response (200) - **id** (string) - The ID of the newly created item. #### Response Example { "id": "new_item_id" } ## PUT /collections/{collectionId}/items ### Description Updates an existing item within a specific collection. ### Method PUT ### Endpoint /collections/{collectionId}/items ### Parameters #### Request Body - **collectionId** (string) - Required - The ID of the collection. - **itemId** (string) - Required - The ID of the item to update. - **itemData** (object) - Required - The updated data for the item. ### Request Example { "collectionId": "collection_id_for_item", "itemId": "item_id_to_update", "itemData": { "title": "Updated Item Title" } } ### Response #### Success Response (200) - **message** (string) - A success message indicating the item was updated. #### Response Example { "message": "Item updated successfully." } ## DELETE /collections/{collectionId}/items ### Description Deletes an item from a specific collection. ### Method DELETE ### Endpoint /collections/{collectionId}/items ### Parameters #### Request Body - **collectionId** (string) - Required - The ID of the collection. - **itemId** (string) - Required - The ID of the item to delete. ### Request Example { "collectionId": "collection_id_for_item", "itemId": "item_id_to_delete" } ### Response #### Success Response (200) - **message** (string) - A success message indicating the item was deleted. #### Response Example { "message": "Item deleted successfully." } ``` -------------------------------- ### Insert Blocks Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index This endpoint is for inserting new blocks into daily notes. It returns an array of the inserted blocks with their newly assigned IDs. ```APIDOC ## POST /websites/connect_craft_do_link_fvbsvrdjakw_v1/blocks ### Description Inserts new blocks into daily notes. Returns an array of the inserted blocks with assigned IDs. ### Method POST ### Endpoint /websites/connect_craft_do_link_fvbsvrdjakw_v1/blocks ### Request Body - **items** (array) - Required - An array of block objects to insert. - **type** (string) - Required - The type of the block (e.g., 'text'). - **textStyle** (string) - Optional - The style of the text block (e.g., 'card'). - **textAlignment** (string) - Optional - The alignment of the text (e.g., 'left'). - **font** (string) - Optional - The font family for the text (e.g., 'system'). - **cardLayout** (string) - Optional - The layout of the card for text blocks (e.g., 'small'). - **markdown** (string) - Optional - The markdown content for text blocks. - **indentationLevel** (number) - Optional - The indentation level for list items. - **listStyle** (string) - Optional - The style of the list (e.g., 'none'). - **decorations** (array) - Optional - Decorations to apply to the block (e.g., ['callout']). - **color** (string) - Optional - The color of the block. - **taskInfo** (object) - Optional - Information related to tasks. - **state** (string) - Required - The state of the task (e.g., 'todo'). - **scheduleDate** (string) - Optional - The scheduled date for the task (YYYY-MM-DD). - **deadlineDate** (string) - Optional - The deadline date for the task (YYYY-MM-DD). - **metadata** (object) - Optional - Metadata for the block. - **lastModifiedAt** (string) - Optional - Timestamp of last modification. - **createdAt** (string) - Optional - Timestamp of creation. - **lastModifiedBy** (string) - Optional - User ID of the last modifier. - **createdBy** (string) - Optional - User ID of the creator. - **comments** (array) - Optional - An array of comment objects. - **id** (string) - Required - Unique identifier for the comment. - **author** (string) - Required - The author of the comment. - **content** (string) - Required - The content of the comment. - **createdAt** (string) - Required - Timestamp of comment creation. ### Request Example ```json { "items": [ { "type": "text", "markdown": "# New Project Idea", "taskInfo": { "state": "todo" } } ] } ``` ### Response #### Success Response (200) - **items** (array) - An array of inserted block objects with assigned IDs. - **type** (string) - The type of the block. - **id** (string) - The unique identifier assigned to the inserted block. - **textStyle** (string) - The style of the text block. - **textAlignment** (string) - The alignment of the text. - **font** (string) - The font family for the text. - **cardLayout** (string) - The layout of the card for text blocks. - **markdown** (string) - The markdown content for text blocks. - **indentationLevel** (number) - The indentation level for list items. - **listStyle** (string) - The style of the list. - **decorations** (array) - Decorations applied to the block. - **color** (string) - The color of the block. - **taskInfo** (object) - Information related to tasks. - **state** (string) - The state of the task. - **scheduleDate** (string) - The scheduled date for the task. - **deadlineDate** (string) - The deadline date for the task. - **metadata** (object) - Metadata for the block. - **lastModifiedAt** (string) - Timestamp of last modification. - **createdAt** (string) - Timestamp of creation. - **lastModifiedBy** (string) - User ID of the last modifier. - **createdBy** (string) - User ID of the creator. - **comments** (array) - An array of comment objects. - **id** (string) - Unique identifier for the comment. - **author** (string) - The author of the comment. - **content** (string) - The content of the comment. - **createdAt** (string) - Timestamp of comment creation. #### Response Example ```json { "items": [ { "type": "text", "id": "generated-block-id-123", "markdown": "# New Project Idea", "taskInfo": { "state": "todo" }, "metadata": { "createdAt": "2023-10-27T10:00:00Z", "lastModifiedAt": "2023-10-27T10:00:00Z" } } ] } ``` ``` -------------------------------- ### Add New Item Response Body (JSON) Source: https://connect.craft.do/link/FVBsVrDjAKW/docs/v1/index This JSON object represents a successful response after adding new items. It returns an array of items, each with an ID, title, and their properties. ```json { "items": [ { "id": "58", "title": "New Item", "properties": { "status": "Active", "priority": "High" } } ] } ```