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

# Get a position

`GET https://marketplace-api.sequifi.com/v1/positions/{id}`

Module: Positions · operationId: `getPosition` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/get-position

Returns one active position by id, with the same fields as `GET /v1/positions`. The position is at `data.positions[0]`: the response uses the list wrapper. Inactive and built-in system positions return `404`, even when a user still holds them.

**Before you call:**

- Take the id from `GET /v1/positions`, or from `position_id` / `sub_position_id` on a user.
- Do not add query parameters. Any query parameter returns `400`.

**Formats:**

- Same as `GET /v1/positions`: `status` is always `1`; use only `frequency_type_id` and `frequency_type_name` from `pay_frequency`; do not rely on `deduction_limit` or `reconciliation`.
- `current_page`, `per_page`, `total` and `last_page` are always `1`, `50`, `1` and `1`. Ignore them.
- The metadata key is `requested_by` (snake_case).

**Errors:**

- `400` `Invalid position id` when `id` does not start with a positive number. Trailing characters are ignored, so `4abc` reads as `4`.
- `400` `Cannot use query parameters when fetching a single position by id`.
- `404` `Position not found` for an unknown, inactive or system position. A `404` does not mean the id never existed.
- `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`.

**Related:**

- `GET /v1/positions` lists active positions.

## Path parameters

- `id` (integer, **required**): Position id. Minimum: 1. Example: `4`.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/positions/4" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: The position, as the only item of `data.positions`

- `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)
  - `requested_by` (string): Name of the API credential your token belongs to.
  - `current_page` (integer): Always 1.
  - `per_page` (integer): Always 50. Ignore it.
  - `total` (integer): Always 1.
  - `last_page` (integer): Always 1.
  - `positions` (array of object): Exactly one position.
    - `id` (integer): Position id. Use it as `position_id` or `sub_position_id` elsewhere.
    - `position_name` (string): Position name.
    - `parent_id` (integer, nullable): Id of the position this one sits under, or null.
    - `org_parent_id` (integer, nullable): Id of the position above this one in the org chart, or null.
    - `is_manager` (integer): 1 for a manager position.
    - `status` (integer): Always 1 (active).
    - `worker_type` (string, nullable): Worker type, such as `1099` or `w2`.
    - `is_selfgen` (integer): 0 none, 1 self-gen, 2 closer, 3 setter. One of: `0`, `1`, `2`, `3`.
    - `peoples_count` (integer): Users assigned to this position, counting every status.
    - `group` (object, nullable): Permission group.
      - `id` (integer): Group id. Filter with `group_id`.
      - `name` (string): Group name.
    - `department` (object, nullable): Department.
      - `id` (integer): Department id. Filter with `department_id`.
      - `name` (string): Department name.
    - `pay_frequency` (object, nullable): How often the position is paid. Use only the two fields below.
      - `frequency_type_id` (integer): Pay frequency id, as in `GET /v1/pay-frequency`.
      - `frequency_type_name` (string): Pay frequency name, for example `Weekly`.
    - `deduction_limit` (object, nullable): One deduction limit setting, or null. Not reliable when the position has several.
    - `reconciliation` (object, nullable): One reconciliation setting, or null. Not reliable when the position has several.
    - `child_positions` (array of object): Active positions whose `parent_id` is this position.
      - `id` (integer): Child position id.
      - `parent_id` (integer): This position's id.
      - `position_name` (string): Child position name.
      - `is_manager` (integer): 1 for a manager position.
      - `setup_status` (integer): Always 1 (active).
      - `group_id` (integer, nullable): Permission group id.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requested_by": "acme",
    "current_page": 1,
    "per_page": 50,
    "total": 1,
    "last_page": 1,
    "positions": [
      {
        "id": 4,
        "parent_id": null,
        "org_parent_id": null,
        "position_name": "Sales Manager",
        "is_manager": 1,
        "status": 1,
        "worker_type": "1099",
        "is_selfgen": 0,
        "peoples_count": 5,
        "group": {
          "id": 2,
          "name": "Sales",
          "position_id": 4
        },
        "pay_frequency": {
          "frequency_type_id": 1,
          "frequency_type_name": "Weekly",
          "position_id": 4
        },
        "department": {
          "id": 1,
          "name": "Sales",
          "parent_id": null,
          "position_id": 4
        },
        "deduction_limit": null,
        "reconciliation": null,
        "child_positions": []
      }
    ]
  }
}
```

### 400: Invalid id, or query parameters sent with an id

Example (invalid_id): id is not a positive number

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

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

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

### 404: Unknown, inactive or system position

```json
{
  "status": 404,
  "message": "Position not found",
  "data": {}
}
```

### 500: Internal server error

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
