### Get Personal Drive Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use GET to retrieve the authenticated user's personal drive (home space). ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/me/drive" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Drive Root Item Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use GET to retrieve the root `driveItem` for a specified drive. ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives/${DRIVE_ID}/root" \ -H "Authorization: Bearer " ``` -------------------------------- ### List User Drives Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use GET to list all drives where the current user is a member. Results can be ordered by `lastModifiedDateTime` in descending order. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/me/drives?%24orderby=lastModifiedDateTime%20desc" \ -H "Authorization: Bearer " ``` -------------------------------- ### List Root Children Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use GET to list the immediate children of the current user's personal drive root. Supports pagination using `@odata.nextLink`. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/me/drive/root/children" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Activities Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves activity records, filterable by KQL queries such as resource ID and depth. Useful for auditing and tracking resource usage. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1beta1/extensions/org.libregraph/activities?kql=resourceid:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668%20depth:2" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Specific Application Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves a specific application by its ID, including its app roles. Requires the APP_ID and an authorization token. ```bash # Get a specific application APP_ID="some-application-uuid" curl -s -X GET \ "https://localhost:9200/graph/v1.0/applications/${APP_ID}" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get DriveItem Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use GET to retrieve a specific file or folder within a drive using its ID. This endpoint is available in `v1beta1`. ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" ITEM_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!share-id" curl -s -X GET \ "https://localhost:9200/graph/v1beta1/drives/${DRIVE_ID}/items/${ITEM_ID}" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Activities Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves activity records filtered by a KQL query (e.g., by resource ID and depth). ```APIDOC ## GET /v1beta1/extensions/org.libregraph/activities ### Description Retrieves activity records filtered by a KQL query (e.g., by resource ID and depth). ### Method GET ### Endpoint /graph/v1beta1/extensions/org.libregraph/activities ### Query Parameters - **kql** (string) - Required - A KQL query string to filter activities. Example: `resourceid:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668%20depth:2` ### Request Example ```bash curl -s -X GET \ "https://localhost:9200/graph/v1beta1/extensions/org.libregraph/activities?kql=resourceid:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668%20depth:2" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **value** (array) - An array of activity objects. - **id** (string) - The unique identifier of the activity. - **times** (object) - Contains timestamps related to the activity. - **recordedTime** (string) - The time the activity was recorded. - **template** (object) - Describes the activity template. - **message** (string) - A template message for the activity. - **variables** (object) - Variables used in the template message. - **user** (object) - Information about the user performing the activity. - **id** (string) - The user's ID. - **displayName** (string) - The user's display name. - **resource** (object) - Information about the resource involved in the activity. - **id** (string) - The resource's ID. - **name** (string) - The resource's name. #### Response Example ```json { "value": [ { "id": "34646ab6-be32-43c9-89e6-987e0c237e9b", "times": { "recordedTime": "2023-09-14T12:27:15" }, "template": { "message": "{user} shared {resource}", "variables": { "user": { "id": "4c510ada-...", "displayName": "Albert Einstein" }, "resource": { "id": "...", "name": "secret stuff" } } } } ] } ``` ``` -------------------------------- ### Get Personal Space Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves the personal drive (home space) for the authenticated user. ```APIDOC ## GET /v1.0/me/drive ### Description Returns the personal drive (home space) for the authenticated user. ### Method GET ### Endpoint /v1.0/me/drive ### Response #### Success Response (200) - **id** (string) - The unique identifier for the drive. - **name** (string) - The name of the drive. - **driveType** (string) - The type of the drive (e.g., 'personal'). - **quota** (object) - Information about the drive's quota. - **total** (integer) - The total quota in bytes. - **used** (integer) - The used quota in bytes. ### Response Example ```json { "id": "1991210caf$1991210caf", "name": "Albert Einstein", "driveType": "personal", "quota": { "total": 10737418240, "used": 1048576 } } ``` ``` -------------------------------- ### List Groups Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves all groups, with support for filtering and expanding members. Use this to get a list of existing groups. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/groups?"$expand=members" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Drive Root Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves the root `driveItem` for a specific drive or space. ```APIDOC ## GET /v1.0/drives/{drive-id}/root ### Description Returns the root `driveItem` for a specific drive/space. ### Method GET ### Endpoint /v1.0/drives/${DRIVE_ID}/root ``` -------------------------------- ### Get Drive by ID Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves metadata for a specific drive by its ID. ```APIDOC ## GET /v1.0/drives/{drive-id} ### Description Retrieves metadata for a specific drive by its ID. ### Method GET ### Endpoint /v1.0/drives/{drive-id} ### Parameters #### Path Parameters - **drive-id** (string) - Required - The unique identifier of the drive. ### Request Example ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668\$a0ca6a90-a365-4782-871e-d44447bbc668" curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives/${DRIVE_ID}" \ -H "Authorization: Bearer " ``` ``` -------------------------------- ### Get Drive by ID Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves metadata for a specific drive using its unique ID. The drive ID is typically a composite string. ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives/${DRIVE_ID}" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Current User Profile Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves the profile of the authenticated user. Supports expanding group memberships. ```bash # Get current user profile curl -s -X GET \ "https://localhost:9200/graph/v1.0/me" \ -H "Authorization: Bearer " ``` ```json # Response { "id": "4c510ada-c86b-4815-8820-42cdf82c3d51", "displayName": "Albert Einstein", "mail": "albert@example.org", "onPremisesSamAccountName": "albert.einstein", "preferredLanguage": "en", "userType": "Member" } ``` ```bash # Get current user with group memberships expanded curl -s -X GET \ "https://localhost:9200/graph/v1.0/me?"$expand=memberOf" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Root Children Source: https://context7.com/owncloud/libre-graph-api/llms.txt Lists the immediate children of the current user's personal space root. Supports pagination via `@odata.nextLink`. ```APIDOC ## GET /v1.0/me/drive/root/children ### Description Lists the immediate children of the current user's personal space root. Supports pagination via `@odata.nextLink`. ### Method GET ### Endpoint /v1.0/me/drive/root/children ### Response #### Success Response (200) - **value** (array) - An array of drive items (files or folders). - Each item contains properties like `id`, `name`, `folder` (with `childCount`), and `lastModifiedDateTime`. - **@odata.nextLink** (string) - A link to retrieve the next page of results, if available. ### Response Example ```json { "value": [ { "id": "...", "name": "Documents", "folder": { "childCount": 5 }, "lastModifiedDateTime": "2024-01-15T10:30:00Z" } ], "@odata.nextLink": "https://localhost:9200/graph/v1.0/me/drive/root/children?$skiptoken=abc" } ``` ``` -------------------------------- ### List Permissions on DriveItem Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves all sharing permissions for a specific drive item. Supports filtering and selecting specific fields. An example shows filtering for federated/OCM sharing roles. ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" ITEM_ID="a0ca6a90-...!file-id" curl -s -X GET \ "https://localhost:9200/graph/v1beta1/drives/${DRIVE_ID}/items/${ITEM_ID}/permissions" \ -H "Authorization: Bearer " ``` ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" ITEM_ID="a0ca6a90-...!file-id" # Filter for federated/OCM sharing roles only curl -s -X GET \ "https://localhost:9200/graph/v1beta1/drives/${DRIVE_ID}/items/${ITEM_ID}/permissions?filter=@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition,'@Subject.UserType=="Federated"'))" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create a Drive Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new storage space (drive). Requires a 'name' field and optionally accepts 'quota' and 'description'. ```bash curl -s -X POST \ "https://localhost:9200/graph/v1.0/drives" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Mars", "quota": { "total": 1000000000 }, "description": "Team space mars project" }' ``` ```json # Success: HTTP 201 Created { "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668", "name": "Mars", "driveType": "project" } ``` -------------------------------- ### Create Education User (Student) Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new education user, specifying their role as 'student'. Requires an authorization token and JSON content type. ```bash # Create an education user (student) curl -s -X POST \ "https://localhost:9200/graph/v1.0/education/users" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "onPremisesSAMAccountName": "max.mustermann", "displayName": "Max Mustermann", "mail": "max@school.example.org", "primaryRole": "student", "identities": [{ "issuer": "idp.school.com", "issuerAssignedId": "max.mustermann" }] }' ``` -------------------------------- ### Generate C++ Qt Client Bindings Source: https://github.com/owncloud/libre-graph-api/blob/main/README.md Use this command to generate C++ Qt client bindings from the OpenAPI specification locally. Mount your local directory to the container to access templates and the specification file. ```bash docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate --enable-post-process-file -t local/templates/cpp-qt-client -i local/api/openapi-spec/v1.0.yaml -g cpp-qt-client -o /local/out/cpp ``` -------------------------------- ### Create User Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new user account. Requires `displayName` and `onPremisesSamAccountName`. The response includes the new user's ID. ```bash curl -s -X POST \ "https://localhost:9200/graph/v1.0/users" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "displayName": "Marie Skłodowska Curie", "onPremisesSamAccountName": "marie.curie", "mail": "marie@example.org", "passwordProfile": { "password": "InitialPassword123!", "forceChangePasswordNextSignIn": true } }' ``` -------------------------------- ### Create Class and Assign Teacher Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new education class and assigns a teacher to it. Requires an authorization token and JSON content type. ```bash # Create a class and assign a teacher curl -s -X POST \ "https://localhost:9200/graph/v1.0/education/classes" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"displayName": "Mathematik", "classification": "course", "externalId": "math-101"}' CLASS_ID="86948e45-96a6-43df-b83d-46e92afd30de" curl -s -X POST \ "https://localhost:9200/graph/v1.0/education/classes/${CLASS_ID}/teachers/$ref" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"@odata.id": "https://localhost:9200/graph/v1.0/education/users/90eedea1-dea1-90ee-a1de-ee90a1deee90"}' ``` -------------------------------- ### List Applications Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves all registered applications, including their defined app roles. Requires an authorization token. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/applications" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get DriveItem Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves a specific item (file or folder) within a drive by its ID. ```APIDOC ## GET /v1beta1/drives/{drive-id}/items/{item-id} ### Description Retrieves a specific item (file or folder) within a drive by its ID. ### Method GET ### Endpoint /v1beta1/drives/${DRIVE_ID}/items/${ITEM_ID} ``` -------------------------------- ### Create User Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new user. displayName and onPremisesSamAccountName are required. ```APIDOC ## POST /v1.0/users ### Description Creates a new user. `displayName` and `onPremisesSamAccountName` are required. ### Method POST ### Endpoint /v1.0/users ### Request Body - **displayName** (string) - Required - The display name of the user. - **onPremisesSamAccountName** (string) - Required - The on-premises SAM account name for the user. - **mail** (string) - Optional - The email address of the user. - **passwordProfile** (object) - Required - Contains password information for the user. - **password** (string) - Required - The initial password for the user. - **forceChangePasswordNextSignIn** (boolean) - Required - Whether to force password change on next sign-in. ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created user. - **displayName** (string) - The display name of the created user. - **mail** (string) - The email address of the created user. ``` -------------------------------- ### Create School - Education Namespace Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new school within the education namespace. Requires an authorization token and JSON content type. ```bash # Create a school curl -s -X POST \ "https://localhost:9200/graph/v1.0/education/schools" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"displayName": "Realschule Musterstadt", "schoolNumber": "1234"}' ``` -------------------------------- ### Get Current User Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves the profile of the currently authenticated user. Supports expanding group membership. ```APIDOC ## GET /v1.0/me ### Description Returns the profile of the currently authenticated user. Supports `$expand=memberOf` to include group membership inline. ### Method GET ### Endpoint /v1.0/me ### Parameters #### Query Parameters - **$expand** (string) - Optional - Use `memberOf` to include group membership inline. ### Request Example ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/me" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **id** (string) - User's unique identifier. - **displayName** (string) - User's display name. - **mail** (string) - User's email address. - **onPremisesSamAccountName** (string) - User's on-premises SAM account name. - **preferredLanguage** (string) - User's preferred language. - **userType** (string) - Type of the user (e.g., Member). #### Response Example ```json { "id": "4c510ada-c86b-4815-8820-42cdf82c3d51", "displayName": "Albert Einstein", "mail": "albert@example.org", "onPremisesSamAccountName": "albert.einstein", "preferredLanguage": "en", "userType": "Member" } ``` ``` -------------------------------- ### Create Drive Item (Mount Share) Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use POST to mount a remote shared item into a share jail drive. The `remoteItem.id` must be obtained from the `sharedWithMe` endpoint. This endpoint is available in `v1beta1`. ```bash SHARE_JAIL_DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" curl -s -X POST \ "https://localhost:9200/graph/v1beta1/drives/${SHARE_JAIL_DRIVE_ID}/root/children" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Einsteins project share", "remoteItem": { "id": "a-storage-provider-id$a-space-id!a-node-id" } }' ``` -------------------------------- ### Create a Drive Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new storage space (drive) of any type. The `name` field is required. ```APIDOC ## POST /v1.0/drives ### Description Creates a new storage space (drive) of any type. The `name` field is required. ### Method POST ### Endpoint /v1.0/drives ### Request Body - **name** (string) - Required - The name of the new drive. - **quota** (object) - Optional - Quota information for the drive. - **total** (integer) - Required - Total quota in bytes. - **description** (string) - Optional - Description of the drive. ### Request Example ```bash curl -s -X POST \ "https://localhost:9200/graph/v1.0/drives" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Mars", "quota": { "total": 1000000000 }, "description": "Team space mars project" }' ``` ### Response #### Success Response (201) - **id** (string) - Unique identifier for the newly created drive. - **name** (string) - Name of the drive. - **driveType** (string) - Type of the drive. #### Response Example ```json { "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668", "name": "Mars", "driveType": "project" } ``` ``` -------------------------------- ### List All Tags Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves a list of all known tags within the system. Use this to see available tags before assigning them. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/extensions/org.libregraph/tags" \ -H "Authorization: Bearer " ``` -------------------------------- ### Initialize Swagger UI with LibreGraph API Source: https://github.com/owncloud/libre-graph-api/blob/main/index.html This JavaScript code initializes the Swagger UI to display the LibreGraph API documentation. It specifies the OpenAPI spec URL and configures deep linking and presets. ```javascript window.onload = function() { // Begin Swagger UI call region const ui = SwaggerUIBundle({ url: "https://owncloud.dev/libre-graph-api/api/openapi-spec/v1.0.yaml", dom_id: '#swagger-ui', deepLinking: true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], layout: "StandaloneLayout" }); ui.initOAuth({ clientId: "xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69", clientSecret: "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh", realm: "oCIS", appName: "SwaggerUI", scopeSeparator: " ", scopes: "openid profile email", useBasicAuthenticationWithAccessCodeGrant: false, usePkceWithAuthorizationCodeGrant: true }); // End Swagger UI call region window.ui = ui; }; ``` -------------------------------- ### List Role Definitions Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves all unified role definitions available for sharing operations. Requires an authorization token. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1beta1/roleManagement/permissions/roleDefinitions" \ -H "Authorization: Bearer " ``` -------------------------------- ### List Applications Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves a list of all registered applications and their defined app roles. ```APIDOC ## GET /v1.0/applications ### Description Returns all registered applications, including their defined app roles for use in role assignments. ### Method GET ### Endpoint /v1.0/applications ### Response #### Success Response (200) - **id** (string) - The unique identifier for the application. - **displayName** (string) - The display name of the application. - **appRoles** (array) - An array of app roles defined for the application. - **id** (string) - The unique identifier for the app role. - **displayName** (string) - The display name of the app role. - **allowedMemberTypes** (array) - The types of members allowed for this role. ### Response Example { "id": "some-application-uuid", "displayName": "ownCloud Web", "appRoles": [ { "id": "910367f9-4041-4db1-961b-d1e98f708eaf", "displayName": "Admin", "allowedMemberTypes": ["User"] } ] } ## GET /v1.0/applications/{APP_ID} ### Description Retrieves a specific application by its ID, including its defined app roles. ### Method GET ### Endpoint /v1.0/applications/{APP_ID} ### Parameters #### Path Parameters - **APP_ID** (string) - Required - The unique identifier of the application. ``` -------------------------------- ### Create Drive Item (Mount Share) Source: https://context7.com/owncloud/libre-graph-api/llms.txt Mounts a remote shared item into the share jail drive. The `remoteItem.id` is obtained from the `sharedWithMe` endpoint. ```APIDOC ## POST /v1beta1/drives/{drive-id}/root/children ### Description Mounts a remote shared item into the share jail drive. The `remoteItem.id` comes from the `sharedWithMe` endpoint. ### Method POST ### Endpoint /v1beta1/drives/${SHARE_JAIL_DRIVE_ID}/root/children ### Request Body - **name** (string) - Required - The name to assign to the mounted share. - **remoteItem** (object) - Required - Information about the remote item to mount. - **id** (string) - Required - The ID of the remote item (e.g., from `sharedWithMe` endpoint). ### Request Example ```json { "name": "Einsteins project share", "remoteItem": { "id": "a-storage-provider-id$a-space-id!a-node-id" } } ``` ### Response #### Success Response (200) - **name** (string) - The name of the mounted share. - **id** (string) - The ID of the newly created drive item representing the mounted share. - **remoteItem** (object) - Information about the remote item. - **id** (string) - The ID of the remote item. ### Response Example ```json { "name": "Einsteins project share", "id": "a0ca6a90-...!share-id", "remoteItem": { "id": "a-storage-provider-id$a-space-id!a-node-id" } } ``` ``` -------------------------------- ### List All Drives Source: https://context7.com/owncloud/libre-graph-api/llms.txt Returns all drives (storage spaces) visible to the caller. Supports `$orderby` and `$filter` query parameters. ```APIDOC ## GET /v1.0/drives ### Description Returns all drives (storage spaces) visible to the caller. Supports `$orderby` and `$filter` query parameters (e.g., filter by `driveType`). ### Method GET ### Endpoint /v1.0/drives ### Parameters #### Query Parameters - **$filter** (string) - Optional - Filter criteria for drives (e.g., `driveType eq 'project'`). - **$orderby** (string) - Optional - Order criteria for drives. ### Request Example ```bash # List all drives curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives" \ -H "Authorization: Bearer " # Filter to project spaces only curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives?%24filter=driveType%20eq%20'project'" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **value** (array) - An array of drive objects. - **id** (string) - Unique identifier for the drive. - **name** (string) - Name of the drive. - **driveType** (string) - Type of the drive (e.g., 'project', 'personal'). - **driveAlias** (string) - Alias for the drive. - **description** (string) - Description of the drive. - **quota** (object) - Quota information for the drive. - **total** (integer) - Total quota in bytes. - **used** (integer) - Used quota in bytes. - **remaining** (integer) - Remaining quota in bytes. #### Response Example ```json { "value": [ { "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668", "name": "Mars", "driveType": "project", "driveAlias": "project/mars", "description": "Team space mars project", "quota": { "total": 1000000000, "used": 204800, "remaining": 999795200 } } ] } ``` ``` -------------------------------- ### Change Drive Name and Description Source: https://context7.com/owncloud/libre-graph-api/llms.txt Use PATCH to update the name and description of a drive. This allows for easy identification and organization of drives. ```bash curl -s -X PATCH \ "https://localhost:9200/graph/v1.0/drives/${DRIVE_ID}" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"name": "Physics", "description": "Physics research space"}' ``` -------------------------------- ### Create Group Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new group with a specified display name. The `displayName` is a required field. Returns the created group's ID and name. ```bash curl -s -X POST \ "https://localhost:9200/graph/v1.0/groups" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"displayName": "Research Team"}' ``` -------------------------------- ### Assign User to School Source: https://context7.com/owncloud/libre-graph-api/llms.txt Assigns an existing education user to a specific school. Requires the SCHOOL_ID and an authorization token. ```bash # Assign user to school SCHOOL_ID="43b879c4-14c6-4e0a-9b3f-b1b33c5a4bd4" curl -s -X POST \ "https://localhost:9200/graph/v1.0/education/schools/${SCHOOL_ID}/users/$ref" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"@odata.id": "https://localhost:9200/graph/v1.0/education/users/90eedea1-dea1-90ee-a1de-ee90a1deee90"}' ``` -------------------------------- ### List User App Role Assignments Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves all app role assignments for a specific user. Requires a valid authorization token. ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/users/${USER_ID}/appRoleAssignments" \ -H "Authorization: Bearer " ``` -------------------------------- ### List My Drives Source: https://context7.com/owncloud/libre-graph-api/llms.txt Returns all drives where the current user is a regular member, excluding spaces they only have external access to. Supports ordering. ```APIDOC ## GET /v1.0/me/drives ### Description Returns all drives where the current user is a regular member (excludes spaces they only have external access to). ### Method GET ### Endpoint /v1.0/me/drives ### Query Parameters - **$orderby** (string) - Optional - Specifies the order of the results. Example: `lastModifiedDateTime desc`. ``` -------------------------------- ### Manage App Role Assignments for User Source: https://context7.com/owncloud/libre-graph-api/llms.txt Provides endpoints to grant, list, and revoke global application roles for a user. Requires `principalId`, `resourceId`, and `appRoleId` for granting roles. ```bash USER_ID="4c510ada-c86b-4815-8820-42cdf82c3d51" ``` -------------------------------- ### Create Group Source: https://context7.com/owncloud/libre-graph-api/llms.txt Creates a new group. The `displayName` is required. ```APIDOC ## POST /v1.0/groups ### Description Creates a new group. The `displayName` is required. ### Method POST ### Endpoint /graph/v1.0/groups ### Request Body - **displayName** (string) - Required - The display name for the new group. ### Request Example ```bash curl -s -X POST \ "https://localhost:9200/graph/v1.0/groups" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"displayName": "Research Team"}' ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the newly created group. - **displayName** (string) - The display name of the newly created group. #### Response Example ```json { "id": "86948e45-96a6-43df-b83d-46e92afd30de", "displayName": "Research Team" } ``` ``` -------------------------------- ### Update a Drive Source: https://context7.com/owncloud/libre-graph-api/llms.txt Updates properties of an existing drive, such as its name, description, or quota. Requires the drive's ID in the URL. ```bash DRIVE_ID="a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668" ``` -------------------------------- ### List and Filter Drives Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves all drives visible to the caller. Supports filtering by driveType and ordering. ```bash # List all drives curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives" \ -H "Authorization: Bearer " ``` ```bash # Filter to project spaces only curl -s -X GET \ "https://localhost:9200/graph/v1.0/drives?"$filter=driveType%20eq%20'project'" \ -H "Authorization: Bearer " ``` ```json # Response { "value": [ { "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668", "name": "Mars", "driveType": "project", "driveAlias": "project/mars", "description": "Team space mars project", "quota": { "total": 1000000000, "used": 204800, "remaining": 999795200 } } ] } ``` -------------------------------- ### List Groups Source: https://context7.com/owncloud/libre-graph-api/llms.txt Returns all groups. Supports `$search`, `$orderby`, `$select`, and `$expand=members`. ```APIDOC ## GET /v1.0/groups ### Description Returns all groups. Supports `$search`, `$orderby`, `$select`, and `$expand=members`. ### Method GET ### Endpoint /graph/v1.0/groups ### Query Parameters - **$expand** (string) - Optional - Expands the members of the group. ### Request Example ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/groups?" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **value** (array) - An array of group objects. - **id** (string) - The unique identifier of the group. - **displayName** (string) - The display name of the group. - **members** (array) - An array of members in the group (if $expand=members is used). #### Response Example ```json { "value": [ { "id": "167cbee2-0518-455a-bfb2-031fe0621e5d", "displayName": "Philosophy Haters", "members": [...] } ] } ``` ``` -------------------------------- ### Set or Clear Permission Password Source: https://context7.com/owncloud/libre-graph-api/llms.txt Manages the password for a sharing link permission. Use an empty string to clear the password. Requires DRIVE_ID, ITEM_ID, and PERM_ID. ```bash DRIVE_ID="a0ca6a90-... ... ITEM_ID="a0ca6a90-...!file-id" PERM_ID="7181275c-557e-4adf-8e44-abdcf5389b6a" # Set password curl -s -X POST \ "https://localhost:9200/graph/v1beta1/drives/${DRIVE_ID}/items/${ITEM_ID}/permissions/${PERM_ID}/setPassword" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"password": "SecureLink123!"}' # Clear password curl -s -X POST \ "https://localhost:9200/graph/v1beta1/drives/${DRIVE_ID}/items/${ITEM_ID}/permissions/${PERM_ID}/setPassword" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"password": ""}' ``` -------------------------------- ### Manage Tags Source: https://context7.com/owncloud/libre-graph-api/llms.txt Allows for listing all known tags, assigning tags to a resource, or unassigning tags from a resource. ```APIDOC ## Tags Operations ### Get all tags #### Method GET #### Endpoint /graph/v1.0/extensions/org.libregraph/tags ### Assign tags to a resource #### Method PUT #### Endpoint /graph/v1.0/extensions/org.libregraph/tags #### Request Body - **resourceId** (string) - Required - The ID of the resource to which tags will be assigned. - **tags** (array of strings) - Required - An array of tags to assign to the resource. ### Unassign tags #### Method DELETE #### Endpoint /graph/v1.0/extensions/org.libregraph/tags #### Request Body - **resourceId** (string) - Required - The ID of the resource from which tags will be unassigned. - **tags** (array of strings) - Required - An array of tags to unassign from the resource. ### Request Example (Get all tags) ```bash curl -s -X GET \ "https://localhost:9200/graph/v1.0/extensions/org.libregraph/tags" \ -H "Authorization: Bearer " ``` ### Request Example (Assign tags) ```bash curl -s -X PUT \ "https://localhost:9200/graph/v1.0/extensions/org.libregraph/tags" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "resourceId": "7f92b0a9-06ad-49dc-890f-0e0a6eb4dea6$e9f01ca3-577f-4d1d-acd4-1cc44149ac25!5fb9f87c-a317-467b-9882-eb9f171564ac", "tags": ["important", "project-alpha"] }' ``` ### Request Example (Unassign tags) ```bash curl -s -X DELETE \ "https://localhost:9200/graph/v1.0/extensions/org.libregraph/tags" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "resourceId": "7f92b0a9-...!5fb9f87c-...", "tags": ["project-alpha"] }' ``` ``` -------------------------------- ### List Users Source: https://context7.com/owncloud/libre-graph-api/llms.txt Retrieves a list of all users. Supports filtering by group membership, role assignments, and searching by display name. ```bash # List all users curl -s -X GET \ "https://localhost:9200/graph/v1.0/users" \ -H "Authorization: Bearer " # Search users by display name curl -s -X GET \ "https://localhost:9200/graph/v1.0/users?n=einstein" \ -H "Authorization: Bearer " # Filter users by group membership curl -s -X GET \ "https://localhost:9200/graph/v1.0/users?n=memberOf/any(x:x/id%20eq%20'910367f9-4041-4db1-961b-d1e98f708eaf')" \ -H "Authorization: Bearer " # Filter users by role assignment curl -s -X GET \ "https://localhost:9200/graph/v1.0/users?n=appRoleAssignments/any(x:x/appRoleId%20eq%20'910367f9-4041-4db1-961b-d1e98f708eaf')" \ -H "Authorization: Bearer " ``` -------------------------------- ### List Users Source: https://context7.com/owncloud/libre-graph-api/llms.txt Returns all users. Supports $search, $filter (by group membership, role assignments), $orderby, $select, and $expand. ```APIDOC ## GET /v1.0/users ### Description Returns all users. Supports $search, $filter (by group membership, role assignments), $orderby, $select, and $expand. ### Method GET ### Endpoint /v1.0/users ### Query Parameters - **$search** (string) - Optional - Search term for filtering users. - **$filter** (string) - Optional - Filter criteria for users (e.g., by group membership or role assignments). - **$orderby** (string) - Optional - Specifies the order of the results. - **$select** (string) - Optional - Specifies the properties to return. - **$expand** (string) - Optional - Specifies related entities to expand. ``` -------------------------------- ### Export User Personal Data Source: https://context7.com/owncloud/libre-graph-api/llms.txt Initiates an asynchronous export of a user's personal data to a specified storage location. Requires USER_ID. ```bash USER_ID="4c510ada-c86b-4815-8820-42cdf82c3d51" curl -s -X POST \ "https://localhost:9200/graph/v1.0/users/${USER_ID}/exportPersonalData" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"storageLocation": "/personal-data-export"}' ```