> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrubbe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# On-Call Scheduling API: Assign and Retrieve Members

> Manage on-call schedules by assigning team members to time slots and retrieving current or historical assignments via the REST API.

The on-call scheduling API lets you programmatically assign team members to coverage windows and query those assignments. Use it to automate schedule generation, integrate with HR systems, or build custom dashboards that surface who is on call at any given moment.

All requests require a Bearer token in the `Authorization` header.

***

## Assign a member

<Note>
  The `date` field follows ISO 8601 format (`YYYY-MM-DD`). Times are in 24-hour format (`HH:MM`) and are interpreted in UTC unless your account has a default timezone configured.
</Note>

`POST https://your-api-domain.com/api/v1/assign-member`

Assigns a single team member to an on-call shift on the given date between `startTime` and `endTime`.

### Request body

<ParamField body="userId" type="string" required>
  The unique identifier of the team member to assign.
</ParamField>

<ParamField body="date" type="string" required placeholder="2026-03-15">
  The calendar date for the shift in `YYYY-MM-DD` format.
</ParamField>

<ParamField body="startTime" type="string" required placeholder="09:00">
  Shift start time in 24-hour `HH:MM` format.
</ParamField>

<ParamField body="endTime" type="string" required placeholder="17:00">
  Shift end time in 24-hour `HH:MM` format. Must be after `startTime`.
</ParamField>

### Response fields

<ResponseField name="id" type="string" required>
  Unique identifier for the newly created assignment.
</ResponseField>

<ResponseField name="userId" type="string" required>
  The user ID that was assigned.
</ResponseField>

<ResponseField name="date" type="string" required>
  The scheduled date in `YYYY-MM-DD` format.
</ResponseField>

<ResponseField name="startTime" type="string" required>
  The shift start time.
</ResponseField>

<ResponseField name="endTime" type="string" required>
  The shift end time.
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp of when the assignment was created.
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://your-api-domain.com/api/v1/assign-member \
    --header 'Authorization: Bearer YOUR_TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{
      "userId": "user_abc123",
      "date": "2026-03-15",
      "startTime": "09:00",
      "endTime": "17:00"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/assign-member',
    {
      method: 'POST',
      headers: {
        Authorization: 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        userId: 'user_abc123',
        date: '2026-03-15',
        startTime: '09:00',
        endTime: '17:00',
      }),
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://your-api-domain.com/api/v1/assign-member',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
      json={
          'userId': 'user_abc123',
          'date': '2026-03-15',
          'startTime': '09:00',
          'endTime': '17:00',
      },
  )
  data = response.json()
  ```
</CodeGroup>

***

## List all assignments

`GET https://your-api-domain.com/api/v1/get-all-assign`

Returns a list of every on-call assignment in the system, ordered by date descending.

### Response fields

<ResponseField name="assignments" type="object[]" required>
  Array of assignment objects.

  <Expandable title="assignment properties">
    <ResponseField name="id" type="string" required>
      Unique identifier for the assignment.
    </ResponseField>

    <ResponseField name="userId" type="string" required>
      The assigned team member's user ID.
    </ResponseField>

    <ResponseField name="date" type="string" required>
      Scheduled date in `YYYY-MM-DD` format.
    </ResponseField>

    <ResponseField name="startTime" type="string" required>
      Shift start time.
    </ResponseField>

    <ResponseField name="endTime" type="string" required>
      Shift end time.
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://your-api-domain.com/api/v1/get-all-assign \
    --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/get-all-assign',
    {
      headers: { Authorization: 'Bearer YOUR_TOKEN' },
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://your-api-domain.com/api/v1/get-all-assign',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
  )
  data = response.json()
  ```
</CodeGroup>

***

## Get a single assignment

`GET https://your-api-domain.com/api/v1/get-assign/:id`

Returns the details of a single on-call assignment by its ID.

### Path parameters

<ParamField path="id" type="string" required>
  The unique identifier of the assignment to retrieve.
</ParamField>

### Response fields

<ResponseField name="id" type="string" required>
  Unique identifier for the assignment.
</ResponseField>

<ResponseField name="userId" type="string" required>
  The assigned team member's user ID.
</ResponseField>

<ResponseField name="date" type="string" required>
  Scheduled date in `YYYY-MM-DD` format.
</ResponseField>

<ResponseField name="startTime" type="string" required>
  Shift start time.
</ResponseField>

<ResponseField name="endTime" type="string" required>
  Shift end time.
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp of when the assignment was created.
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://your-api-domain.com/api/v1/get-assign/assign_xyz789 \
    --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://your-api-domain.com/api/v1/get-assign/assign_xyz789',
    {
      headers: { Authorization: 'Bearer YOUR_TOKEN' },
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://your-api-domain.com/api/v1/get-assign/assign_xyz789',
      headers={'Authorization': 'Bearer YOUR_TOKEN'},
  )
  data = response.json()
  ```
</CodeGroup>
