Retrieve a User Consent API

On this page

This API is used to retrieve a single User Consent by unique Id or all of User's Consents by user Id.

Request#

Retrieve All Consents for a User#

API Key Authentication
Retrieve all of a User's Consents
OpenAPI Spec

Query Parameters#

userId
  • Type: UUID
  • Required

The unique Id of the User to retrieve User Consents for.

API Key Authentication
Retrieve a User Consent by Id
OpenAPI Spec

Path Parameters#

userConsentId
  • Type: UUID
  • Required

The unique Id of the User Consent to retrieve.

Response#

The response for this API contains either a single User Consent, or all of a User's Consents.

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.
userConsent.consent
  • Type: Object

The Consent object represented by the consentId field.

userConsent.consentId
  • Type: UUID

The Id of the Consent being granted to the User.

userConsent.giverUserId
  • Type: UUID

The Id of the User giving consent. When providing self-consent the giverUserId will be the same as the userId.

userConsent.id
  • Type: UUID

The unique Id of the User consent.

userConsent.insertInstant
  • Type: Long

The instant when the User consent was granted.

userConsent.lastUpdateInstant
  • Type: Long

The instant when the User consent was last updated.

userConsent.status
  • Type: String

The current status of the User consent. Possible values are:

  • Active
  • Revoked
userConsent.userId
  • Type: UUID

The Id of the User receiving consent. When providing self-consent the giverUserId will be the same as the userId.

userConsent.values
  • Type: Array<String>

The consent values to be associated with this User consent.

Example Response JSON
{
  "userConsent": {
    "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",
      "multipleValuesAllowed": false,
      "name": "Patient Consent",
      "values": [
        "Written",
        "Verbal"
      ]
    },
    "consentId": "d512b9b8-876f-4b5e-81f0-3e180b6ea485",
    "giverUserId": "605e88b7-a2fb-40b8-9c94-0123c0f6a70c",
    "id": "674b5cd8-482a-43c9-986e-f9764bbee01d",
    "insertInstant": 1562180786558,
    "lastUpdateInstant": 1562180786558,
    "status": "Active",
    "userId": "841d8b33-bf4d-488d-9f2f-2f50d769c3d2",
    "values": [
      "Written"
    ]
  }
}

All Consents for a User Response Body#

userConsents[x].consent
  • Type: Object

The Consent object represented by the consentId field.

userConsents[x].consentId
  • Type: UUID

The Id of the Consent being granted to the User.

userConsents[x].giverUserId
  • Type: UUID

The Id of the User giving consent. When providing self-consent the giverUserId will be the same as the userId.

userConsents[x].id
  • Type: UUID

The unique Id of the User consent.

userConsents[x].insertInstant
  • Type: Long

The instant when the User consent was granted.

userConsents[x].lastUpdateInstant
  • Type: Long

The instant when the User consent was last updated.

userConsents[x].status
  • Type: String

The current status of the User consent. Possible values are:

  • Active
  • Revoked
userConsents[x].userId
  • Type: UUID

The Id of the User receiving consent. When providing self-consent the giverUserId will be the same as the userId.

userConsents[x].values
  • Type: Array<String>

The consent values to be associated with this User consent.

Example Response JSON
{
  "userConsents": [
    {
      "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",
        "multipleValuesAllowed": false,
        "name": "Patient Consent",
        "values": [
          "Written",
          "Verbal"
        ]
      },
      "consentId": "d512b9b8-876f-4b5e-81f0-3e180b6ea485",
      "giverUserId": "605e88b7-a2fb-40b8-9c94-0123c0f6a70c",
      "id": "674b5cd8-482a-43c9-986e-f9764bbee01d",
      "insertInstant": 1562180786558,
      "lastUpdateInstant": 1562180786558,
      "status": "Active",
      "userId": "841d8b33-bf4d-488d-9f2f-2f50d769c3d2",
      "values": [
        "Written"
      ]
    }
  ]
}