---
title: "Create Scheduled Userstate Job"
method: POST
path: "/api/v2/bulk/userstates"
tags: ["Bulk Job Requests"]
---

# Create Scheduled Userstate Job

`POST /api/v2/bulk/userstates`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/v2/bulk/userstates`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/v2/bulk/userstates/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint allows you to create scheduled statechange jobs.
#### Sample Request
```
curl -X POST "https://console.jumpcloud.com/api/v2/bulk/userstates" \
  -H 'x-api-key: {API_KEY}' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "user_ids": ["{User_ID_1}", "{User_ID_2}", "{User_ID_3}"],
    "state": "SUSPENDED",
    "start_date": "2000-01-01T00:00:00.000Z"
  }'
```

## Headers

- `x-org-id` string

## Request body

- BulkScheduledStatechangeCreate: Model to support bulk scheduling of a state change for one or more users
  - `user_ids` string[], required: Array of system user ids to schedule for a state change
  - `state` 'ACTIVATED' | 'SUSPENDED', required: The state to move the user(s) to
  - `start_date` string, date-time, required: Date and time that scheduled action should occur
  - `send_activation_emails` boolean: Set to true to send activation or welcome email(s) to each user_id upon activation. Set to false to suppress emails. Can only be used with scheduled activation(s).
  - `activation_email_override` string: Send the activation or welcome email to the specified email address upon activation. Can only be used with a single user_id and scheduled activation. This field will be ignored if `send_activation_emails` is explicitly set to false.

## Response `201`

Created

- ScheduledUserstateResult[]
  - `scheduledJobId` string: The id of the scheduled job that scheduled the state change.
  - `scheduledDate` string: The UTC date and time when the scheduled job will execute.
  - `state` string: The state that the user will be in once the scheduled job executes.
  - `systemUserId` string: The id of the user that the scheduled job will update.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/revisions/f396d9271b46?raw)
