FusionAuth Consent API

The Consent API from FusionAuth — 3 operation(s) for consent.

OpenAPI Specification

fusionauth-consent-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.66.0
  title: FusionAuth Api Key Consent API
  description: This is a FusionAuth server. Find out more at [https://fusionauth.io](https://fusionauth.io). You need to [set up an API key](https://fusionauth.io/docs/v1/tech/apis/authentication#managing-api-keys) in the FusionAuth instance you are using to test out the API calls.
  license:
    name: Apache2
servers:
- url: http://localhost:9011
- url: https://sandbox.fusionauth.io
security:
- ApiKeyAuth: []
tags:
- name: Consent
paths:
  /api/consent:
    post:
      description: Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
      operationId: createConsent
      parameters:
      - in: header
        name: X-FusionAuth-TenantId
        description: The unique Id of the tenant used to scope this API request. Only required when there is more than one tenant and the API key is not tenant-scoped.
        required: false
        schema:
          type: string
          format: UUID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      tags:
      - Consent
  /api/consent/search:
    post:
      description: Searches consents with the specified criteria and pagination.
      operationId: searchConsentsWithId
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentSearchRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentSearchResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      tags:
      - Consent
  /api/consent/{consentId}:
    post:
      description: Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
      operationId: createConsentWithId
      parameters:
      - name: consentId
        in: path
        schema:
          type: string
        required: true
        description: The Id for the consent. If not provided a secure random UUID will be generated.
      - in: header
        name: X-FusionAuth-TenantId
        description: The unique Id of the tenant used to scope this API request. Only required when there is more than one tenant and the API key is not tenant-scoped.
        required: false
        schema:
          type: string
          format: UUID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      tags:
      - Consent
    delete:
      description: Deletes the consent for the given Id.
      operationId: deleteConsentWithId
      parameters:
      - name: consentId
        in: path
        schema:
          type: string
        required: true
        description: The Id of the consent to delete.
      - in: header
        name: X-FusionAuth-TenantId
        description: The unique Id of the tenant used to scope this API request. Only required when there is more than one tenant and the API key is not tenant-scoped.
        required: false
        schema:
          type: string
          format: UUID
      responses:
        '200':
          description: Success
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      tags:
      - Consent
    patch:
      description: Updates, via PATCH, the consent with the given Id.
      operationId: patchConsentWithId
      parameters:
      - name: consentId
        in: path
        schema:
          type: string
        required: true
        description: The Id of the consent to update.
      - in: header
        name: X-FusionAuth-TenantId
        description: The unique Id of the tenant used to scope this API request. Only required when there is more than one tenant and the API key is not tenant-scoped.
        required: false
        schema:
          type: string
          format: UUID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      tags:
      - Consent
    get:
      description: Retrieves the Consent for the given Id.
      operationId: retrieveConsentWithId
      parameters:
      - name: consentId
        in: path
        schema:
          type: string
        required: true
        description: The Id of the consent.
      - in: header
        name: X-FusionAuth-TenantId
        description: The unique Id of the tenant used to scope this API request. Only required when there is more than one tenant and the API key is not tenant-scoped.
        required: false
        schema:
          type: string
          format: UUID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentResponse'
        default:
          description: Error
      tags:
      - Consent
    put:
      description: Updates the consent with the given Id.
      operationId: updateConsentWithId
      parameters:
      - name: consentId
        in: path
        schema:
          type: string
        required: true
        description: The Id of the consent to update.
      - in: header
        name: X-FusionAuth-TenantId
        description: The unique Id of the tenant used to scope this API request. Only required when there is more than one tenant and the API key is not tenant-scoped.
        required: false
        schema:
          type: string
          format: UUID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      tags:
      - Consent
components:
  schemas:
    Errors:
      description: Standard error domain object that can also be used as the response from an API call.
      type: object
      properties:
        fieldErrors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
        generalErrors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    ZonedDateTime:
      description: 'The number of milliseconds since the unix epoch: January 1, 1970 00:00:00 UTC. This value is always in UTC.'
      example: '1659380719000'
      type: integer
      format: int64
    Error:
      description: Defines an error.
      type: object
      properties:
        code:
          type: string
        data:
          type: object
          additionalProperties:
            type: object
        message:
          type: string
    Consent:
      description: Models a consent.
      type: object
      properties:
        data:
          type: object
          additionalProperties:
            type: object
        consentEmailTemplateId:
          type: string
          format: uuid
        countryMinimumAgeForSelfConsent:
          $ref: '#/components/schemas/LocalizedIntegers'
        defaultMinimumAgeForSelfConsent:
          type: integer
        emailPlus:
          $ref: '#/components/schemas/EmailPlus'
        id:
          type: string
          format: uuid
        insertInstant:
          $ref: '#/components/schemas/ZonedDateTime'
        lastUpdateInstant:
          $ref: '#/components/schemas/ZonedDateTime'
        multipleValuesAllowed:
          type: boolean
        name:
          type: string
        values:
          type: array
          items:
            type: string
    ConsentResponse:
      description: API response for consent.
      type: object
      properties:
        consent:
          $ref: '#/components/schemas/Consent'
        consents:
          type: array
          items:
            $ref: '#/components/schemas/Consent'
    ConsentRequest:
      description: API request for User consent types.
      type: object
      properties:
        consent:
          $ref: '#/components/schemas/Consent'
    ConsentSearchCriteria:
      description: Search criteria for Consents
      type: object
      properties:
        name:
          type: string
        numberOfResults:
          type: integer
        orderBy:
          type: string
        startRow:
          type: integer
    LocalizedIntegers:
      description: Models a set of localized Integers that can be stored as JSON.
      type: object
      properties: {}
    ConsentSearchResponse:
      description: Consent search response
      type: object
      properties:
        consents:
          type: array
          items:
            $ref: '#/components/schemas/Consent'
        total:
          type: integer
          format: int64
    ConsentSearchRequest:
      description: Search request for Consents
      type: object
      properties:
        search:
          $ref: '#/components/schemas/ConsentSearchCriteria'
    EmailPlus:
      type: object
      properties:
        emailTemplateId:
          type: string
          format: uuid
        maximumTimeToSendEmailInHours:
          type: integer
        minimumTimeToSendEmailInHours:
          type: integer
        enabled:
          type: boolean
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT