> ## Documentation Index
> Fetch the complete documentation index at: https://docutrack-docs.icpitalia.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Orchestrator Canister

> Orchestrator Canister API

```did theme={null}
service : (OrchestratorInstallArgs) -> {
  get_user : (principal) -> (opt PublicUser) query;
  get_users : (Pagination, opt text) -> (GetUsersResponse) query;
  orbit_station : () -> (principal) query;
  retry_user_canister_creation : () -> (RetryUserCanisterCreationResponse);
  revoke_share_file : (principal, nat64) -> (RevokeShareFileResponse);
  revoke_share_file_for_users : (vec principal, nat64) -> (
      RevokeShareFileResponse,
    );
  set_user : (text, blob) -> (SetUserResponse);
  share_file : (principal, nat64, ShareFileMetadata) -> (ShareFileResponse);
  share_file_with_users : (vec principal, nat64, ShareFileMetadata) -> (
      ShareFileResponse,
    );
  shared_files : () -> (SharedFilesResponse) query;
  user_canister : () -> (UserCanisterResponse) query;
  username_exists : (text) -> (bool) query;
  who_am_i : () -> (WhoamiResponse) query;
}
```

### get\_user

Returns the public information of a user by their user ID.

Arguments:

* `user_id`: The user ID of the user to retrieve.

Returns:

* `opt PublicUser`: An optional `PublicUser` object containing the user's public information, or `null` if the user does not exist.

### get\_users

Returns a paginated list of users.

Arguments:

* `Pagination`: The pagination parameters to use for the query.
* `opt text`: An optional search term to filter users by username.

Returns:

* `GetUsersResponse`: A response object containing a list of users and pagination information.

### orbit\_station

Returns the principal of the Orbit Station canister.

Returns:

* `principal`: The principal of the Orbit Station canister.

### retry\_user\_canister\_creation

Retries the creation of a user canister for the current user.

Returns:

`RetryUserCanisterCreationResponse`: A response object indicating the result of the retry operation.

### revoke\_share\_file

Revoke access to a shared file for a specific user.

Can only be called by the user canister.

Arguments:

* `user_id`: The user ID of the user to revoke access from.
* `file_id`: The ID of the file to revoke access to.

Returns:

`RevokeShareFileResponse`: A response object indicating the result of the revocation operation.

### revoke\_share\_file\_for\_users

Revoke access to a shared file for multiple users.

Can only be called by the user canister.

Arguments:

* `user_ids`: A vector of user IDs to revoke access from.
* `file_id`: The ID of the file to revoke access to.

Returns:

`RevokeShareFileResponse`: A response object indicating the result of the revocation operation.

### set\_user

Sign up with internet identity by providing a username. This call causes the orchestrator to start the worker which will result in the creation of the user canister for the user.

Arguments:

* `username`: The username to set for the user.
* `blob`: The blob containing the user's Public Key

Returns:

`SetUserResponse`: A response object indicating the result of the user creation operation.

### share\_file

Share a file with a specific user.

Can only be called by the user canister.

Arguments:

* `user_id`: The user ID of the user to share the file with.
* `file_id`: The ID of the file to share.
* `ShareFileMetadata`: Metadata about the file to share, such as the file name and description.

Returns:

`ShareFileResponse`: A response object indicating the result of the share operation.

### share\_file\_with\_users

Share a file with multiple users.

Can only be called by the user canister.

Arguments:

* `user_ids`: A vector of user IDs to share the file with.
* `file_id`: The ID of the file to share.
* `ShareFileMetadata`: Metadata about the file to share, such as the file name and description.

Returns:

`ShareFileResponse`: A response object indicating the result of the share operation.

### shared\_files

Returns a list of files shared with the current user.

Returns:

* `SharedFilesResponse`: A response object containing a list of files shared with the user.

### user\_canister

Returns the principal of the user canister or its creation state if not created yet/pending/failed for the current user.

Returns:

* `UserCanisterResponse`: A response object containing the principal of the user canister or its creation state.

### username\_exists

Returns whether a username already exists.

Arguments:

* `username`: The username to check for existence.

Returns:

* `bool`: `true` if the username exists, `false` otherwise.

### who\_am\_i

Returns the public information of the current user.

Returns:

* `WhoamiResponse`: A response object containing the public information of the current user, including their user ID and username.
