Company: Access

🔒🛡️ Добавление пользователя в компанию с созданием аккаунта, установкой ролей и условий найма.

Добавление пользователя в компанию с созданием аккаунта, установкой ролей и условий найма.

Access: authorized (10 ) · Scope: write

Allows: user:create, user:invite, user:privileges, user:products, user:employment, user:timeoff, user:payments (все обязательны; проверка в команде по ресурсу из запроса)

TypeScript (copy-paste)

POST /company/access/create

<details open><summary><b>Body</b></summary>
export interface CompanyAccessCreateBody {
  /** Phone number */
  phone?: string | null
  email?: string | null
  user?: Record<string, any> | null
  isAdmin?: boolean | null
  employmentType?: Payment_employmentType | null
  orgID?: string | null
  marginPercent?: number | null
  schemes?: Array<string> | null
  roles?: Array<any> | null
  timeOffs?: Array<any> | null
  createPayments?: boolean | null
  productAccess?: string | null
  products?: string | null
}
</details> <details open><summary><b>Response</b></summary>
export type CompanyAccessCreateResponse = IServerResponse<UserDto>

export interface IServerResponse<T = any> {
  code: number
  data: T
  srvTS: number
  rkey: string
}
</details>

Полный файл типов: /docs/types · raw: /docs/api-types.ts

post/company/access/create

Request

  • Base URL: http://localhost
  • URL: http://localhost/company/access/create
  • Auth: one of:
    • API key in header sid and API key in header rts and API key in header sig
    • HTTP bearer

Headers

devIDstring uuid required

UUID устройства клиента

tzstring required
Example:Europe/Moscow

Таймзона клиента (IANA или offset)

appstring required
Example:kosmodrom-web

Имя клиентского приложения

appVerstring required
Example:1.0.0

Версия клиента

rKeystring

Уникальный ключ запроса для логов/саппорта

Request body

phonestring nullable

Phone number

emailstring nullable
userobject nullable
isAdminboolean nullable
employmentType'none' | 'ru_tk' | 'ru_gpd' | 'ru_ip' | 'ru_sam'

none = "none", ruTK = "ru_tk", ruGPD = "ru_gpd", ruIP = "ru_ip", ruSam = "ru_sam"

orgIDstring uuid nullable
marginPercentinteger nullable
schemesstring[] nullable
createPaymentsboolean nullable
productAccessstring nullable
productsstring nullable

Response

OK — IServerResponse<UserDto>

codeinteger required
srvTSinteger required

Server timestamp (ms)

rkeystring required

Request key

Example response

{
  "code": 200
}

Changes

No recorded changes to this operation across all 1 revision of this API.