# Assign a worker to an unassigned shift

> Assign a worker to an unassigned shift (open shift). The shift must be an open shift and not at capacity.

POST

/unassignedshifts/{id}/assign/

Assigns a worker to an unassigned shift by ID.

#### Helpful resources

-   [Create and manage schedules and shifts](https://developer.rippling.com/documentation/rest-api/guides/scheduling)
-   [Schedules](https://help.rippling.com/page?page=scheduling)
-   [Add a shift to a schedule](https://help.rippling.com/article?articleId=6vPpyfXrWNHCLjd4Mj35xI)

### Required Scopes

-   unassignedshifts.read-write
    

### Request

Path Parameters

**id** string required

The unique identifier of the unassigned shift.

-   application/json

**Body**

**worker\_id** string required

The ID of the worker (role) to assign to the shift

## Responses

-   200
-   400
-   401
-   403

Successful response

-   application/json

-   Schema
-   Example (from schema)

**Schema**

**assignment\_id** string

The ID of the newly created shift assignment

**assigned\_count** integer

The current number of assigned workers for this shift

**target\_count** integer

The target number of workers for this shift

**assigned\_shift\_ids** string\[\]

List of shift assignment IDs for this shift

```json
{
  "assignment_id": "string",
  "assigned_count": 0,
  "target_count": 0,
  "assigned_shift_ids": [
    "string"
  ]
}
```

The request failed validation. The response body describes the error.

-   application/json

-   Schema
-   Example (from schema)

**Schema**

**detail** string

A human-readable explanation of why the request failed.

```json
{
  "detail": "string"
}
```

Authentication is required or the supplied credentials are invalid.

-   application/json

-   Schema
-   Example (from schema)

**Schema**

-   Matches one or more of these formats:
    
    1.  **Format 1**
        
        **ok** boolean required
        
        Whether the request succeeded. Always false for an authentication error.
        
        **Possible values:** \[false\]
        
        **error** string required
        
        A human-readable explanation of why authentication failed.
        
    2.  **Format 2**
        
        **detail** string required
        
        A human-readable explanation of the authentication error.
        

**Format 1**

```json
{
  "ok": false,
  "error": "Incorrect authentication credentials."
}
```

**Format 2**

```json
{
  "detail": "string"
}
```

The caller is not authorized to perform this action.

-   application/json

-   Schema
-   Example (from schema)

**Schema**

**detail** string

A human-readable explanation of why the request failed.

```json
{
  "detail": "string"
}
```

Source: https://developer.rippling.com/documentation/rest-api/reference/assign-unassignedshifts

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
