<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# Change a user's position

`POST https://marketplace-api.sequifi.com/v1/users/{id}/position`

Module: Users · operationId: `changeUserPosition` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/change-user-position

Changes a user's position from `effective_date`. From that date the new position's own settings supply the rep's wages, commissions, upfronts and overrides, as when an admin changes a position in the app. Re-posting the identical body is a safe retry, but a different `effective_date` makes a second position change.

**Before you call:**

- `id` is the user id from `GET /v1/users` of an already-hired rep. For someone still in onboarding, set the position with `POST /v1/onboarding`.
- Get `position_id` (and `sub_position_id` if your company uses sub-positions) from `GET /v1/positions`. Position names are not accepted.
- This endpoint accepts any existing position id, including inactive ones that `GET /v1/positions` hides. Pick from that list.
- The rep must not be dismissed.

**What happens:**

- The change is added to the rep's position history dated `effective_date`.
- Commission, wage, upfront and override values are not accepted. Sequifi works them out from the position.
- There is no department field.
- Manager, team, recruiter, additional recruiters and additional office assignments carry over. The rep keeps their own direct reports unless you send `existing_employee_new_manager_id`.
- `team_id` changes the team shown on the rep's record but does not add the rep to that team's members, so the team manager's override does not follow. Change team membership in the app.

**Idempotency and retries:**

- After a timeout, re-post the identical body. It updates the same history entry instead of adding a second one.
- Never change `effective_date` on a retry. A different date is a second position change.

**Formats:**

- `effective_date` is `YYYY-MM-DD` and must be a real calendar day.
- Ids are positive integers; numeric strings also work. `null` or `""` for an optional id keeps the current value.
- Other body fields are ignored.
- The success response `status` is the number `200`.

**Errors:**

- `400` for an invalid path id, malformed JSON, or a missing or invalid field (messages in the examples).
- `404` `NOT_FOUND`: no user with that id.
- `422` `USER_DISMISSED` (the rep is dismissed), `POSITION_NOT_FOUND` (no position with that `position_id` or `sub_position_id`), or `TEAM_NOT_FOUND`.
- `500` `POSITION_CHANGE_FAILED` or `Could not resolve the tenant host`. Contact Sequifi support if it repeats.
- `502` `The tenant returned an unreadable response` or `Could not reach the tenant`: retry later with the identical body.
- `503`: your company is not set up for this endpoint yet. Contact Sequifi support.
- `504`: no answer in time. The change may still have been applied; re-post the identical body.
- Error codes are in `data.code`, alongside `data.requestedBy`.
- `401` when the token is missing, malformed, expired or revoked. It is rejected before the request is processed, so the body is only `{"message":"Unauthorized"}`, with no `status` or `data`.

**Common mistakes:**

- Sending a `manager_id` that is not a real user id. It is not checked and is saved as sent. Look managers up with `GET /v1/users`.
- Using an id from a user's `position_id` that `GET /v1/positions` does not list (an inactive position).

**Related:**

- `GET /v1/positions` for `position_id`; `GET /v1/teams` for `team_id`.
- `GET /v1/users/{id}` shows `position_id` and `sub_position_id` as of today.
- `POST /v1/users/{id}/transfer` to change office.

## Path parameters

- `id` (integer, **required**): User id of an already-hired rep, from `GET /v1/users`. Not an onboarding id. Minimum: 1. Example: `4821`.

## Request body

- `position_id` (integer, **required**): Target position, from `GET /v1/positions`. Minimum: 1. Example: `7`.
- `sub_position_id` (integer, nullable): Where your company uses sub-positions, the position pay is read from. Leave it out if you do not use them. Minimum: 1. Example: `12`.
- `effective_date` (string (date), **required**): First day in the new position, YYYY-MM-DD. Example: `2026-09-01`.
- `manager_id` (integer, nullable): New manager's user id. Defaults to the rep's current manager. Not checked for existence. Minimum: 1. Example: `87`.
- `team_id` (integer, nullable): New team id. Defaults to the rep's current team. Changes the team label only, not team membership. Minimum: 1. Example: `4`.
- `existing_employee_new_manager_id` (integer, nullable): Who the rep's own direct reports answer to afterwards. Defaults to the rep, so they keep their team. Send it only when moving someone out from over their reports. Minimum: 1. Example: `87`.

Example (promotion): Promote a rep to a manager position

```json
{
  "position_id": 7,
  "effective_date": "2026-09-01"
}
```

## Example request

```bash
curl -X POST "https://marketplace-api.sequifi.com/v1/users/4821/position" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_id":7,"effective_date":"2026-09-01"}'
```

## Responses

### 200: Position change applied

- `status` (integer): The HTTP status code, repeated. Example: `200`.
- `message` (string): Short text. Wording varies by endpoint; branch on the HTTP status, not on this text. Example: `success`.
- `data` (object)
  - `requestedBy` (string): Name of the API credential your token belongs to.
  - `user_id` (integer): The user whose position changed.
  - `position_id` (integer): New position.
  - `sub_position_id` (integer, nullable): New sub-position, or null when none was sent.
  - `effective_date` (string (date)): Date the change takes effect, YYYY-MM-DD.

```json
{
  "status": 200,
  "message": "Position change applied.",
  "data": {
    "requestedBy": "acme",
    "user_id": 4821,
    "position_id": 7,
    "sub_position_id": null,
    "effective_date": "2026-09-01"
  }
}
```

### 400: Invalid id, body or field

Example (invalid_id): Path id is not a positive whole number

```json
{
  "status": 400,
  "message": "Invalid user id",
  "data": {}
}
```

### 401: Missing, malformed, expired or revoked token. Rejected before processing, so the body has only `message`.

```json
{
  "message": "Unauthorized"
}
```

### 404: No user with that id

```json
{
  "status": 404,
  "message": "No user with id 4821.",
  "data": {
    "requestedBy": "acme",
    "code": "NOT_FOUND"
  }
}
```

### 422: The rep, position or team cannot be used

Example (user_dismissed): The rep is dismissed

```json
{
  "status": 422,
  "message": "User 4821 is dismissed and cannot change position.",
  "data": {
    "requestedBy": "acme",
    "code": "USER_DISMISSED"
  }
}
```

### 500: The position change could not be applied

```json
{
  "status": 500,
  "message": "The position change could not be applied.",
  "data": {
    "requestedBy": "acme",
    "code": "POSITION_CHANGE_FAILED"
  }
}
```

### 502: Sequifi could not complete the request. Retry later with the identical body.

```json
{
  "status": 502,
  "message": "The tenant returned an unreadable response",
  "data": {}
}
```

### 503: Your company is not set up for position changes over the API. Contact Sequifi support; this is not a problem with your token.

Example (not_configured): Not configured

```json
{
  "status": 503,
  "message": "This tenant is not configured for position changes over the API. Contact Sequifi support.",
  "data": {}
}
```

### 504: No answer in time. The change may still have been applied; re-post the identical body.

```json
{
  "status": 504,
  "message": "The tenant did not respond in time. The change may still have been applied — re-post the identical body, which converges rather than applying twice. Do not change effective_date on a retry.",
  "data": {
    "user_id": 4821
  }
}
```
