User Action Reason API

On this page

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#

Create a User Action Reason with either a randomly generated Id or one you provide on the URI.

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

Path Parameters#

userActionReasonId
  • Type: 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.

Request Body#
userActionReason.code
  • Type: String
  • Required

A short code for the User Action Reason.

userActionReason.localizedTexts
  • Type: 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
  • Type: 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"
  }
}

Response#

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

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.

Response Body#

userActionReason.code
  • Type: String

A short code for the User Action Reason.

userActionReason.id
  • Type: UUID

The Id of the User Action Reason.

userActionReason.localizedTexts
  • Type: 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
  • Type: 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"
  }
}

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#

Retrieve a single User Action Reason by its Id, or leave off the Id to retrieve all of the User Action Reasons.

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

Path Parameters#

userActionReasonId
  • Type: UUID
  • Optional

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 only 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
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested 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.

Response Body#

userActionReason.code
  • Type: String

A short code for the User Action Reason.

userActionReason.id
  • Type: UUID

The Id of the User Action Reason.

userActionReason.localizedTexts
  • Type: 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
  • Type: 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"
  }
}

Response Body#

userActionReasons
  • Type: Array

The list of User Action Reason objects.

userActionReasons[x].code
  • Type: String

A short code for the User Action Reason.

userActionReasons[x].id
  • Type: UUID

The Id of the User Action Reason.

userActionReasons[x].localizedTexts
  • Type: 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
  • Type: 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"
    }
  ]
}

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#

Send the full User Action Reason with your changes applied.

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

For backward compatibility, a PATCH request with a Content-Type of application/json accepts the same body as the PUT request. FusionAuth merges the request into the existing object:

  • FusionAuth keeps every field that the request leaves out, so send only the fields you want to change.
  • FusionAuth merges a map, such as data, by key. To remove a key, set the key to null.
  • FusionAuth appends the values in a request array to the existing array, unless this API documents otherwise. An empty array leaves the existing array unchanged, so you can't remove values from an appending array.
  • FusionAuth adds each object in an array of objects as a new element. FusionAuth doesn't match the object to an existing element by Id or by position.
  • Don't send a value that an array of Ids already contains, such as a key Id or a Tenant Id. Some of these arrays then return a 500 status code.
  • Don't set an array to null. Depending on the field, FusionAuth clears the array or returns a 500 status code.

To remove values from an array, PUT the full object, or set the Content-Type to one of the following media types:

For more information, see The PATCH HTTP Method.

Path Parameters#

userActionReasonId
  • Type: UUID
  • Required

The Id of the User Action Reason to update.

Request Body#
userActionReason.code
  • Type: String
  • Required

A short code for the User Action Reason.

userActionReason.localizedTexts
  • Type: 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
  • Type: 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"
  }
}

Response#

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

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you're updating doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.

Response Body#

userActionReason.code
  • Type: String

A short code for the User Action Reason.

userActionReason.id
  • Type: UUID

The Id of the User Action Reason.

userActionReason.localizedTexts
  • Type: 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
  • Type: 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"
  }
}

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#

Delete the User Action Reason by its Id.

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

Path Parameters#

userActionReasonId
  • Type: UUID
  • Required

The Id of the User Action Reason to delete.

Response#

This API does not return a JSON response body.

Response Codes
CodeDescription
200The request succeeded.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested 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.