Skip to main content

Official Operators

This endpoint is responsible for managing the creation, invitation, and viewing of official operators within the system. It handles operations such as sending email invitations, importing operators from a CSV file, accepting invitations, and viewing operators for a given company.

Official Partners

1. Create Operator Invitation Manually

Endpoint : POST /create-operator-invitation

Description: Manually create an operator invitation and send an email to the operator.

Request Body:

{
"email": "string",
"company_id": "uuid",
"vat_number": "string"
}

Response

StatusDescription
200 OKOperator invitation created successfully.
400 Bad RequestThe operator is not from the same country as the company or an error occurred in the invitation process.
500 Internal Server ErrorFailed to create the invitation due to an unexpected error.

Response Object:

{
"message": "Invitation created successfully",
"ok": true
}

2. Import Operators from CSV

POST /import-operators

Description: Handle CSV file upload to create multiple operator invitations.

Request Body:

{
"file": "File",
"company_id": "uuid"
}

Response

StatusDescription
200 OKAll operators were imported successfully.
400 Bad RequestSome operators were not imported successfully or there were missing fields in the CSV.
500 Internal Server ErrorFailed to import operators due to an unexpected error.

Response:

{
"message": "Operators imported successfully",
"ok": true
}

3. Accept Invitation

POST /accept-invitation

Description: Accept an invitation sent to an operator and add them to the workspace.

Request Body:

{
"invitationId": "uuid"
}

Response

StatusDescription
200 OKInvitation accepted successfully and the user was added to the workspace.
400 Bad RequestThe invitation has expired or the user is already a member of the workspace.
406 Not AcceptableNo invitation found or no user found for the provided email.
500 Internal Server ErrorFailed to accept the invitation due to an unexpected error.

Response Object:

{
"message": "Invitation accepted successfully",
"ok": true
}

4. View Operators

GET /view-operators/:companyId

Description: View all operators associated with a given company.

Parameter:

  • companyId: The ID of the company whose operators are to be viewed.

Response

StatusDescription
200 OKSuccessfully retrieved the list of operators.
500 Internal Server ErrorFailed to retrieve the list of operators due to an unexpected error.

Response Object:

{
"operators": {
"email": "string",
"country_code": "string",
"created_at": "string",
"partner_id": "string"
}
}