# Manage users with the Salto Space API
> How to create, read, update, and delete users in Salto Space with the Salto Space API.


The Space API, part of Salto IDM Connect, is a REST API that communicates with your Salto Space installation over the SHIP protocol.
This guide explains how to manage the full lifecycle of a user through the API:

- Create a user.
- Get one user or list all users.
- Update a user.
- Delete a user.

You can use any HTTP client, such as Postman, or your own application.
Each step shows the API request and the result in Salto Space.

{{% info-panel %}}
Before you start, follow the guide to [connect Salto Space to the Space API](https://support.saltosystems.com/idm/connect/space-api/connect-salto-space/).
That guide explains how Salto connects the Space API to your Salto Space installation and issues the API credentials you need.
Then [request an access token](/space/space-api/authentication) for the requests shown here.
{{% /info-panel %}}

## Step 1: Create a user {#step-1-create-a-user}

1. Use the `POST /api/v1/users` endpoint to create a user.
The following payload shows the minimal fields:

    ```json
    {
      "extUserId": "UNIQUE_USER_ID",
      "title": "Mr",
      "firstName": "FIRST_NAME",
      "lastName": "LAST_NAME"
    }
    ```

    - `extUserId` is the unique identifier of the user in Salto Space.
    You can provide any string, and you use this value to get, update, or delete the user later.
    - `firstName` and `lastName` set the name shown in Salto Space.

2. After a successful response, confirm that the user was created in Salto Space.
You can filter the **Ext ID** column of the **Users** list by the `extUserId` you used.

    ![New user shown in the Users list in Salto Space.](images/user-created.png)
    {.border}

{{% info-panel %}}
This example uses only the minimal fields.
See the [Space API reference](https://space.api.saltoidm.app/) for the full list of fields you can set on a user, such as access levels, zones, PIN, and activation or expiration dates.
{{% /info-panel %}}

## Step 2: Get a user {#step-2-get-a-user}

To get users:

- To get a single user, use the `GET /api/v1/users/ID` endpoint, where `ID` is the `extUserId` of the user.
- To list all users, use the `GET /api/v1/users` endpoint.
- To page and filter the results, use the `GET /api/v1/users/filtered` endpoint.

## Step 3: Update a user {#step-3-update-a-user}

1. Use the `PUT /api/v1/users/ID` endpoint, where `ID` is the `extUserId` of the user.
Include the fields you want to set.
The following payload updates the last name:

    ```json
    {
      "extUserId": "UNIQUE_USER_ID",
      "firstName": "FIRST_NAME",
      "lastName": "NEW_LAST_NAME"
    }
    ```

2. After a successful response, confirm the change on the user's page in Salto Space.

    ![Updated last name shown on the user page in Salto Space.](images/user-updated.png)
    {.border}

## Step 4: Delete a user {#step-4-delete-a-user}

1. Use the `DELETE /api/v1/users/ID` endpoint, where `ID` is the `extUserId` of the user.

2. After the user is deleted, the record is removed from Salto Space and all access is revoked, including both mobile and physical keys.
The user no longer appears in the **Users** list.

    ![Users list in Salto Space showing no results for the deleted user.](images/user-deleted.png)
    {.border}

## API definition and documentation {#api-definition-and-documentation}

See the [Space API reference](https://space.api.saltoidm.app/) for a full description of the endpoints and entities available through the API.

The Space API uses a limited set of the functionality available in the full SHIP protocol.
Contact `support-id@saltosystems.com` if you need functionality in the API that is not yet available.

