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.
OpenAPI Spec
OpenAPI Spec
Path Parameters#
userActionReasonIdThe Id to use for the new User Action Reason. If not specified a secure random UUID will be generated.
Request Body#
userActionReason.code A short code for the User Action Reason.
userActionReason.localizedTexts A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.
userActionReason.text The text of the User Action Reason.
{
"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.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The 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. |
| 401 | FusionAuth 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. |
| 500 | FusionAuth 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. |
| 503 | The 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 A short code for the User Action Reason.
userActionReason.id The Id of the User Action Reason.
userActionReason.localizedTexts A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.
userActionReason.text The text of the 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.
OpenAPI Spec
OpenAPI Spec
Path Parameters#
userActionReasonIdThe 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.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The 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. |
| 401 | FusionAuth 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. |
| 404 | The object you requested doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
| 503 | The 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 A short code for the User Action Reason.
userActionReason.id The Id of the User Action Reason.
userActionReason.localizedTexts A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.
userActionReason.text The text of the 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#
userActionReasonsThe list of User Action Reason objects.
userActionReasons[x].code A short code for the User Action Reason.
userActionReasons[x].id The Id of the User Action Reason.
userActionReasons[x].localizedTexts 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 The text of the User Action Reason.
{
"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.
OpenAPI Spec
OpenAPI Spec
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 tonull. - 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
500status code. - Don't set an array to
null. Depending on the field, FusionAuth clears the array or returns a500status code.
To remove values from an array, PUT the full object, or set the Content-Type to one of the following media types:
application/json-patch+jsonfor JSON Patch (RFC 6902)application/merge-patch+jsonfor JSON Merge Patch (RFC 7396)
For more information, see The PATCH HTTP Method.
Path Parameters#
userActionReasonIdThe Id of the User Action Reason to update.
Request Body#
userActionReason.code A short code for the User Action Reason.
userActionReason.localizedTexts A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.
userActionReason.text The text of the User Action Reason.
{
"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.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The 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. |
| 401 | FusionAuth 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. |
| 404 | The object you're updating doesn't exist. The response is empty. |
| 500 | FusionAuth 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. |
| 503 | The 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 A short code for the User Action Reason.
userActionReason.id The Id of the User Action Reason.
userActionReason.localizedTexts A mapping of localized text for the User Action Reason. The key is the Locale and the value is the localized text.
userActionReason.text The text of the 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.
OpenAPI Spec
Path Parameters#
userActionReasonIdThe Id of the User Action Reason to delete.
Response#
This API does not return a JSON response body.
| Code | Description |
|---|---|
| 200 | The request succeeded. |
| 400 | The 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. |
| 401 | FusionAuth 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. |
| 404 | The object you requested doesn't exist. The response is empty. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty. |
| 503 | The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body. |
Related
Learn about the APIs for invoking a User Action on a User.
API documentation for the FusionAuth Create a User Action API.
API documentation for the FusionAuth Delete a User Action API.
Learn about the APIs for creating, retrieving, updating and deleting user actions.