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

# Send an enquiry

> Saves an enquiry into the institute's CRM, exactly like the hosted catalogue's enquiry form. Call it from your server and pass the visitor's IP in `X-Client-IP`.

Scope: `leads:write`. Limits: 30 per minute per key, and 5 per minute per visitor IP. Never cached.



## OpenAPI

````yaml /api-reference/openapi.json post /leads
openapi: 3.1.0
info:
  title: Vacademy Catalogue API
  version: 1.0.0
  description: >-
    Read an institute's published courses, streams and learning paths for its
    own website, and send enquiries into its CRM.
servers:
  - url: https://api.vacademy.ai/catalog/v1
security:
  - ApiKey: []
  - Bearer: []
tags:
  - name: Site
  - name: Courses
  - name: Streams
  - name: Learning paths
  - name: Enquiries
paths:
  /leads:
    post:
      tags:
        - Enquiries
      summary: Send an enquiry
      description: >-
        Saves an enquiry into the institute's CRM, exactly like the hosted
        catalogue's enquiry form. Call it from your server and pass the
        visitor's IP in `X-Client-IP`.


        Scope: `leads:write`. Limits: 30 per minute per key, and 5 per minute
        per visitor IP. Never cached.
      operationId: createLead
      parameters:
        - name: X-Client-IP
          in: header
          required: false
          schema:
            type: string
          description: >-
            The visitor's IP, for the per-visitor limit. Server-side calls only;
            ignored on browser calls (the network address is used).
          example: 203.0.113.24
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadRequest'
            example:
              full_name: Asha Rao
              email: asha@example.com
              phone: +91 98765 43210
              message: Is the Hindi edition available as a printed book?
              course_id: 7c12a9ec-22c3-4c55-ada1-2a93e107816f
              source: course-page
              custom_fields:
                city: Pune
      responses:
        '200':
          description: 'Duplicate: already in this campaign. Nothing new was saved.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadResponse'
              example:
                status: duplicate
        '201':
          description: A new enquiry was saved.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadResponse'
              example:
                status: received
        '400':
          description: The body is not valid. `details.param` names the field.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_request:
                  value:
                    error:
                      code: invalid_request
                      message: email is not a valid email address.
                      request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
                      details:
                        param: email
                unknown_course:
                  value:
                    error:
                      code: invalid_request
                      message: course_id is not a published course of this institute.
                      request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
                      details:
                        param: course_id
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/AuthUnavailable'
components:
  schemas:
    LeadRequest:
      type: object
      properties:
        full_name:
          type: string
          maxLength: 200
          description: 1-200 characters.
        email:
          type: string
          format: email
          maxLength: 254
          description: A valid email address, at most 254 characters.
        phone:
          type: string
          description: >-
            Digits with optional `+`, spaces, `()`, `-`, `.`; 6-24 characters,
            at least 6 digits. E.g. `+91 98765 43210`.
        message:
          type: string
          maxLength: 2000
          description: At most 2,000 characters.
        course_id:
          type: string
          description: >-
            A course id from this API. Must be a published course of the
            institute.
        campaign_id:
          type: string
          description: >-
            CRM campaign to file the enquiry under. An unknown or inactive id
            silently falls back to the default "Course Catalogue Leads" list.
        source:
          type: string
          maxLength: 100
          description: >-
            Where on your site the form is, e.g. `homepage-hero`. At most 100
            characters.
        custom_fields:
          type: object
          maxProperties: 30
          additionalProperties:
            type:
              - string
              - number
              - boolean
              - 'null'
          description: >-
            Up to 30 extra fields. Keys: 1-64 letters, digits, spaces, `_`, `-`,
            `.`. Values: text, number or boolean, at most 1,000 characters.
            Reserved keys (any case, 400 if used): `full_name`, `fullname`,
            `name`, `email`, `phone`, `mobile`, `mobile_number`, `message`,
            `source`, `course_id`.
      required:
        - full_name
        - email
    LeadResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - received
            - duplicate
          description: >-
            `received`: a new enquiry was saved (HTTP 201). `duplicate`: this
            person already enquired in this campaign, or the institute's
            duplicate rules matched (HTTP 200). Treat both as success.
      required:
        - status
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: not_found
              enum:
                - missing_api_key
                - invalid_api_key
                - product_not_enabled
                - insufficient_scope
                - origin_not_allowed
                - rate_limited
                - not_found
                - method_not_allowed
                - invalid_request
                - auth_unavailable
                - internal_error
              description: >-
                Stable machine-readable code. Branch on this, never on
                `message`.
            message:
              type: string
              description: A sentence for logs. Wording may change.
            request_id:
              type: string
              description: Also in the `X-Request-Id` header. Quote it to support.
            details:
              type: object
              additionalProperties: true
              description: >-
                Present only when there is more to say: `param`
                (invalid_request), `required_scope` (insufficient_scope),
                `origin` (origin_not_allowed), `limit_per_minute`
                (rate_limited).
          required:
            - code
            - message
            - request_id
      required:
        - error
  headers:
    RequestId:
      schema:
        type: string
      description: Unique id of this request. Quote it to support.
    RetryAfter:
      schema:
        type: integer
      description: Seconds to wait before retrying.
  responses:
    Unauthorized:
      description: No key, or the key is not valid.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing_api_key:
              value:
                error:
                  code: missing_api_key
                  message: >-
                    Send your publishable key in the X-API-Key header (or
                    Authorization: Bearer).
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
            invalid_api_key:
              value:
                error:
                  code: invalid_api_key
                  message: This API key is invalid, revoked or expired.
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
    Forbidden:
      description: >-
        The key may not make this request, or the browser origin is not one of
        the institute's verified websites.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            origin_not_allowed:
              value:
                error:
                  code: origin_not_allowed
                  message: >-
                    Add and verify preview-abc.vercel.app in Settings →
                    Integrations → Catalogue API & websites to call this API
                    from it.
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
                  details:
                    origin: preview-abc.vercel.app
            insufficient_scope:
              value:
                error:
                  code: insufficient_scope
                  message: This API key does not have the leads:write scope.
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
                  details:
                    required_scope: leads:write
            product_not_enabled:
              value:
                error:
                  code: product_not_enabled
                  message: This API key is not a Catalogue API key.
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
    RateLimited:
      description: Too many requests for this key (or, on `POST /leads`, this visitor).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limited:
              value:
                error:
                  code: rate_limited
                  message: Too many requests for this API key (limit 1200 per minute).
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
                  details:
                    limit_per_minute: 1200
    AuthUnavailable:
      description: >-
        Keys could not be checked for a moment. Retry after `Retry-After`
        seconds.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_unavailable:
              value:
                error:
                  code: auth_unavailable
                  message: Could not verify the API key right now. Retry shortly.
                  request_id: req_3f2a9c1d7e5b4a608f1e2d3c4b5a6978
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your publishable Catalogue API key (`vak_pub_…`).
    Bearer:
      type: http
      scheme: bearer
      description: 'The same key as `Authorization: Bearer vak_pub_…`.'

````

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