Retrieve a Consent

This API is used to retrieve a single Consent by unique Id or all of the configured Consents.

Request#

API Key Authentication
Retrieve all of the Consents
API Key Authentication
Retrieve a Consent by Id
OpenAPI Spec

Request Parameters#

consentIdUUIDrequired

The unique Id of the Consent to retrieve.

Response#

The response for this API contains either a single Consent or all of the Consents. When you call this API with an Id the response will contain a single Consent. When you call this API without an Id the response will contain all of the Consents. Both response types are defined below along with an example JSON response.

Response Codes
CodeDescription
200The request was successful. The response will contain a JSON body.
400The 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.
401You 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.
404The object you requested doesn't exist. The response will be empty.
500There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body#

consent.consentEmailTemplateIdUUID

The Id of the Email Template that is used to send confirmation to the end user.

consent.countryMinimumAgeForSelfConsentMap<Locale, Integer>

This property optionally overrides the value provided in defaultMinimumAgeForSelfConsent if a more specific value is defined. This can be useful when the age of self consent varies by country.

For example, consider the following definition:

{
  "de": 17
}

If a user has defined their preferred locale to be Germany (de), the age of self consent defined for Germany will be used instead of the value defined by defaultMinimumAgeForSelfConsent.

consent.dataObject

An object that can hold any information about the Consent that should be persisted.

consent.defaultMinimumAgeForSelfConsentInteger

The default age of self consent used when granting this consent to a user unless a more specific one is provided by the countryMinimumAgeForSelfConsent.

A user that meets the minimum age of self consent may self-consent, this means the recipient may also be the giver.

consent.emailPlus.enabledBoolean

When this value is true the Email Plus workflow is enabled.

Email Plus provides and additional opportunity to notify the giver that consent was provided. For example, if consentEmailTemplateId is provided then when the consent is granted an email will be sent to notify the giver that consent was granted to the user. When using Email Plus a follow up email will be sent to the giver at a randomly selected time within the configured minimum and maximum range of hours.

consent.emailPlus.emailTemplateIdUUID

The Id of the Email Template that is used to send the reminder notice to the consent giver.

consent.emailPlus.maximumTimeToSendEmailInHoursInteger

The maximum number of hours to wait until sending the reminder notice the consent giver.

consent.emailPlus.minimumTimeToSendEmailInHoursInteger

The minimum number of hours to wait until sending the reminder notice the consent giver.

consent.idUUID

The unique Id of the consent.

consent.insertInstantLong

The instant that the Consent was added to the FusionAuth database.

consent.lastUpdateInstantLong

The instant that the Consent was updated in the FusionAuth database.

consent.multipleValuesAllowedBoolean

When this value is true more than one value may be used when granting this consent to a User.

This value is not used when no values have been defined for this consent.

consent.nameString

The unique name of the consent.

consent.valuesArray<String>

One or more values that may be assigned for this consent.

Example Response JSON

{
  "consent": {
    "consentEmailTemplateId": "61cba163-2d53-4d2d-ad7f-801c27f0c277",
    "countryMinimumAgeForSelfConsent": {
      "de": 21
    },
    "defaultMinimumAgeForSelfConsent": 18,
    "emailPlus": {
      "enabled": true,
      "emailTemplateId": "9cd65fca-5aa0-4861-899b-8712d8ec963f",
      "maximumTimeToSendEmailInHours": 48,
      "minimumTimeToSendEmailInHours": 24
    },
    "id": "d512b9b8-876f-4b5e-81f0-3e180b6ea485",
    "insertInstant": 1595361142909,
    "lastUpdateInstant": 1595361143101,
    "multipleValuesAllowed": false,
    "name": "Patient Consent",
    "values": [
      "Written",
      "Verbal"
    ]
  }
}

Response Body#

consentsArray

The list of Consent objects.

consents[x].consentEmailTemplateIdUUID

The Id of the Email Template that is used to send confirmation to the end user.

consents[x].countryMinimumAgeForSelfConsentMap<Locale, Integer>

This property optionally overrides the value provided in defaultMinimumAgeForSelfConsent if a more specific value is defined. This can be useful when the age of self consent varies by country.

For example, consider the following definition:

{
  "de": 17
}

If a user has defined their preferred locale to be Germany (de), the age of self consent defined for Germany will be used instead of the value defined by defaultMinimumAgeForSelfConsent.

consents[x].defaultMinimumAgeForSelfConsentInteger

The default age of self consent used when granting this consent to a user unless a more specific one is provided by the countryMinimumAgeForSelfConsent.

A user that meets the minimum age of self consent may self-consent, this means the recipient may also be the giver.

consents[x].emailPlus.enabledBoolean

When this value is true the Email Plus workflow is enabled.

Email Plus provides and additional opportunity to notify the giver that consent was provided. For example, if consentEmailTemplateId is provided then when the consent is granted an email will be sent to notify the giver that consent was granted to the user. When using Email Plus a follow up email will be sent to the giver at a randomly selected time within the configured minimum and maximum range of hours.

consents[x].emailPlus.emailTemplateIdUUID

The Id of the Email Template that is used to send the reminder notice to the consent giver.

consents[x].emailPlus.maximumTimeToSendEmailInHoursInteger

The maximum number of hours to wait until sending the reminder notice the consent giver.

consents[x].emailPlus.minimumTimeToSendEmailInHoursInteger

The minimum number of hours to wait until sending the reminder notice the consent giver.

consents[x].idUUID

The unique Id of the consent.

consent[x].insertInstantLong

The instant that the Consent was added to the FusionAuth database.

consent[x].lastUpdateInstantLong

The instant that the Consent was updated in the FusionAuth database.

consents[x].multipleValuesAllowedBoolean

When this value is true more than one value may be used when granting this consent to a User.

This value is not used when no values have been defined for this consent.

consents[x].nameString

The unique name of the consent.

consents[x].valuesArray<String>

One or more values that may be assigned for this consent.

Example Response JSON

{
  "consents": [
    {
      "consentEmailTemplateId": "61cba163-2d53-4d2d-ad7f-801c27f0c277",
      "countryMinimumAgeForSelfConsent": {
        "de": 21
      },
      "defaultMinimumAgeForSelfConsent": 18,
      "emailPlus": {
        "enabled": true,
        "emailTemplateId": "9cd65fca-5aa0-4861-899b-8712d8ec963f",
        "maximumTimeToSendEmailInHours": 48,
        "minimumTimeToSendEmailInHours": 24
      },
      "id": "d512b9b8-876f-4b5e-81f0-3e180b6ea485",
      "insertInstant": 1595361142909,
      "lastUpdateInstant": 1595361143101,
      "multipleValuesAllowed": false,
      "name": "Patient Consent",
      "values": [
        "Written",
        "Verbal"
      ]
    }
  ]
}