User API

On this page
Enterprise plan required

This feature requires an Enterprise plan.

This page contains all of the APIs for managing Users through SCIM User requests.

Create a User#

This API is intended to be called by a SCIM Client and is used to create a new FusionAuth User.

Request#

Create a SCIM User by sending the User attributes in the request body.

Client Credentials
Create a User
POST/api/scim/resource/v2/Users

Example Request Body#

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM User request body. However, your incoming request lambda must map these values the FusionAuth User. A default lambda is provided to handle a typical request that you may modify if necessary.

This example is taken from RFC 7643 Section #4.1.

Example Request JSON
{
  "active": true,
  "emails": [
    {
      "primary": true,
      "type": "work",
      "value": "example@fusionauth.io"
    }
  ],
  "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc",
  "name": {
    "familyName": "Doe",
    "formatted": "John Doe",
    "givenName": "John",
    "honorificPrefix": "Mr.",
    "honorificSuffix": "III",
    "middleName": "William"
  },
  "password": "supersecret",
  "phoneNumbers": [
    {
      "primary": true,
      "type": "mobile",
      "value": "303-555-1234"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Users"
  ],
  "userName": "johnny123"
}

Response#

The response for this API contains the SCIM User. The exact response will be controlled by the configured SCIM Server User request converter lambda function.

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains a SCIM Error JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401The request has no valid JWT in the Authorization header. The response is empty. To get a JWT, set up Entities and complete a Client Credentials grant. For more information, see Client Credentials.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.
504One or more webhook endpoints returned an invalid response or didn't respond. Because of the transaction configuration for the event, FusionAuth can't complete the request. FusionAuth logs a stack trace in the FusionAuth log files.

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. For more information, see the SCIM API Overview.

Example Response Body#

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM User response body. However, your incoming request lambda must map these values the FusionAuth User. A default lambda is provided to handle a typical response that you may modify if necessary.

This example is taken from RFC 7643 Section #4.1.

Example Response JSON
{
  "active": true,
  "emails": [
    {
      "primary": true,
      "type": "work",
      "value": "example@fusionauth.io"
    }
  ],
  "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc",
  "id": "9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
  "meta": {
    "created": "2022-04-08T21:03:32.359Z",
    "lastModified": "2022-04-08T21:03:32.359Z",
    "location": "https://piedpiper.com/api/scim/resource/v2/Users/9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
    "resourceType": "User"
  },
  "name": {
    "familyName": "Doe",
    "formatted": "John Doe",
    "givenName": "John",
    "honorificPrefix": "Mr.",
    "honorificSuffix": "III",
    "middleName": "William"
  },
  "phoneNumbers": [
    {
      "primary": true,
      "type": "mobile",
      "value": "303-555-1234"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Users"
  ],
  "userName": "johnny123"
}

Retrieve a User#

This API is used to retrieve a FusionAuth User in SCIM schema format through a SCIM request.

Request#

Retrieve a SCIM User by its Id.

Client Credentials
Retrieves a User
GET/api/scim/resource/v2/Users/{userId}

Path Parameters#

userId
  • Type: UUID
  • Optional

The FusionAuth unique User Id.

Response#

The response for this API contains the User in SCIM schema format.

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains a SCIM Error JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401The request has no valid JWT in the Authorization header. The response is empty. To get a JWT, set up Entities and complete a Client Credentials grant. For more information, see Client Credentials.
404The object doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. For more information, see the SCIM API Overview.

Example Response Body#

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM User response body. However, your incoming request lambda must map these values the FusionAuth User. A default lambda is provided to handle a typical response that you may modify if necessary.

This example is taken from RFC 7643 Section #4.1.

Example Response JSON
{
  "active": true,
  "emails": [
    {
      "primary": true,
      "type": "work",
      "value": "example@fusionauth.io"
    }
  ],
  "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc",
  "id": "9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
  "meta": {
    "created": "2022-04-08T21:03:32.359Z",
    "lastModified": "2022-04-08T21:03:32.359Z",
    "location": "https://piedpiper.com/api/scim/resource/v2/Users/9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
    "resourceType": "User"
  },
  "name": {
    "familyName": "Doe",
    "formatted": "John Doe",
    "givenName": "John",
    "honorificPrefix": "Mr.",
    "honorificSuffix": "III",
    "middleName": "William"
  },
  "phoneNumbers": [
    {
      "primary": true,
      "type": "mobile",
      "value": "303-555-1234"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Users"
  ],
  "userName": "johnny123"
}

Retrieve Users#

This API is used to retrieve a paginated set of Users with an optional filter.

Request#

Retrieve a paginated list of SCIM Users, optionally filtered.

Client Credentials
Retrieve Users
GET/api/scim/resource/v2/Users

Query Parameters#

count
  • Type: Integer
  • Optional

The number of results to return. Used for pagination.

excludedAttributes
  • Type: String
  • Optional
  • Available since 1.39.0

A comma separated list of one or more attributes to exclude in the JSON response body.

For example, a value of phoneNumbers will remove the phoneNumbers attribute from all Users returned in the response.

filter
  • Type: String
  • Optional
  • Available since 1.39.0

The optional filter string to limit the Users returned to those matching the filter criteria.

startIndex
  • Type: Integer
  • Optional

The offset into the total results. In order to paginate the results, increment this value by the count for subsequent requests.

This parameter begins at 1.

Response#

The response for this API contains the User in SCIM schema format.

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains a SCIM Error JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401The request has no valid JWT in the Authorization header. The response is empty. To get a JWT, set up Entities and complete a Client Credentials grant. For more information, see Client Credentials.
404The object doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. For more information, see the SCIM API Overview.

Example Response Body#

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM User response body. However, your incoming request lambda must map these values the FusionAuth User. A default lambda is provided to handle a typical response that you may modify if necessary.

This example is taken from RFC 7643 Section #4.1.

Example Response JSON
{
  "totalResults": 1,
  "itemsPerPage": 25,
  "startIndex": 1,
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "Resources": [
    {
      "active": true,
      "emails": [
        {
          "primary": true,
          "type": "work",
          "value": "example@fusionauth.io"
        }
      ],
      "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc",
      "id": "9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
      "meta": {
        "created": "2022-04-08T21:03:32.359Z",
        "lastModified": "2022-04-08T21:03:32.359Z",
        "location": "https://piedpiper.com/api/scim/resource/v2/Users/9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
        "resourceType": "User"
      },
      "name": {
        "familyName": "Doe",
        "formatted": "John Doe",
        "givenName": "John",
        "honorificPrefix": "Mr.",
        "honorificSuffix": "III",
        "middleName": "William"
      },
      "phoneNumbers": [
        {
          "primary": true,
          "type": "mobile",
          "value": "303-555-1234"
        }
      ],
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Users"
      ],
      "userName": "johnny123"
    }
  ]
}

Update a User#

This API is used to update a new FusionAuth User from a SCIM request. The FusionAuth User will be overwritten by the data contained in the request. It is not a partial update or a patch.

Request#

Update a SCIM User by sending the full set of attributes to replace the existing User.

Client Credentials
Updates a User
PUT/api/scim/resource/v2/Users/{userId}

Path Parameters#

userId
  • Type: UUID
  • Optional

The FusionAuth unique User Id.

Example Request Body#

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM User request body. However, your incoming request lambda must map these values the FusionAuth User. A default lambda is provided to handle a typical request that you may modify if necessary.

This example is taken from RFC 7643 Section #4.1.

Example Request JSON
{
  "active": true,
  "emails": [
    {
      "primary": true,
      "type": "work",
      "value": "example@fusionauth.io"
    }
  ],
  "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc",
  "name": {
    "familyName": "Doe",
    "formatted": "John Doe",
    "givenName": "John",
    "honorificPrefix": "Mr.",
    "honorificSuffix": "III",
    "middleName": "William"
  },
  "password": "supersecret",
  "phoneNumbers": [
    {
      "primary": true,
      "type": "mobile",
      "value": "303-555-1234"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Users"
  ],
  "userName": "johnny123"
}

Response#

The response for this API contains the User that was updated in SCIM schema format.

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains a SCIM Error JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401The request has no valid JWT in the Authorization header. The response is empty. To get a JWT, set up Entities and complete a Client Credentials grant. For more information, see Client Credentials.
404The object doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.
504One or more webhook endpoints returned an invalid response or didn't respond. Because of the transaction configuration for the event, FusionAuth can't complete the request. FusionAuth logs a stack trace in the FusionAuth log files.

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. For more information, see the SCIM API Overview.

Example Response Body#

The SCIM specification allows for customization of the schemas using extensions. Therefore, it is not possible to accurately document all the possible variations.

The following is an example of a typical SCIM User response body. However, your incoming request lambda must map these values the FusionAuth User. A default lambda is provided to handle a typical response that you may modify if necessary.

This example is taken from RFC 7643 Section #4.1.

Example Response JSON
{
  "active": true,
  "emails": [
    {
      "primary": true,
      "type": "work",
      "value": "example@fusionauth.io"
    }
  ],
  "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc",
  "id": "9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
  "meta": {
    "created": "2022-04-08T21:03:32.359Z",
    "lastModified": "2022-04-08T21:03:32.359Z",
    "location": "https://piedpiper.com/api/scim/resource/v2/Users/9d222d72-f62b-48c3-a5b7-f2dc934b1ee4",
    "resourceType": "User"
  },
  "name": {
    "familyName": "Doe",
    "formatted": "John Doe",
    "givenName": "John",
    "honorificPrefix": "Mr.",
    "honorificSuffix": "III",
    "middleName": "William"
  },
  "phoneNumbers": [
    {
      "primary": true,
      "type": "mobile",
      "value": "303-555-1234"
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Users"
  ],
  "userName": "johnny123"
}

Delete a User#

This API is used to hard delete a FusionAuth User. You must specify the Id of the User on the URI.

The data of a User who has been hard deleted is permanently removed from FusionAuth. The User's data cannot be restored via the FusionAuth API or the Admin UI. If you need to restore the User's data, you must retrieve it from a database backup.

Request#

Delete a SCIM User by its Id.

Client Credentials
Delete a User
DELETE/api/scim/resource/v2/Users/{userId}

Path Parameters#

userId
  • Type: UUID
  • Required

The FusionAuth unique User Id.

Response#

This API does not return a JSON response body.

Response Codes
CodeDescription
204The request succeeded. The response is empty.
400The request was invalid or malformed. The response contains a SCIM Error JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401The request has no valid JWT in the Authorization header. The response is empty. To get a JWT, set up Entities and complete a Client Credentials grant. For more information, see Client Credentials.
404The object doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.
504One or more webhook endpoints returned an invalid response or didn't respond. Because of the transaction configuration for the event, FusionAuth can't complete the request. FusionAuth logs a stack trace in the FusionAuth log files.

For FusionAuth SCIM endpoints, any error responses will be returned in standard SCIM schema. For more information, see the SCIM API Overview.