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

# Record supplied consent

> Stores supplied consent for a batch of phone numbers. The contact is found or created by phone. Each record is processed independently and re-recording an existing consent refreshes it.



## OpenAPI

````yaml /swagger.yml post /public/v1/consent/batch
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/v1/consent/batch:
    post:
      tags:
        - Programs
      summary: Record supplied consent
      description: >-
        Stores supplied consent for a batch of phone numbers. The contact is
        found or created by phone. Each record is processed independently and
        re-recording an existing consent refreshes it.
      operationId: PublicConsentController_recordBatch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsentBatchRequest'
      responses:
        '200':
          description: Per-record result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsentBatchResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    ConsentBatchRequest:
      type: object
      required:
        - consent
      properties:
        consent:
          type: array
          description: The consent records to store. Up to 50 per request.
          items:
            $ref: '#/components/schemas/ConsentBatchItemDto'
    ConsentBatchResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/ConsentBatchData'
    ConsentBatchItemDto:
      type: object
      required:
        - channel
        - scope
        - phoneNumber
      properties:
        channel:
          type: string
          enum:
            - messaging
            - voice
          description: The channel this consent authorizes. `messaging` covers SMS and RCS.
          example: messaging
        scope:
          type: string
          enum:
            - conversational
            - promotional
          description: >-
            What the consent permits. `promotional` is required to send
            marketing and `conversational` covers replies.
          example: promotional
        basis:
          type: string
          enum:
            - pewc
            - keywordOptIn
          description: >-
            How consent was obtained. Defaults to `pewc` (prior express written
            consent).
          example: pewc
        capturedAt:
          type: string
          description: >-
            When consent was captured, as an ISO 8601 timestamp. Defaults to
            now.
          example: '2026-06-15T12:00:00.000Z'
        expiresAt:
          type: string
          description: >-
            When the consent expires, as an ISO 8601 timestamp. Omit for no
            expiry.
          example: '2027-06-15T12:00:00.000Z'
        sourceUrl:
          type: string
          description: The web address where consent was captured.
          example: https://example.com/get-a-quote
        ipAddress:
          type: string
          description: The consumer's IP address at the time of capture.
          example: 198.51.100.7
        certProvider:
          type: string
          description: Consent certificate provider, e.g. `trustedform` or `jornaya`.
          example: trustedform
        certToken:
          type: string
          description: The consent certificate token or URL.
          example: https://cert.trustedform.com/0a1b2c3d
        phoneNumber:
          type: string
          description: >-
            The phone number that consented, in E.164. The contact is found or
            created by this number.
          example: '+14155550100'
    ConsentBatchData:
      type: object
      required:
        - results
      properties:
        results:
          type: array
          description: One result per consent record sent, in the same order.
          items:
            $ref: '#/components/schemas/ConsentResult'
    ConsentResult:
      type: object
      required:
        - index
        - phoneNumber
        - status
      properties:
        index:
          type: number
          description: The position of this record in the consent you sent.
          example: 0
        phoneNumber:
          type: string
          description: The phone number you sent for this record.
          example: '+14155550100'
        status:
          type: string
          enum:
            - recorded
            - rejected
          description: >-
            The outcome. recorded: consent stored. rejected: the record could
            not be processed (see reason).
          example: recorded
        reason:
          type: string
          description: Why the record was rejected, present when rejected.
          example: invalid_phone
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````