メインコンテンツへスキップ

invite-user

dci invite-user

Invites a new user to the organization with specified role and organization.

Request

Content-Type: application/json

Schema

{
"type": "object",
"description": "Request body to invite a new user to the organization.",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"description": "The email address of the user.",
"format": "email"
},
"firstName": {
"type": "string",
"description": "The first name of the user being invited."
},
"lastName": {
"type": "string",
"description": "The last name of the user being invited."
},
"jobTitle": {
"type": "string",
"description": "The job function of the user being invited.",
"enum": [
"Data Engineer / Data Analysts",
"Executive Team",
"Finance / Accounting",
"Founder",
"Legal / Purchasing",
"Management",
"Sales / Marketing",
"Software / Ops Engineer"
]
},
"roleId": {
"type": "string",
"description": "The ID of the role to assign to the user."
},
"organizationId": {
"type": "string",
"description": "The ID of the organization to assign the user to."
}
}
}

Output

Created - User invitation created successfully.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
messagestringSuccess message
userobject
user.idstringThe unique ID of the invited user.
user.emailstringThe email address of the invited user.
user.firstNamestringThe first name of the invited user, if provided during invitation.
user.lastNamestringThe last name of the invited user, if provided during invitation.
user.displayNamestringThe display name of the invited user, if provided during invitation.
user.jobTitlestringThe job function of the invited user, if provided during invitation.
user.roleIdstringThe ID of the role assigned to the user.
user.organizationIdstringThe ID of the organization assigned to the user.
user.statusstringThe status of the user (invited) One of: "invited".
Raw JSON schema
{
"type": "object",
"description": "Response returned after creating a user invitation.",
"properties": {
"message": {
"type": "string",
"description": "Success message"
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique ID of the invited user."
},
"email": {
"type": "string",
"description": "The email address of the invited user."
},
"firstName": {
"type": "string",
"description": "The first name of the invited user, if provided during invitation."
},
"lastName": {
"type": "string",
"description": "The last name of the invited user, if provided during invitation."
},
"displayName": {
"type": "string",
"description": "The display name of the invited user, if provided during invitation."
},
"jobTitle": {
"type": "string",
"description": "The job function of the invited user, if provided during invitation."
},
"roleId": {
"type": "string",
"description": "The ID of the role assigned to the user."
},
"organizationId": {
"type": "string",
"description": "The ID of the organization assigned to the user."
},
"status": {
"type": "string",
"description": "The status of the user (invited)",
"enum": [
"invited"
]
}
}
}
}
}

Errors

On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.

HTTP statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
50040API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: inviteuser