---
schema_version: "1"
id: e3a0204b1f3d70e7b7ec4f1894bad030c2b9ddbb0d2ffa05dce0a0ed7436308b
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/uc8-create-anonymous-appointment.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc8-create-anonymous-appointment.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6ecf0d59037e7d0b151dd3dd64bcf5302d4457ed62c08f8e4b6b116bbaa84fed
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Create Service Appointments

A service appointment represents an appointment booked through Salesforce Scheduler. To create an appointment, make a POST request on the `service-appointments` Connect API.

Create a page where the user can review the appointment details and create the appointment. Here’s how a Review Service Appointment page can look.

**note:** To keep the service resource private, hide the resource’s name on the review appointment page.

![A representation of the Review Service Appointment screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/screen_review_anonymous_appointment.png)

Link the Next button to 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://yourInstance.salesforce.com/services/data/vXX.X/connect/scheduling/service-appointments
```

**For an Existing User (Account)**

**Sample Request**

Pass the account ID as `parentRecordId` in the input request body.

Set `IsAnonymousBooking` to `true` to indicate that the appointment is anonymous.

```nolang
{
   "serviceAppointment": {
      "serviceTerritoryId": "0Hh2w000000XmoXCAS",
      "parentRecordId" : "001B000001McLhMIAV", //accountId
      "schedStartTime" : "2021-05-24T15:30:00:00.000+0000",
      "schedEndTime": "2021-05-24T16:30:00.000+0000",
      "street": "1 Market Street",
      "city": "San Francisco",
      "state": "CA",
      "postalCode": "94105",
      "country": "USA",
      "extendedFields" : [ {
        "name": "IsAnonymousBooking", 
        "value": "true"
      } ]
   },
   "assignedResources": [
      {
        "serviceResourceId": "0HnB0000000LVbfKAG",
        "extendedFields" : []
      }
   ]
}
```

**Sample Response**

The API returns the service appointment ID and the assigned service resources.

```nolang
{
   "result" : {
      "assignedResourceIds" : [ "0HnB0000000LVbfKAG" ],
      "serviceAppointmentId" : "08pB0000000hvR6IAI"
   }
}
```

**For a Guest User (Lead)**

**Sample Request**

Pass the required lead details in the input request body.

Set `IsAnonymousBooking` to `true` to indicate that the appointment is anonymous.

```nolang
{
   "serviceAppointment": {
      "serviceTerritoryId": "0Hh2w000000XmoXCAS",
      "schedStartTime" : "2021-05-24T15:30:00:00.000+0000",
      "schedEndTime": "2021-05-24T16:30:00.000+0000",
      "street": "1 Market Street",
      "city": "San Francisco",
      "state": "CA",
      "postalCode": "94105",
      "country": "USA",
      "extendedFields" : [ {
        "name": "IsAnonymousBooking", 
        "value": "true"
      } ]
   },
   "assignedResources": [
      {
        "serviceResourceId": "0HnB0000000LVbfKAG",
        "isRequiredResource": true,
        "isPrimaryResource": true,
        "extendedFields" : []
      }
   ],
   "lead": {
        "firstName": "Mark",
        "lastName": "Taylor",       
        "phone": "012-345-6789",            
        "email": "mtaylor@company.com",
        "company": "Company1",
        "extendedFields" : []
   }
}
```

**Sample Response**

The API returns the service appointment ID and the assigned service resources.

```nolang
{
   "result" : {
      "assignedResourceIds" : [ "0HnB0000000LVbfKAG" ],
      "parentRecordId" : "00QB00000094lOZMAY",
      "serviceAppointmentId" : "08pB0000000hvR1IAI"
   }
}
```

Create a page to show confirmation when the service appointment creation is completed.

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)

