---
title: "Create a work activity for the specified work order"
method: POST
path: "/workorders/{workorderId}/workactivities"
tags: ["WorkActivities"]
---

# Create a work activity for the specified work order

`POST /workorders/{workorderId}/workactivities`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/workorders/{workorderId}/workactivities`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/workorders/:workorderId/workactivities/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new work activity for the specified work order. The work activity type can be either *Travel* or *Repair*. Note that custom types may be configured for a subscriber.
            <br />Before creating a work activity, please consider the following:
             • You can create work activities only for work orders in the *In Progress* primary status.
             • The check-in date and time cannot be greater than the check-out date and time.
             • The check-in date and time cannot be earlier than the scheduled date and time of the work order.
             • The time range of the work activity you are creating cannot overlap the time ranges of existing work activities of the work order.
             • The name will be set to the API caller name if the `name` value is not provided.
            <br />***Note:*** Both subscribers and providers can use this method.
            <br />***Note:*** Only users with extended permissions can specify the technician's name while creating a work activity. The users with extended permissions are:
             • Subscribers that have the *Admin* role.
             • Providers that have the *Admin* role (with the *EditLaborItemsOnWoDetailsProvider* feature flag turned on).
             • Providers that have the *Business Owner / Management* role (with the *EditLaborItemsOnWoDetailsProvider* feature flag turned on).
            <br />Learn more about [creating a work activity](https://servicechannel.atlassian.net/wiki/spaces/SCU/pages/576258285/Updating+Service+Provider+Check-In+Out+Information) in ServiceChannel University.
            <br />**Example Request**
            
                POST /workorders/{workorderId}/workactivities
                {
                   "WorkTypeId": "1",       
                   "CheckInDate": "2020-11-19T11:10:36.868Z",
                   "CheckOutDate": "2020-11-19T12:15:36.868Z",
                   "Name": "John Doe"
                }

## Path parameters

- `workorderId` integer, required

## Request body

- ServiceChannelServicesMessagingWorkordersWorkActivityPostRequest: Request object to create a work activity.
  - `WorkTypeId` integer: The type of activity performed: 1 — *Repair*, 2 — *Travel*. You can pass other values if custom types are set up for the subscriber.
  - `CheckInDate` string, date-time: The date and time when a technician started work on the service request. The format is `YYYY-MM-DDThh:mm:ss.sssZ`. The default is the current date and time.
  - `CheckOutDate` string, date-time: The date and time when a technician finished work on the service request. The format is `YYYY-MM-DDThh:mm:ss.sssZ`. The default is the current date and time.
  - `Name` string: (*Optional*) The name of technician who worked on the service request.

## Response `201`

A work activity is created for the specified work order, and a unique work activity ID is returned in the response.

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 502 — WorkOrder not found 503 — Work Type Not Found 503 — Date range is incorrect 503 — Check In/Out is premature 904 — Invalid work order status 1186 — Time range is overlapped
- `401`: The request is not authorized. <br/>Error codes: 504 — API call rejected by security permissions
- `403`: You are not authorized to request this resource, or the resource is unavailable for some reason. <br/>Error codes: 804 — User has no permissions to perform this action
- `406`: The request is already processed.
- `500`: The server was unable to complete the request due to an internal error.

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
