Switch Current User Company

PATCH /api/v2/user/companies/{NewCompanyID}

This endpoint allows you to switch a user from their current company to another. The new company must be a network company that the user is linked to.

Path parameters

  • NewCompanyID integer Required

    The ID of the company you want to link the user to.

Responses

  • 200 application/json

    Success

    Hide response attributes Show response attributes object
  • 404 application/json

    Company not found.

    Hide response attributes Show response attributes object
  • 422 application/json

    Not a network company.

    Hide response attributes Show response attributes object
PATCH /api/v2/user/companies/{NewCompanyID}
curl \
 -X PATCH https://api.fincalc.co.uk/api/v2/user/companies/{NewCompanyID} \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "message": "User successfully updated to company 167"
}
Response examples (404)
{
  "success": false,
  "message": "New company id must be an integer."
}
Response examples (422)
{
  "success": false,
  "message": "New company id must be a network company."
}