# Admin (*admin*) ## Overview ### Available Operations * [getOne](#getone) * [createUserInvitation](#createuserinvitation) * [removeUser](#removeuser) * [getUserByToken](#getuserbytoken) * [assignPermissions](#assignpermissions) ## getOne ### Example Usage ```typescript import { Dokploy } from "dokploy"; const dokploy = new Dokploy({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const result = await dokploy.admin.getOne(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DokployCore } from "dokploy/core.js"; import { adminGetOne } from "dokploy/funcs/adminGetOne.js"; // Use `DokployCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dokploy = new DokployCore({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const res = await adminGetOne(dokploy); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("adminGetOne failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ErrorT](../../models/errort.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.DokployDefaultError | 4XX, 5XX | \*/\* | ## createUserInvitation ### Example Usage ```typescript import { Dokploy } from "dokploy"; const dokploy = new Dokploy({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const result = await dokploy.admin.createUserInvitation({ email: "Melody5@gmail.com", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DokployCore } from "dokploy/core.js"; import { adminCreateUserInvitation } from "dokploy/funcs/adminCreateUserInvitation.js"; // Use `DokployCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dokploy = new DokployCore({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const res = await adminCreateUserInvitation(dokploy, { email: "Melody5@gmail.com", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("adminCreateUserInvitation failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.AdminCreateUserInvitationRequest](../../models/operations/admincreateuserinvitationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ErrorT](../../models/errort.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.DokployDefaultError | 4XX, 5XX | \*/\* | ## removeUser ### Example Usage ```typescript import { Dokploy } from "dokploy"; const dokploy = new Dokploy({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const result = await dokploy.admin.removeUser({ authId: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DokployCore } from "dokploy/core.js"; import { adminRemoveUser } from "dokploy/funcs/adminRemoveUser.js"; // Use `DokployCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dokploy = new DokployCore({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const res = await adminRemoveUser(dokploy, { authId: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("adminRemoveUser failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.AdminRemoveUserRequest](../../models/operations/adminremoveuserrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ErrorT](../../models/errort.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.DokployDefaultError | 4XX, 5XX | \*/\* | ## getUserByToken ### Example Usage ```typescript import { Dokploy } from "dokploy"; const dokploy = new Dokploy({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const result = await dokploy.admin.getUserByToken({ token: "", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DokployCore } from "dokploy/core.js"; import { adminGetUserByToken } from "dokploy/funcs/adminGetUserByToken.js"; // Use `DokployCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dokploy = new DokployCore({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const res = await adminGetUserByToken(dokploy, { token: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("adminGetUserByToken failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.AdminGetUserByTokenRequest](../../models/operations/admingetuserbytokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ErrorT](../../models/errort.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.DokployDefaultError | 4XX, 5XX | \*/\* | ## assignPermissions ### Example Usage ```typescript import { Dokploy } from "dokploy"; const dokploy = new Dokploy({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const result = await dokploy.admin.assignPermissions({ userId: "", canCreateProjects: false, canCreateServices: false, canDeleteProjects: false, canDeleteServices: false, accesedProjects: [ "", ], accesedServices: [ "", ], canAccessToTraefikFiles: false, canAccessToDocker: true, canAccessToAPI: false, canAccessToSSHKeys: true, canAccessToGitProviders: false, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { DokployCore } from "dokploy/core.js"; import { adminAssignPermissions } from "dokploy/funcs/adminAssignPermissions.js"; // Use `DokployCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const dokploy = new DokployCore({ authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "", }); async function run() { const res = await adminAssignPermissions(dokploy, { userId: "", canCreateProjects: false, canCreateServices: false, canDeleteProjects: false, canDeleteServices: false, accesedProjects: [ "", ], accesedServices: [ "", ], canAccessToTraefikFiles: false, canAccessToDocker: true, canAccessToAPI: false, canAccessToSSHKeys: true, canAccessToGitProviders: false, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("adminAssignPermissions failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.AdminAssignPermissionsRequest](../../models/operations/adminassignpermissionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ErrorT](../../models/errort.md)\>** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.DokployDefaultError | 4XX, 5XX | \*/\* |