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

# Generate BotID header

> Builds the `x-is-human` header for endpoints protected by Vercel BotID from the `c.js`
challenge script your session fetched. Serialise the whole response object as JSON and send
it as the header value. Scripts are limited to 1 MiB. Counts against your Kasada plan.




## OpenAPI

````yaml api-reference/openapi/kasada.yaml POST /api/v1/botid
openapi: 3.1.0
info:
  title: Roolink Kasada API
  version: 1.0.0
  description: >
    Generates the payloads Kasada expects from a browser: the challenge payload
    and `x-kpsdk-*`

    headers for the `/tl` request, a fresh `x-kpsdk-cd` proof of work for each
    protected request,

    and the `x-is-human` header for endpoints protected by Vercel BotID.


    Every request is `POST` with a JSON body and returns JSON. Errors carry
    `{"code", "error"}`.
servers:
  - url: https://ksd.roolink.io
security:
  - ApiKey: []
paths:
  /api/v1/botid:
    post:
      summary: Generate BotID header
      description: >
        Builds the `x-is-human` header for endpoints protected by Vercel BotID
        from the `c.js`

        challenge script your session fetched. Serialise the whole response
        object as JSON and send

        it as the header value. Scripts are limited to 1 MiB. Counts against
        your Kasada plan.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - script
              properties:
                script:
                  type: string
                  description: >-
                    Contents of the BotID `c.js` challenge script, exactly as
                    fetched.
            example:
              script: (function(){ ... })();
      responses:
        '200':
          description: >-
            Header generated. Serialise this object as JSON for the `x-is-human`
            header.
          content:
            application/json:
              schema:
                type: object
                required:
                  - b
                  - v
                  - e
                  - s
                  - d
                  - vr
                properties:
                  b:
                    type: number
                  v:
                    type: number
                  e:
                    type: string
                  s:
                    type: string
                    contentEncoding: base64
                    description: Encrypted browser signals, base64-encoded.
                  d:
                    type: number
                  vr:
                    type: string
        '400':
          $ref: '#/components/responses/InvalidJson'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          description: '`script_too_large`: the script exceeds 1 MiB.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          $ref: '#/components/responses/UnsupportedMedia'
        '422':
          description: >-
            `invalid_script`: the script is empty or Roolink cannot read this
            challenge.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/Quota'
        '503':
          $ref: '#/components/responses/Overloaded'
components:
  responses:
    InvalidJson:
      description: >-
        `invalid_json`: the body is not one JSON object, or contains a field
        this endpoint does not accept.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The `x-api-key` header is missing or the key is invalid.
    UnsupportedMedia:
      description: '`unsupported_media_type`: `Content-Type` must be `application/json`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Quota:
      description: Kasada is not enabled on this key or its quota is exhausted.
    Overloaded:
      description: >-
        `overloaded`: the service is at capacity. Retry after the `Retry-After`
        delay.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: string
          description: Machine-readable error code.
        error:
          type: string
          description: Human-readable message.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.