Skip to content

Getting project by id #816

Closed
Closed

Description

@mbabatunde

Hi,

I was wondering if it were possible to get a specific project by its id.

If you stored the id somewhere else in a local variable and wanted to use something like server.projects.get() where you pass in the ID, is that possible?

Activity

  1. mbabatunde commented on Mar 12, 2021

    @mbabatunde
    Author

    I've resolved my issue by doing something else, but this would be a nice enhancement if possible

  2. bcantoni commented on Mar 16, 2021

    @bcantoni
    Contributor

    Thanks for the feedback on this. I checked the REST API docs and it looks like project ID is not one of the ways you can filter. I'll mark this as server-side enhancement for the future.

  3. TimothyVermeirenBiztory commented on Oct 23, 2025

    @TimothyVermeirenBiztory

    I know this is old, but this has bugged me many times and I found that there's is actually a very simple way to get a project's data with its ID. So, posting for anyone encountering this in the future.

    So the core issue is: for many content types, there is a convenient endpoint to get information about a specific item. E.g. for workbooks, there is "Get Workbook", where you provide the LUID of the workbook:

    GET /api/<api-version>/sites/<site-id>/workbooks/<workbook-id>

    The same exists for all kinds of content, including views and data sources, but not for projects. Why?! That is unclear. The suggested workaround (like above) is to fetch all projects until you find the right one, but this can be expensive on large environments.

    Now here's what I found: it is perfectly possible to update a project without providing any new information, i.e. no name change, no description change, nothing. The "Update Project" endpoint does work like any other content's update endpoint, and... returns the updated/original information we would have expected from "Get Project", had it existed.

    So... we can make this request:

    PUT /api/<api-version>/sites/<site-id>/projects/<project-id>

    With only this body:

    "project": {
        "id": <project-id>
    }
    

    And... tada! We get the original project information back, because we did not change anything:

    {"project": {"owner": {"id": "b8e68e16-e185-45c6-83c3-2306dd1ddbbc"}, "id": "fd0f8563-e01f-4fee-8940-cb2de3a2e987", "name": "Project Name", "description": "Hell yeah!", "createdAt": "2025-10-20T12:35:03Z", "updatedAt": "2025-10-20T12:35:03Z", "contentPermissions": "ManagedByOwner"}}
    

    And here's what's also great: I thought this would modify the updatedAt timestamp, but it doesn't! The project is effectively returned as-is without any impact (that I am aware of).

    Hope this helps!

  4. added a commit that references this issue on Jan 22, 2026
  5. added 3 commits that reference this issue on Feb 2, 2026
  6. added a commit that references this issue on May 5, 2026
  7. github-actions commented on Aug 6, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.

  8. jacalata commented on Aug 6, 2026

    @jacalata
    Contributor

    Closing — added in PR #1736 (implement #816: project.get_by_id). The REST API itself still has no direct GET endpoint for a single project, so under the hood TSC uses a name-or-id filter; from the caller's perspective the ergonomics match server.projects.get_by_id(project_id).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions