> For the complete documentation index, see [llms.txt](https://docs.siit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.siit.io/guides/workflows/automations-and-workflows-use-cases/webhook-google-workspace-users.md).

# Create Google Workspace users with a webhook

Seamlessly Provision Users with Siit Webhooks and the Google Directory API.

Connecting your Siit workflows to **Google Workspace** allows you to automate user provisioning, ensuring that new employees are ready to go as soon as their Siit lifecycle event triggers.

### Prerequisites: Google Workspace Setup

Before configuring the webhook in Siit, you need to set up the Google Workspace Directory API. This step ensures Siit has permission to create users.

1. **Enable the Admin SDK:** In your Google Cloud project, enable the **Admin SDK API** (specifically for the Directory API).
2. **Authentication:** The Google Directory API requires an **OAuth 2.0 token** for authorization. The most secure and common method for server-to-server workflows is using a **Service Account** with **Domain-Wide Delegation** enabled.
   * Once set up, your workflow (or an intermediary service) must be able to generate and provide a valid **Bearer Token** for the `Authorization` header.
3. **API Endpoint:** The specific URL for creating a user is:

   ```
   https://admin.googleapis.com/admin/directory/v1/users
   ```

For full details on the required fields and response structure, consult the official Google documentation for the `users.insert` method: [Directory API: Users Insert](https://developers.google.com/workspace/admin/directory/reference/rest/v1/users/insert).

***

### 🛠️ Siit Webhook Configuration

Using the **"Send external request"** action in your Siit workflow, follow these steps to construct the request.

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-ce4663a0f1701600be2ce59891a49331ca125c74%2FCleanShot-2026-01-18-at-14-27-04-2x-png.png?alt=media" alt=""><figcaption></figcaption></figure>

### Step 1: Set the URL and Method

In the **Send external request** panel (as shown in your screenshot):

1. **URL:** Enter the Google API endpoint:

   ```
   https://admin.googleapis.com/admin/directory/v1/users
   ```
2. **HTTP Method:** Select **POST** (this is mandatory for creating a new resource).

### Step 2: Add Headers

You need to add at least two headers: one for the data format and one for authentication. Click **+ Add header**.

| Header Name       | Value                        | Description                                                                                          |
| ----------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------- |
| **Content-Type**  | `application/json`           | Tells the Google API to expect a JSON payload.                                                       |
| **Authorization** | `Bearer [YOUR_ACCESS_TOKEN]` | Replace `[YOUR_ACCESS_TOKEN]` with the valid OAuth 2.0 Bearer token obtained from your Google setup. |

Step 3: Construct the JSON Body

Select the **Raw** option under the **Body** section. You will use the available Siit variables (from the "Add variable" sidebar) to dynamically populate the user data required by the Google API.

The Google API requires a minimum set of fields, including the primary email, the user's name, and a temporary password.

Use the **+ Add variable** button to inject the variable placeholders directly into the **Raw** text field.

**Example Raw JSON Body:**

JSON

```
{
  "primaryEmail": "{Email}",
  "name": {
    "givenName": "{First name}",
    "familyName": "{Last name}"
  },
  "password": "[SOME_TEMPORARY_PASSWORD]",
  "changePasswordAtNextLogin": true,
  "suspended": false
}
```

*⚠️ when copy pasting the script, make sure to replace **Email, First name and Last name** with the corresponding Siit requester variable clicking on **"+ Add variable"** as per the screenshot below:*

<figure><img src="https://2274035325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlWFhpq2ia6gdHet0opKx%2Fuploads%2Fgit-blob-5dde4ad9096607b9c8057d93e8f11b36142f0da3%2FCleanShot-2026-01-18-at-14-31-01-2x-png-1.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Variable Mapping Checklist:

| Google API Field            | Siit Variable  | Notes                                                                                                                     |
| --------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `primaryEmail`              | `{Email}`      | Maps to the employee's email address.                                                                                     |
| `name.givenName`            | `{First name}` | Maps to the employee's first name.                                                                                        |
| `name.familyName`           | `{Last name}`  | Maps to the employee's last name.                                                                                         |
| `password`                  | Static Value   | **Important:** You must set a temporary password. Use a secure static value or generate one in your workflow if possible. |
| `changePasswordAtNextLogin` | `true`         | Recommended for security.                                                                                                 |

By completing these steps, when your Siit workflow is triggered (e.g., when a new employee's status changes to "Active" on the start date), the webhook will fire, sending the necessary employee data to Google to create their Workspace account automatically.

✅ Done! Siit now adds users automatically to Google Workspace.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.siit.io/guides/workflows/automations-and-workflows-use-cases/webhook-google-workspace-users.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
