---
schema_version: "1"
id: 7adb4acb21cee16310e1782f3517df69cf35469908ac0b0dee5a110f1d35e44a
title: Create Service Appointments
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/uc1-create-single-resource-appointment.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc1-create-single-resource-appointment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 50404e40c0d07060b5f7c93aa520c12a467f8ae8398f80b30849d6d2b7087c17
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Create Service Appointments

Show your users the details of a service appointment—an appointment booked through Salesforce Scheduler—so that users can review and create the appointment.

1.  Create a page where the user can review the appointment details and create the appointment.

2.  Make a `POST` request on the [`service-appointments`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_service_appointments.htm) Connect API to create the service appointment.

    **Resource URI**

    ```nolang
    https://YOUR_INSTANCE.salesforce.com/services/data/v68.0/connect/scheduling/service-appointments
    ```

    Where `YOUR_INSTANCE` is a variable.

    **For an Existing User (Account)**

    **Sample Request**

    Pass the account ID as `parentRecordId` in the input request body.

    To indicate that the appointment is scheduled, set `status` to `Scheduled`.

    ```nolang
    {
      "serviceAppointment": {
        "serviceTerritoryId": "0HhS700000001DYKAY",
        "parentRecordId": "001S7000001pFlJIAU",
        "engagementChannelTypeId": "0eFS70000004CG5MAM",
        "schedStartTime": "2023-02-15T17:00:00.000+0000",
        "schedEndTime": "2023-02-15T18:00:00.000+0000",
        "street": "121 Spear Street",
        "city": "Charlotte",
        "state": "VT",
        "postalCode": "05445",
        "country": "United States",
        "extendedFields": [
          {
            "name": "status",
            "value": "Scheduled"
          }
        ]
      },
      "assignedResources": [
        {
          "serviceResourceId": "0HnS700000002jAKAQ",
          "isRequiredResource": true
        }
      ]
    }
    ```

    **Sample Response**

    The API returns the service appointment ID and the assigned service resources.

    ```nolang
    {
      "result": {
        "assignedResourceIds": [
          "03rS700000000hPIAQ"
        ],
        "serviceAppointmentId": "08pS7000000018wIAA"
      }
    }
    ```

    **For a Guest User (Lead)**

    **Sample Request**

    Pass the required lead details in the input request body.

    To indicate that the appointment is scheduled, set `status` to `Scheduled`.

    ```nolang
    
    {
      "serviceAppointment": {
        "serviceTerritoryId": "0HhS700000001DYKAY",
        "engagementChannelTypeId": "0eFS70000004CG5MAM",
        "schedStartTime": "2023-02-15T17:00:00.000+0000",
        "schedEndTime": "2023-02-15T18:00:00.000+0000",
        "street": "121 Spear Street",
        "city": "Charlotte",
        "state": "VT",
        "postalCode": "05445",
        "country": "United States",
        "extendedFields": [
          {
            "name": "status",
            "value": "Scheduled"
          }
        ]
      },
      "assignedResources": [
        {
          "serviceResourceId": "0HnS700000002jAKAQ",
          "isRequiredResource": true
        }
      ],
      "lead": {
        "firstName": "Mark",
        "lastName": "Taylor",
        "phone": "012-345-6789",
        "email": "mtaylor@company.com",
        "company": "Company1"
      }
    }
    ```

    **Sample Response**

    The API returns the service appointment ID and the assigned service resources.

    ```nolang
    
    {
      "result": {
        "assignedResourceIds": [
          "03rS700000000hUIAQ"
        ],
        "parentRecordId": "00QS7000000sfbOMAQ",
        "serviceAppointmentId": "08pS70000000191IAA"
      }
    }
    ```


Create a page to show confirmation when the service appointment is created successfully.

Here’s how a sample confirmation page can look.

![A representation of the confirmation screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_appointment_creation.png)

