> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get consents items by query



## OpenAPI

````yaml openapi/consent-v1.json POST /v1/Consents/searches
openapi: 3.0.4
info:
  title: Consent API
  version: v1
servers:
  - url: https://{host}/consent
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - oauth2: []
paths:
  /v1/Consents/searches:
    post:
      tags:
        - Service2Service
      summary: Get consents items by query
      parameters:
        - name: Accept-Language
          in: header
          description: Language code for localized content
          schema:
            type: string
            default: en
      requestBody:
        description: Query parameters including consent IDs, keys, and filters
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/ConsentApi.Dto.Service2Service.GetConsentsQueryParametersDto
      responses:
        '200':
          description: ConsentApi.Dto.Common.ConsentBulkDto object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentApi.Dto.Common.ConsentBulkDto'
        '400':
          description: If query is invalid
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    ConsentApi.Dto.Service2Service.GetConsentsQueryParametersDto:
      required:
        - take
      type: object
      properties:
        take:
          maximum: 1000
          minimum: 1
          type: integer
          description: Gets or sets value for how many records return (per page).
          format: int32
        skip:
          maximum: 2147483647
          minimum: 0
          type: integer
          description: Gets or sets value for how many records skip.
          format: int32
          nullable: true
        consentIds:
          type: array
          items:
            type: string
          description: Consent identifiers
          nullable: true
        consentKeys:
          type: array
          items:
            type: string
          description: Consent keys
          nullable: true
        isActive:
          type: boolean
          description: >-
            Filter by active status (true for active, false for inactive, null
            for all)
          nullable: true
        isPublished:
          type: boolean
          description: >-
            Filter by published status (true for published, false for
            unpublished, null for all)
          nullable: true
      additionalProperties: false
      description: Contract for querying consents by parameters
    ConsentApi.Dto.Common.ConsentBulkDto:
      type: object
      properties:
        consents:
          type: array
          items:
            $ref: '#/components/schemas/ConsentApi.Dto.Common.ConsentDto'
          description: Array of consent items
          nullable: true
      additionalProperties: false
    LoopFoundation.Commons.Contracts.WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    ConsentApi.Dto.Common.ConsentDto:
      required:
        - component
        - consentType
        - contentUrl
        - createdAt
        - effectiveAt
        - expiresAt
        - id
        - key
        - name
        - revision
        - version
      type: object
      properties:
        id:
          minLength: 1
          type: string
          description: Consent unique identifier (across all consent types and versions)
          example: agreement.cpl_0
        key:
          minLength: 1
          type: string
          description: Consent key, which is unique across different consent types
          example: agreement.cpl
        name:
          minLength: 1
          type: string
          description: Name
        component:
          minLength: 1
          type: string
          description: Component to which consent corresponds
        version:
          type: integer
          description: Version
          format: int32
        revision:
          type: integer
          description: Revision
          format: int32
        iconUrl:
          type: string
          description: Url to consent icon
          nullable: true
        contentUrl:
          minLength: 1
          type: string
          description: Url to consent content
        createdAt:
          type: string
          description: Consent creation date
          format: date-time
        effectiveAt:
          type: string
          description: Consent effective from date
          format: date-time
        expiresAt:
          type: string
          description: Consent expiration date
          format: date-time
        consentType:
          $ref: '#/components/schemas/ConsentApi.Dto.Common.ConsentType'
      additionalProperties: false
      description: DTO, represents consent instance
    ConsentApi.Dto.Common.ConsentType:
      enum:
        - Regular
        - Agreement
      type: string
      description: Defines the type of consent
  securitySchemes:
    oauth2:
      type: apiKey
      name: Authorization
      in: header

````