User Action Reasons

Overview

This page contains the APIs that are used to manage user action reasons. Here are the APIs:

Create a User Action Reason

This API is used to create an User Action Reason. Specifying an Id on the URI will instruct FusionAuth to use that Id when creating the User Action Reason. Otherwise, FusionAuth will generate an Id for the User Action Reason.

Request

API Key Authentication
Create a User Action Reason with a randomly generated Id
POST /api/user-action-reason
API Key Authentication
Create a User Action Reason with the given Id
POST /api/user-action-reason/{userActionReasonId}

Request Parameters

userActionReasonIdUUIDDefaults to secure random UUID

The Id to use for the new User Action Reason. If not specified a secure random UUID will be generated.

Request Body

userActionReason.codeStringrequired

A short code for the User Action Reason.

userActionReason.localizedTextsMap<Locale, String>

A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.

userActionReason.textStringrequired

The text of the User Action Reason.

Example Request JSON

{
  "userActionReason": {
    "code": "VTOS",
    "localizedTexts": {
      "fr": "Violation de nos Conditions générales d'utilisation"
    },
    "text": "Violation of our Terms of Service"
  }
}

Response

The response for this API contains the information for the User Action Reason that was created.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

userActionReason.codeString

A short code for the User Action Reason.

userActionReason.idUUID

The Id of the User Action Reason.

userActionReason.localizedTextsMap<Locale, String>

A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.

userActionReason.textString

The text of the User Action Reason.

Example Response JSON for a Single User Action Reason

{
  "userActionReason": {
    "code": "VTOS",
    "id": "00000000-0000-0000-0000-000000000002",
    "localizedTexts": {
      "fr": "Violation de nos Conditions générales d'utilisation"
    },
    "text": "Violation of our Terms of Service"
  }
}

Retrieve a User Action Reason

This API is used to retrieve one or all of the configured User Action Reasons. Specifying an Id on the URI will retrieve a single User Action Reason. Leaving off the Id will retrieve all of the User Action Reasons.

Request

API Key Authentication
Retrieve all of the User Action Reasons
GET /api/user-action-reason
API Key Authentication
Retrieve a User Action Reason by Id
GET /api/user-action-reason/{userActionReasonId}

Request Parameters

userActionReasonIdUUID

The Id of the User Action Reason to retrieve.

Response

The response for this API contains either a single User Action Reason or all of the User Action Reasons. When you call this API with an Id the response will contain just that User Action Reason. When you call this API without an Id the response will contain all of the User Action Reasons. Both response types are defined below along with an example JSON response.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

userActionReason.codeString

A short code for the User Action Reason.

userActionReason.idUUID

The Id of the User Action Reason.

userActionReason.localizedTextsMap<Locale, String>

A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.

userActionReason.textString

The text of the User Action Reason.

Example Response JSON for a Single User Action Reason

{
  "userActionReason": {
    "code": "VTOS",
    "id": "00000000-0000-0000-0000-000000000002",
    "localizedTexts": {
      "fr": "Violation de nos Conditions générales d'utilisation"
    },
    "text": "Violation of our Terms of Service"
  }
}

Response Body

userActionReasonsArray

The list of User Action Reason objects.

userActionReasons[x].codeString

A short code for the User Action Reason.

userActionReasons[x].idUUID

The Id of the User Action Reason.

userActionReasons[x].localizedTextsMap<Locale, String>

A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.

userActionReasons[x].textString

The text of the User Action Reason.

Example Response JSON for all the User Action Reasons

{
  "userActionReasons": [
    {
      "code": "VTOS",
      "id": "00000000-0000-0000-0000-000000000002",
      "localizedTexts": {
        "fr": "Violation de nos Conditions générales d'utilisation"
      },
      "text": "Violation of our Terms of Service"
    }
  ]
}

Update a User Action Reason

This API is used to update an existing User Action Reason.

You must specify all of the properties of the User Action Reason when calling this API with the PUT HTTP method. When used with PUT, this API doesn’t merge the existing User Action Reason and your new data. It replaces the existing User Action Reason with your new data.

Utilize the PATCH HTTP method to send specific changes to merge into an existing User Action Reason.

Request

API Key Authentication
Update the User Action Reason by Id
PUT /api/user-action-reason/{userActionReasonId}
PATCH /api/user-action-reason/{userActionReasonId}

When using the PATCH method, you can either use the same request body documentation that is provided for the PUT request for backward compatibility. Or you may use either JSON Patch/RFC 6902] or JSON Merge Patch/RFC 7396. See the PATCH documentation for more information.

When using the PATCH method with a Content-Type of application/json the provided request parameters will be merged into the existing object, this means all parameters are optional when using the PATCH method and you only provide the values you want changed. A null value can be used to remove a value. Patching an Array will result in all values from the new list being appended to the existing list, this is a known limitation to the current implementation of PATCH.

Request Parameters

userActionReasonIdUUIDrequired

The Id of the User Action Reason to update.

Request Body

userActionReason.codeStringrequired

A short code for the User Action Reason.

userActionReason.localizedTextsMap<Locale, String>

A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.

userActionReason.textStringrequired

The text of the User Action Reason.

Example Request JSON

{
  "userActionReason": {
    "code": "VTOS",
    "localizedTexts": {
      "fr": "Violation de nos Conditions générales d'utilisation"
    },
    "text": "Violation of our Terms of Service"
  }
}

Response

The response for this API contains the new information for the User Action Reason that was updated.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you are trying to update doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

userActionReason.codeString

A short code for the User Action Reason.

userActionReason.idUUID

The Id of the User Action Reason.

userActionReason.localizedTextsMap<Locale, String>

A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.

userActionReason.textString

The text of the User Action Reason.

Example Response JSON for a Single User Action Reason

{
  "userActionReason": {
    "code": "VTOS",
    "id": "00000000-0000-0000-0000-000000000002",
    "localizedTexts": {
      "fr": "Violation de nos Conditions générales d'utilisation"
    },
    "text": "Violation of our Terms of Service"
  }
}

Delete a User Action Reason

This API is used to delete an User Action Reason. You must specify the Id of the User Action Reason on the URI.

Request

API Key Authentication
Delete a User Action Reason by Id
DELETE /api/user-action-reason/{userActionReasonId}

Request Parameters

userActionReasonIdUUIDrequired

The Id of the User Action Reason to delete.

Response

This API does not return a JSON response body.

Response Codes
Code Description
200 The request was successful.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.