Skip to content

[Future request] Implement API support for Docmost #346

Closed

Description

@fkryczek

I'd like to request API support for Docmost. This API will allow external systems to communicate with Docmost, enabling functions such as automated document generation, external system integration, and remote data retrieval.

Use cases:

  • Integration with third-party applications for automatic document generation.
  • External tools to manage, search, and retrieve documents from Docmost without requiring direct access to the UI.
  • Enabling automated workflows where documents need to be processed and transferred between different services or systems.

Consider integrating such capabilities early in the app development process. It would be wonderful if we could send API queries instead of exchanging records in the database.

Activity

  1. timiil commented on Sep 30, 2024

    @timiil

    yes, we need APIs with create space , create doc, update doc, remove doc, list space doc tree ...

  2. Philipinho commented on Sep 30, 2024

    @Philipinho
    Member

    API Documentation: https://docmost.com/api-docs

    There is an API. It will be documented in the future.

  3. timiil commented on Sep 30, 2024

    @timiil

    There is an API. It will be documented in the future.

    please tell us which API ? we are looking for use apis to update doc, not use websocket. thanks advance!

  4. erictuvesson commented on Oct 29, 2024

    @erictuvesson

    I am also interested in this and it is the most important feature I am looking for. Looking through the code I am not able to find anything for updating the content on a page.

    I found this to update the page name etc, but not anything about content.

    async update(@Body() updatePageDto: UpdatePageDto, @AuthUser() user: User) {

    Having a bit of a hard time navigating the project, I decided to look at how the frontend updates the page content and it is using Tiptap over websocket.

    const provider = new HocuspocusProvider({
    name: documentName,
    url: collaborationURL,
    document: ydoc,
    token: token?.accessToken,
    connect: false,
    });

    <EditorContent editor={editor} />


    There is an API. It will be documented in the future.

    @Philipinho could you provide a little bit more context? Or reopen the issue as it doesn't seem to exist.

  5. jcpsantiago commented on Nov 24, 2024

    @jcpsantiago

    @erictuvesson did you see anything about accessing content? I just want to get a page's Markdown via an API call.

  6. erictuvesson commented on Nov 25, 2024

    @erictuvesson

    @erictuvesson did you see anything about accessing content? I just want to get a page's Markdown via an API call.

    A quick look, it seems you might be able to use this.

    Which I expect would return this:

    I have not looked at authentication.

    Since I didn't get a response on this issue and the lack of support I decided to use another system to meet my requirements.

  7. IcedQuinn commented on Dec 13, 2024

    @IcedQuinn

    This is also something I stumbled in to. Was looking at a game development use case where a script would create a document for each item in a game, allowing the writers to work on descriptions there, and using a script to export & recycle the documents after everything was done.

  8. dockerman2020 commented on Dec 26, 2024

    @dockerman2020

    There is an API. It will be documented in the future.
    @Philipinho, is there any update on this request?
    Docmost is being reviewed and would likely be adopted by my team. Thank you and your team for great software, we need our deployed services to have api endpoints to send reports to.

  9. martinjo commented on Jan 13, 2025

    @martinjo

    @erictuvesson did you see anything about accessing content? I just want to get a page's Markdown via an API call.

    A quick look, it seems you might be able to use this.

    Which I expect would return this:

    I have not looked at authentication.

    Since I didn't get a response on this issue and the lack of support I decided to use another system to meet my requirements.

    What other system did you settle for? I’m also looking for something similar to docmost that I can integrate into other systems.

  10. jcpsantiago commented on Jan 13, 2025

    @jcpsantiago

    I'm also curious about what others are using. At the moment I'm considering falling back to Notion because it has an API and it's possible to allow guests to comment documents for free without accounts.

  11. wienans commented on Feb 15, 2025

    @wienans

    There is an API. It will be documented in the future.

    Is there currently any priority to at least list features of the API with the endpoint names. And maybe the link to the source code to know what object to pass to the endpoint?

    As we search for a solution which we could simultaneously integrate with an AI Agent to search and retrieve information from it it would be crucial to be able to search and retrieve pages

  12. n8himmel commented on Feb 16, 2025

    @n8himmel

    I found this documentation, but didn't have a chance to look into it yet.

    https://www.postman.com/docmost-api

    Would appreciate any comment if it works for you.
    I will certainly post after trying.

  13. paulpv commented on Feb 17, 2025

    @paulpv

    I found this documentation, but didn't have a chance to look into it yet.

    https://www.postman.com/docmost-api

    Would appreciate any comment if it works for you. I will certainly post after trying.

    As is mentioned in #503

  14. 7 remaining items

  15. oliviertripet commented on Apr 13, 2025

    @oliviertripet

    @Philipinho it works like a charm. Many thanks !

  16. me-kirill commented on Apr 27, 2025

    @me-kirill

    @oliviertripet format accepts both markdown and html. You should attach the file as binary. See screenshot below. Make sure the file key comes last in the request.

    How we do it from the frontend

    docmost/apps/client/src/features/page/services/page-service.ts

    Lines 75 to 87 in 49d0f1c

    export async function importPage(file: File, spaceId: string) {
    const formData = new FormData();
    formData.append("spaceId", spaceId);
    formData.append("file", file);

    const req = await api.post("/pages/import", formData, {
    headers: {
    "Content-Type": "multipart/form-data",
    },
    });

    return req.data;
    }

    Postman example

    Image

    Thank you! Can I overwrite existing file using import?

  17. dderichswei commented on Jun 22, 2025

    @dderichswei

    is there a documentation somewhere how to use the API... i found the postman webpage (https://www.postman.com/docmost-api) but already fail at the auth part... with "cannot Post /auth/login (404). i use docmost (vanilla), converted the docker compose file to k8s deployment! I wonder if it might have something to do with the APP_SECRET, but am completely lost at the moment.

  18. der--flo commented on Jun 28, 2025

    @der--flo

    is there a documentation somewhere how to use the API... i found the postman webpage (https://www.postman.com/docmost-api) but already fail at the auth part... with "cannot Post /auth/login (404). i use docmost (vanilla), converted the docker compose file to k8s deployment! I wonder if it might have something to do with the APP_SECRET, but am completely lost at the moment.
    @dderichswei

    Try to add /api/ to your base_url, so the whole url reads https://domain.tld/api/auth/login

  19. ReessKennedy commented on Jul 26, 2025

    @ReessKennedy

    @Benone - I am interested in your question to re: being able to update existing. I suspect it' only for new page content addition since it does not look like it accepts an ID value and this would be necessary for updating content.

  20. ReessKennedy commented on Aug 8, 2025

    @ReessKennedy
    • I tried to create an endpoint in Python to fix this quickly until there is a fully-documented API
    • After investigating DB realized actual content is stored as JSON and not just simple markdown
    • This storage is likely standard for Prosemirror but makes it tough to just create some temporary endpoint as I'd have to parse this json and think through Prosemirror's logic
    • Going to abandon this idea ... Maybe could write a temporary endpoint using Prosemirror's API and Node but just documenting that this hack idea has failed me to save anyone else time that has this idea
    Image
  21. Philipinho commented on Aug 8, 2025

    @Philipinho
    Member

    @ReessKennedy use the page import endpoint to create pages with markdown or html.

  22. ReessKennedy commented on Aug 8, 2025

    @ReessKennedy

    Update: Looks like finally got this working! I had some port blocking because of Cloudflare and now it works but had to used Y.js and websockets and mirror the collab server within app to get it work with external requests!

    @Philipinho ... thanks for the reply. But import only creates a new page with content, right? It does not update an existing page? We're create a bidirectional sync so need a way to update existing content. I was using Python and then hit the Webocket issue of the collaborative editor and then started to use Node to try to get around this but finally hit an error that may be the result of inherent restrictions on making page edits outside the web editor? ... that scripts are restricted in current, default Docmost build? Testing a fully Node-based version and getting "wss://docs.mydomain.com:3001/collab' failed: " in Console ... so maybe this is security blocked?

  23. ReessKennedy commented on Aug 22, 2025

    @ReessKennedy

    See here - https://github.com/tool-ext/docmost-api-bridge

    Using Node, I created a rest-based endpoint just for updating content.

    Until Docmost has a full-featured API you can now just run this on a server somewhere and it will act as a bridge. You can still use the rest of the endpoints in the Postman for all the other operations but if you also need to update, this works.

    Of course, I may have missed something in all this and not needed to do this but I couldn't get IMPORT to work for update and was anxious to try to get it working.

    I just run mine on a little VPS and run it directly on Node 22.x ... it is important to use a newish version of Node, like great than 20. When you run it like this I just added a little .env file to define my IP or domain. The docker-based version might worker but I didn't test it after I got it running directly and it worked fine for my needs.

    The update seems to take a few seconds / not immediate. Unclear why.

  24. Philipinho commented on Feb 13, 2026

    @Philipinho
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions