# Dirigible API Base URL: `https://node.dirigible.app/v1` ## Overview The Dirigible API is a REST API over your workspace — notes, folders, image boards, music libraries, documents, tags, and ticket boards. Everything is JSON. The base URL is: https://node.dirigible.app/v1 Every request needs an API key (see Authentication). Responses are the same live data your app sees — a note you create over the API shows up in the app immediately, and vice-versa. ## Authentication Authenticate with an API key in the Authorization header: Authorization: Bearer dg_your_key_here Create keys in the app under Account → API Keys. A key grants full access to your workspace; keep it secret. Keys are shown once at creation — store them safely. Requests without a valid key get 401. ## Errors Errors return a JSON body: { "error": "message" }. Status codes: 400 bad request · 401 missing/invalid key · 404 not found · 500 server error. A successful write returns the created/updated resource; a delete returns { "ok": true }. ## Notes Markdown notes. The note body (markdown) is returned inline on both list and detail. ### List notes `GET /v1/notes` Returns every note in your workspace, newest structure first, with the full markdown body inline on each — no second request needed to read content. Notes are the same objects the app syncs, so a note you create here appears in the app immediately. ```bash curl "https://node.dirigible.app/v1/notes" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "a1b2…", "type": "note", "title": "Inbox", "parentId": null, "tags": ["ideas"], "content": "# Inbox\n- …", "createdAt": "2026-07-01T12:00:00Z", "updatedAt": "2026-07-10T09:00:00Z" } ] ``` ### Get a note `GET /v1/notes/{id}` Returns a single note by id, including its full markdown body. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Note id. | ```bash curl "https://node.dirigible.app/v1/notes/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "id": "a1b2c3d4", "type": "note", "title": "Weekly plan", "parentId": "f9e8…", "tags": ["planning"], "content": "# Week of Jul 14\n- ship the API", "createdAt": "2026-07-14T09:00:00Z", "updatedAt": "2026-07-15T11:20:00Z" } ``` ### Create a note `POST /v1/notes` Creates a note and returns it. It appears in your app immediately. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `title` | body | string | yes | Note title. | | `content` | body | string | no | Markdown body. | | `parentId` | body | string | no | Folder to place it in. | | `tags` | body | string[] | no | Freeform tags. | Example body: ```json { "title": "New note", "content": "# Hello\nfrom the API" } ``` ```bash curl -X POST "https://node.dirigible.app/v1/notes" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "New note", "content": "# Hello\nfrom the API" }' ``` Example response: ```json { "id": "c7d8e9f0", "type": "note", "title": "New note", "parentId": null, "tags": [], "content": "# Hello\nfrom the API", "createdAt": "2026-07-15T14:00:00Z", "updatedAt": "2026-07-15T14:00:00Z" } ``` ### Update a note `PATCH /v1/notes/{id}` Updates title, content, tags, or parent. Fields you omit are left unchanged. Returns the updated note. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Note id. | | `title` | body | string | no | New title. | | `content` | body | string | no | New markdown body. | Example body: ```json { "content": "# Updated\nnew body" } ``` ```bash curl -X PATCH "https://node.dirigible.app/v1/notes/" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "content": "# Updated\nnew body" }' ``` Example response: ```json { "id": "a1b2c3d4", "type": "note", "title": "Weekly plan", "content": "# Updated\nnew body", "updatedAt": "2026-07-15T15:00:00Z" } ``` ### Delete a note `DELETE /v1/notes/{id}` Deletes a note. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Note id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/notes/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ### List a note's images `GET /v1/notes/{id}/images` Returns the images embedded inline in a note (the images referenced from its markdown body), with filename and size. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Note id. | ```bash curl "https://node.dirigible.app/v1/notes//images" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "em1", "filename": "diagram.png", "fileSize": 88213 } ] ``` ### Download a note's images `GET /v1/notes/{id}/images/download` Returns a download link for every image embedded in the note — one short-lived signed URL each. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Note id. | ```bash curl "https://node.dirigible.app/v1/notes//images/download" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "count": 1, "images": [ { "id": "em1", "filename": "diagram.png", "downloadUrl": "https://…/diagram.png?X-Amz-Signature=…" } ] } ``` ## Folders Folders organize your workspace into a tree. Every item (note, board, image board, …) carries a parentId; a folder is just an item other items point at. GET /v1/tree returns the whole hierarchy in one call. ### Get the directory tree `GET /v1/tree` Returns every live item in your workspace — notes, folders, image boards, music libraries, documents, and boards — each with its parentId. This is the directory listing: walk parentId to reconstruct the full folder hierarchy in one request. ```bash curl "https://node.dirigible.app/v1/tree" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "f9e8…", "type": "folder", "title": "Projects", "parentId": null, "starred": false }, { "id": "a1b2…", "type": "note", "title": "Roadmap", "parentId": "f9e8…", "starred": true }, { "id": "b17…", "type": "moodboard", "title": "Interior refs", "parentId": "f9e8…", "starred": false } ] ``` ### List folders `GET /v1/folders` Returns all your folders. Nest items by setting their parentId to a folder's id. ```bash curl "https://node.dirigible.app/v1/folders" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "f9e8…", "type": "folder", "title": "Projects", "parentId": null }, { "id": "a3b4…", "type": "folder", "title": "Archive", "parentId": null } ] ``` ### Get a folder `GET /v1/folders/{id}` Returns one folder by id. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Folder id. | ```bash curl "https://node.dirigible.app/v1/folders/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "id": "f9e8…", "type": "folder", "title": "Projects", "parentId": null } ``` ### Create a folder `POST /v1/folders` Creates a folder and returns it. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `title` | body | string | yes | Folder name. | | `parentId` | body | string | no | Parent folder id. | Example body: ```json { "title": "Projects" } ``` ```bash curl -X POST "https://node.dirigible.app/v1/folders" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Projects" }' ``` Example response: ```json { "id": "f9e8…", "type": "folder", "title": "Projects", "parentId": null } ``` ### Rename or move a folder `PATCH /v1/folders/{id}` Renames a folder (title) or moves it under another folder (parentId). Fields you omit are left unchanged. Returns the updated folder. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Folder id. | | `title` | body | string | no | New name. | | `parentId` | body | string | null | no | Move under this folder, or null for the root. | Example body: ```json { "title": "Active projects", "parentId": null } ``` ```bash curl -X PATCH "https://node.dirigible.app/v1/folders/" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Active projects", "parentId": null }' ``` Example response: ```json { "id": "f9e8…", "type": "folder", "title": "Active projects", "parentId": null } ``` ### Delete a folder `DELETE /v1/folders/{id}` Deletes a folder and everything inside it. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Folder id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/folders/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ## Ticket boards Ticket boards hold tickets. Tickets created via the API appear live in the app. Everything written with an API key is attributed to that key: the key's name appears as the ticket's reporter and as the author of its comments and activity. ### List boards `GET /v1/boards` Returns every ticket board you own. A board is a container for tickets; use its id to reach the tickets under it. Boards are ordinary workspace items, so anything you do here stays in sync with the app. ```bash curl "https://node.dirigible.app/v1/boards" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "54379654-ba90-41d1-b09f-d14c451165fc", "title": "QA", "createdAt": "2026-07-14T03:10:49Z", "updatedAt": "2026-07-14T03:10:50Z" } ] ``` ### List tickets `GET /v1/boards/{id}/tickets` Returns the tickets on a board, ordered by their number. Filter by status, assignee, or text. Each ticket carries its human-readable key (e.g. QA-14), status, priority, assignee, tags, and resolvedAt — when it was finished (done or closed), null while open. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `status` | query | string | no | Filter by status, one or a comma list: backlog · todo · in_progress · blocked · in_review · done · closed. | | `assignee` | query | string | no | Filter by assignee name, or none for unassigned. | | `q` | query | string | no | Text to match in the key, title, or description. | ```bash curl "https://node.dirigible.app/v1/boards//tickets" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "7d26…", "ticketKey": "QA-3", "title": "Flaky: sync test times out", "status": "in_progress", "priority": "high", "assignee": { "type": "human", "name": "marc" }, "tags": ["flaky", "ci"] } ] ``` ### Create a ticket `POST /v1/boards/{id}/tickets` Create a ticket on a board. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `title` | body | string | yes | Ticket title. | | `status` | body | string | no | Default todo. | | `priority` | body | string | no | none|low|medium|high|urgent. Default medium. | | `description` | body | string | no | Markdown. | | `tags` | body | string[] | no | Freeform tags. | | `assignee` | body | object | null | no | { type: human | agent, name }. | Example body: ```json { "title": "Fix the flaky test", "priority": "high" } ``` ```bash curl -X POST "https://node.dirigible.app/v1/boards//tickets" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Fix the flaky test", "priority": "high" }' ``` Example response: ```json { "id": "7d26…", "ticketKey": "QA-3", "title": "Fix the flaky test", "status": "todo", "priority": "high", "assignee": null, "reporter": { "type": "agent", "name": "My script" }, "createdAt": "2026-07-15T14:00:00Z" } ``` ### Update a ticket `PATCH /v1/boards/{id}/tickets/{tid}` Change status, priority, assignee, title, description, or tags. Returns the updated ticket. A status change re-files it in the app instantly. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `tid` | path | string | yes | Ticket id. | | `status` | body | string | no | New status. | Example body: ```json { "status": "in_review" } ``` ```bash curl -X PATCH "https://node.dirigible.app/v1/boards//tickets/" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "status": "in_review" }' ``` Example response: ```json { "id": "7d26…", "ticketKey": "QA-3", "status": "in_review", "updatedAt": "2026-07-15T15:00:00Z" } ``` ### Delete a ticket `DELETE /v1/boards/{id}/tickets/{tid}` Deletes a ticket. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `tid` | path | string | yes | Ticket id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/boards//tickets/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ### Get the thread `GET /v1/boards/{id}/tickets/{tid}/thread` Returns the ticket's append-only activity — events (status changes, assignments) and comments, oldest first. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `tid` | path | string | yes | Ticket id. | ```bash curl "https://node.dirigible.app/v1/boards//tickets//thread" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "e1", "kind": "event", "author": { "type": "human", "name": "marc" }, "body": "opened this ticket", "createdAt": "…" }, { "id": "e2", "kind": "comment", "author": { "type": "human", "name": "marc" }, "body": "repro on CI only", "createdAt": "…" } ] ``` ### Add a comment `POST /v1/boards/{id}/tickets/{tid}/comments` Adds a comment to a ticket's thread. Returns the created comment. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `tid` | path | string | yes | Ticket id. | | `body` | body | string | yes | Comment markdown. | Example body: ```json { "body": "Fixed in #4821 — please verify." } ``` ```bash curl -X POST "https://node.dirigible.app/v1/boards//tickets//comments" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "body": "Fixed in #4821 — please verify." }' ``` Example response: ```json { "id": "e3", "kind": "comment", "author": { "type": "agent", "name": "My script" }, "body": "Fixed in #4821 — please verify.", "createdAt": "2026-07-15T15:10:00Z" } ``` ### Edit a comment `PATCH /v1/boards/{id}/tickets/{tid}/comments/{cid}` Edits a comment's body. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `tid` | path | string | yes | Ticket id. | | `cid` | path | string | yes | Comment id. | | `body` | body | string | yes | New comment markdown. | Example body: ```json { "body": "Fixed in #4821." } ``` ```bash curl -X PATCH "https://node.dirigible.app/v1/boards//tickets//comments/" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "body": "Fixed in #4821." }' ``` Example response: ```json { "ok": true } ``` ### Delete a comment `DELETE /v1/boards/{id}/tickets/{tid}/comments/{cid}` Deletes a comment from a ticket's thread. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `tid` | path | string | yes | Ticket id. | | `cid` | path | string | yes | Comment id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/boards//tickets//comments/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ## Image boards Image boards (moodboards) hold images. To add an image, upload the file first (see Files) and then record it against the board with its returned storage path. ### List image boards `GET /v1/image-boards` Returns your image boards (moodboards). Use a board id to list its images. ```bash curl "https://node.dirigible.app/v1/image-boards" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "b17…", "type": "moodboard", "title": "Interior refs", "parentId": null } ] ``` ### Get an image board `GET /v1/image-boards/{id}` Returns one image board by id. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | ```bash curl "https://node.dirigible.app/v1/image-boards/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "id": "b17…", "type": "moodboard", "title": "Interior refs", "parentId": null } ``` ### Create an image board `POST /v1/image-boards` Creates an image board and returns it. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `title` | body | string | yes | Board name. | | `parentId` | body | string | no | Folder to place it in. | Example body: ```json { "title": "Interior refs" } ``` ```bash curl -X POST "https://node.dirigible.app/v1/image-boards" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Interior refs" }' ``` Example response: ```json { "id": "b17…", "type": "moodboard", "title": "Interior refs", "parentId": null } ``` ### Update an image board `PATCH /v1/image-boards/{id}` Renames a board or moves it (parentId). Returns the updated board. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `title` | body | string | no | New name. | | `parentId` | body | string | null | no | Move under this folder. | Example body: ```json { "title": "Interiors" } ``` ```bash curl -X PATCH "https://node.dirigible.app/v1/image-boards/" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Interiors" }' ``` Example response: ```json { "id": "b17…", "type": "moodboard", "title": "Interiors", "parentId": null } ``` ### Delete an image board `DELETE /v1/image-boards/{id}` Deletes a board and its images. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/image-boards/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ### List images `GET /v1/image-boards/{id}/images` Returns the images on a board, in board order, with their storage paths and dimensions. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | ```bash curl "https://node.dirigible.app/v1/image-boards//images" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "img1", "url": "https://…/x.jpg", "caption": "atrium", "width": 1600, "height": 1067 } ] ``` ### Get an image `GET /v1/image-boards/{id}/images/{imgId}` Returns one image's metadata by id. Image ids come from the list-images response. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `imgId` | path | string | yes | Image id. | ```bash curl "https://node.dirigible.app/v1/image-boards//images/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "id": "img1", "url": "/api/files/…/x.jpg", "caption": "atrium", "width": 1600, "height": 1067 } ``` ### Download an image `GET /v1/image-boards/{id}/images/{imgId}/download` Redirects (302) to a short-lived signed URL for the image file — follow the redirect to get the bytes. Most HTTP clients follow it automatically. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `imgId` | path | string | yes | Image id. | ```bash curl "https://node.dirigible.app/v1/image-boards//images//download" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json 302 Found Location: https://…backblazeb2.com/moodboards/…/x.jpg?X-Amz-Signature=… ``` ### Download all images `GET /v1/image-boards/{id}/images/download` Returns a download link for every image on the board — one short-lived signed URL each. Fetch each link to save the files. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | ```bash curl "https://node.dirigible.app/v1/image-boards//images/download" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "count": 2, "images": [ { "id": "img1", "caption": "atrium", "downloadUrl": "https://…/x.jpg?X-Amz-Signature=…" }, { "id": "img2", "caption": null, "downloadUrl": "https://…/y.jpg?X-Amz-Signature=…" } ] } ``` ### Add images `POST /v1/image-boards/{id}/images` Records one or more images on a board. Upload each file first via POST /v1/files, then pass the returned storagePath and url here (with optional caption and dimensions). Returns the board's updated image list. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `images` | body | object[] | yes | Each: { url, storagePath, caption?, width?, height?, source? }. | Example body: ```json { "images": [ { "url": "/api/files/moodboards/api/…/x.jpg", "storagePath": "moodboards/api/…/x.jpg", "caption": "atrium", "width": 1600, "height": 1067 } ] } ``` ```bash curl -X POST "https://node.dirigible.app/v1/image-boards//images" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "images": [ { "url": "/api/files/moodboards/api/…/x.jpg", "storagePath": "moodboards/api/…/x.jpg", "caption": "atrium", "width": 1600, "height": 1067 } ] }' ``` Example response: ```json [ { "id": "img1", "url": "/api/files/moodboards/api/…/x.jpg", "caption": "atrium", "width": 1600, "height": 1067 } ] ``` ### Delete an image `DELETE /v1/image-boards/{id}/images/{imgId}` Removes an image from a board and deletes its stored file. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Board id. | | `imgId` | path | string | yes | Image id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/image-boards//images/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ## Music libraries Music libraries hold songs. To add a song, upload the audio file first (see Files) and then record it against the library with its returned storage path and metadata. ### List libraries `GET /v1/music` Returns your music libraries. Use a library id to list its songs. ```bash curl "https://node.dirigible.app/v1/music" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "lib1", "type": "music", "title": "Jazz", "parentId": null } ] ``` ### Get a library `GET /v1/music/{id}` Returns one music library by id. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | ```bash curl "https://node.dirigible.app/v1/music/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "id": "lib1", "type": "music", "title": "Jazz", "parentId": null } ``` ### Create a library `POST /v1/music` Creates a music library and returns it. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `title` | body | string | yes | Library name. | | `parentId` | body | string | no | Folder to place it in. | Example body: ```json { "title": "Jazz" } ``` ```bash curl -X POST "https://node.dirigible.app/v1/music" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Jazz" }' ``` Example response: ```json { "id": "lib1", "type": "music", "title": "Jazz", "parentId": null } ``` ### Update a library `PATCH /v1/music/{id}` Renames a library or moves it (parentId). Returns the updated library. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | | `title` | body | string | no | New name. | Example body: ```json { "title": "Jazz & blues" } ``` ```bash curl -X PATCH "https://node.dirigible.app/v1/music/" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Jazz & blues" }' ``` Example response: ```json { "id": "lib1", "type": "music", "title": "Jazz & blues", "parentId": null } ``` ### Delete a library `DELETE /v1/music/{id}` Deletes a library and its songs. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/music/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ### List songs `GET /v1/music/{id}/songs` Returns the songs in a library with their metadata, grouped by album/artist. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | ```bash curl "https://node.dirigible.app/v1/music//songs" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "s1", "title": "So What", "artist": "Miles Davis", "album": "Kind of Blue", "duration": 545 } ] ``` ### Add songs `POST /v1/music/{id}/songs` Records one or more songs in a library. Upload each audio file first via POST /v1/files, then pass the returned storagePath and storageUrl here with the track metadata. Returns the added songs. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | | `songs` | body | object[] | yes | Each: { title, artist?, album?, storagePath, storageUrl?, duration?, fileName?, fileType? }. | Example body: ```json { "songs": [ { "title": "So What", "artist": "Miles Davis", "album": "Kind of Blue", "storagePath": "songs/api/…/sowhat.mp3", "storageUrl": "/api/files/songs/api/…/sowhat.mp3", "duration": 545 } ] } ``` ```bash curl -X POST "https://node.dirigible.app/v1/music//songs" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "songs": [ { "title": "So What", "artist": "Miles Davis", "album": "Kind of Blue", "storagePath": "songs/api/…/sowhat.mp3", "storageUrl": "/api/files/songs/api/…/sowhat.mp3", "duration": 545 } ] }' ``` Example response: ```json { "added": 1, "songs": [ { "id": "s1", "title": "So What", "artist": "Miles Davis", "album": "Kind of Blue", "duration": 545 } ] } ``` ### Download a song `GET /v1/music/{id}/songs/{songId}/download` Redirects (302) to a short-lived signed URL for the audio file — follow the redirect to get the bytes. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | | `songId` | path | string | yes | Song id. | ```bash curl "https://node.dirigible.app/v1/music//songs//download" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json 302 Found Location: https://…backblazeb2.com/…/sowhat.mp3?X-Amz-Signature=… ``` ### Delete a song `DELETE /v1/music/{id}/songs/{songId}` Removes a song from a library and deletes its stored file. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Library id. | | `songId` | path | string | yes | Song id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/music//songs/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ## Documents PDF/EPUB documents in your workspace. To add one, upload the file first (see Files) and then create the document with its returned storage path. ### List documents `GET /v1/documents` Returns the PDF/EPUB documents in your workspace, with format and size. ```bash curl "https://node.dirigible.app/v1/documents" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "d1", "type": "document", "title": "Spec v2", "format": "pdf", "fileSize": 482113 } ] ``` ### Get a document `GET /v1/documents/{id}` Returns one document's metadata. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Document id. | ```bash curl "https://node.dirigible.app/v1/documents/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "id": "d1", "type": "document", "title": "Spec v2", "format": "pdf", "fileSize": 482113 } ``` ### Create a document `POST /v1/documents` Registers a document from a file you've already uploaded via POST /v1/files. Pass the returned documentPath and url along with the format. Returns the created document. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `title` | body | string | yes | Document title. | | `format` | body | string | no | pdf | epub. | | `documentPath` | body | string | no | Storage path from POST /v1/files. | | `documentUrl` | body | string | no | url from POST /v1/files. | | `fileSize` | body | integer | no | Bytes. | | `parentId` | body | string | no | Folder to place it in. | Example body: ```json { "title": "Spec v2", "format": "pdf", "documentPath": "documents/api/…/spec.pdf", "documentUrl": "/api/files/documents/api/…/spec.pdf", "fileSize": 482113 } ``` ```bash curl -X POST "https://node.dirigible.app/v1/documents" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Spec v2", "format": "pdf", "documentPath": "documents/api/…/spec.pdf", "documentUrl": "/api/files/documents/api/…/spec.pdf", "fileSize": 482113 }' ``` Example response: ```json { "id": "d1", "type": "document", "title": "Spec v2", "format": "pdf", "fileSize": 482113 } ``` ### Delete a document `DELETE /v1/documents/{id}` Deletes a document and its stored file. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string | yes | Document id. | ```bash curl -X DELETE "https://node.dirigible.app/v1/documents/" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json { "ok": true } ``` ## Files & uploads Images, songs, and documents are backed by files in storage. Uploading is two steps: (1) ask for a presigned upload URL, (2) PUT the raw bytes to it. Then record the media — add-images, add-songs, or create-document — using the storage path and url returned here. ### Get an upload URL `POST /v1/files` Returns a short-lived presigned URL to upload a file directly to storage, plus the storage path and public url you'll pass when recording the media. Step 1 of 2: after this, PUT the file bytes to uploadUrl with the same Content-Type, then call add-images / add-songs / create-document with the returned storagePath and url. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `filename` | body | string | no | Original filename — its extension is preserved in the storage path. | | `contentType` | body | string | no | MIME type, e.g. image/jpeg. Use the same when you PUT the bytes. | | `kind` | body | string | no | image | song | document — chooses the storage folder. | Example body: ```json { "filename": "atrium.jpg", "contentType": "image/jpeg", "kind": "image" } ``` ```bash curl -X POST "https://node.dirigible.app/v1/files" \ -H "Authorization: Bearer dg_your_key" \ -H "Content-Type: application/json" \ -d '{ "filename": "atrium.jpg", "contentType": "image/jpeg", "kind": "image" }' ``` Example response: ```json { "uploadUrl": "https://s3.us-east-005.backblazeb2.com/…?X-Amz-Signature=…", "path": "moodboards/api/…/atrium.jpg", "url": "/api/files/moodboards/api/…/atrium.jpg", "expiresIn": 3600 } ``` ## Tags & search ### List tags `GET /v1/tags` Returns your tag registry (the tags you've defined, with any colors). ```bash curl "https://node.dirigible.app/v1/tags" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "tag": "ideas", "color": "#4bde80" }, { "tag": "urgent", "color": null } ] ``` ### Search `GET /v1/search` Full-text search across item titles and note bodies in your workspace, most-recently-updated first. Returns a short snippet where the match is in a note body. | Parameter | In | Type | Required | Description | |---|---|---|---|---| | `q` | query | string | yes | Query string. | | `limit` | query | integer | no | Max results (default 50). | ```bash curl "https://node.dirigible.app/v1/search" \ -H "Authorization: Bearer dg_your_key" ``` Example response: ```json [ { "id": "a1", "type": "note", "title": "Sync notes", "snippet": "…the sync bug repro…" }, { "id": "b2", "type": "board", "title": "QA", "snippet": null } ] ```