User Action Reason APIs

1. Overview

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

2. 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.

2.1. Request

Create a User Action Reason with a generated Id

URI

POST /api/user-action-reason

Create a User Action Reason with the given Id

URI

POST /api/user-action-reason/{userActionReasonId}

Table 1. Request Parameters

userActionReasonId [UUID] Optional defaults to secure random UUID

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

Table 2. Request Body

userActionReason.code [String] Required

A short code for the User Action Reason.

userActionReason.localizedTexts [Map<Locale, String>] Optional

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

userActionReason.text [String] Required

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"
  }
}

2.2. Response

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

Table 3. 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.

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.

Table 4. Response Body for a single User Action Reason

userActionReason.code [String]

A short code for the User Action Reason.

userActionReason.id [UUID]

The Id of the User Action Reason.

userActionReason.localizedTexts [Map<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.text [String]

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"
  }
}

3. 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.

3.1. Request

Retrieve all of the User Action Reasons

URI

GET /api/user-action-reason

Retrieve a User Action Reason by Id

URI

GET /api/user-action-reason/{userActionReasonId}

Table 5. Request Parameters

userActionReasonId [UUID] Optional

The Id of the User Action Reason to retrieve.

3.2. 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.

Table 6. 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.

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.

Table 7. Response Body for a single User Action Reason

userActionReason.code [String]

A short code for the User Action Reason.

userActionReason.id [UUID]

The Id of the User Action Reason.

userActionReason.localizedTexts [Map<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.text [String]

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"
  }
}
Table 8. Response Body for all User Action Reasons

userActionReasons [Array]

The list of User Action Reason objects.

userActionReasons[x].code [String]

A short code for the User Action Reason.

userActionReasons[x].id [UUID]

The Id of the User Action Reason.

userActionReasons[x].localizedTexts [Map<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].text [String]

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"
    }
  ]
}

4. Update a User Action Reason

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

4.1. Request

Update the User Action Reason by Id

URI

PUT /api/user-action-reason/{userActionReasonId}

Table 9. Request Parameters

userActionReasonId [UUID] Required

The Id of the User Action Reason to update.

Table 10. Request Body

userActionReason.code [String] Required

A short code for the User Action Reason.

userActionReason.localizedTexts [Map<Locale, String>] Optional

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

userActionReason.text [String] Required

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"
  }
}

4.2. Response

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

Table 11. 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.

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 updated 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.

Table 12. Response Body for a single User Action Reason

userActionReason.code [String]

A short code for the User Action Reason.

userActionReason.id [UUID]

The Id of the User Action Reason.

userActionReason.localizedTexts [Map<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.text [String]

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"
  }
}

5. 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.

5.1. Request

Delete a User Action Reason by Id

URI

DELETE /api/user-action-reason/{userActionReasonId}

Table 13. Request Parameters

userActionReasonId [UUID] Required

The Id of the User Action Reason to delete.

5.2. Response

This API does not return a JSON response body.

Table 14. Response Codes
Code Description

200

The request was successful. The response will be empty.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

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 delete 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.