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

# Activate Lead

> Sets `is_actived`. Requires `maihue-lead:active`.



## OpenAPI

````yaml PATCH /maihue/lead/{document_id}/active
openapi: 3.0.1
info:
  title: Maihue Lead API
  description: >
    Maihue leads (`maihue_lead`): prospects of the `home`, `horeca` and
    `business` units with their contact, evaluation and UTM data.


    List paging and sorting read the snake_case keys `page_size`,
    `max_page_size_override` and `order_by`. Every route requires the
    `maihue-lead:<action>` permission named in its description.
  version: '2026-10-21'
servers:
  - description: Production
    url: https://api.bbrands.io/api/v3
  - description: Certification
    url: https://certification.api.bbrands.io/api/v3
  - description: Development
    url: https://development.api.bbrands.io/api/v3
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Maihue Lead
    description: Maihue prospects captured by the websites.
paths:
  /maihue/lead/{document_id}/active:
    patch:
      tags:
        - Maihue Lead
      summary: Activate or deactivate lead
      description: Sets `is_actived`. Requires `maihue-lead:active`.
      operationId: maihueLeadActive
      parameters:
        - $ref: '#/components/parameters/DocumentId'
        - $ref: '#/components/parameters/Populate'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActiveBody'
      responses:
        '200':
          description: Lead updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/MaihueLead'
                  message:
                    type: string
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    DocumentId:
      name: document_id
      in: path
      required: true
      description: Lead identifier.
      schema:
        type: string
        format: uuid
    Populate:
      name: populate
      in: query
      description: Whether to expand foreign keys into nested objects.
      schema:
        type: boolean
        default: true
  schemas:
    ActiveBody:
      type: object
      required:
        - is_actived
      properties:
        is_actived:
          type: boolean
          description: '`true` activates the record, `false` deactivates it.'
    MaihueLead:
      type: object
      properties:
        document_id:
          type: string
          format: uuid
        collection_channel:
          type: string
          nullable: true
          description: The channel through which the lead was collected.
        commercial_activity:
          type: string
          nullable: true
          description: The commercial activity associated with the lead.
        contact:
          type: string
          description: The contact person for the lead.
        dni:
          type: string
          description: The DNI (Documento Nacional de Identidad) of the lead.
        email:
          type: string
          description: The email address of the lead.
        evaluation_date:
          type: string
          format: date-time
          nullable: true
        evaluation_debt:
          type: number
          nullable: true
          description: >-
            The evaluated debt of the lead. Precision of 12 digits with 2
            decimal places.
        evaluation_score:
          type: number
          nullable: true
          description: >-
            The evaluation score of the lead. Precision of 6 digits with 2
            decimal places.
        gloss:
          type: string
          nullable: true
          description: Additional notes or comments about the lead.
        ip:
          type: string
          description: The IP address from which the lead was submitted.
        name:
          type: string
          description: The name of the lead.
        name_fantasy:
          type: string
          nullable: true
          description: The fantasy or trade name of the lead's business.
        payment_method:
          type: string
          enum:
            - pac
            - pat
            - transfer
          nullable: true
        phone:
          type: string
          description: The phone number of the lead.
        s_utm_compaign:
          type: string
          nullable: true
        s_utm_content:
          type: string
          nullable: true
        s_utm_medium:
          type: string
          nullable: true
        s_utm_source:
          type: string
          nullable: true
        s_utm_term:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - business
            - home
            - horeca
          description: The type of lead.
        utm_compaign:
          type: string
          nullable: true
        utm_content:
          type: string
          nullable: true
        utm_medium:
          type: string
          nullable: true
        utm_source:
          type: string
          nullable: true
        utm_term:
          type: string
          nullable: true
        address:
          type: string
          format: uuid
          description: The associated Address record.
        country:
          type: string
          format: uuid
          description: The associated Country record.
        type_dni:
          type: string
          format: uuid
          description: >-
            Related record id; with `populate` (the default) the related record
            is embedded instead.
        is_actived:
          type: boolean
        is_deleted:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          nullable: true
        deleted_at:
          type: string
          format: date-time
          nullable: true
    Meta:
      type: object
      properties:
        correlation:
          type: string
          description: Request correlation id; quote it when reporting an issue.
        status:
          type: integer
        timestamp:
          type: string
          format: date-time
        version:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            errors:
              type: array
              items: {}
            message:
              type: string
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    BadRequest:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing, invalid, revoked or expired credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The caller lacks the required permission
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Record not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      headers:
        Retry-After:
          description: Seconds until a request is allowed again.
          schema:
            type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: A `secret` API key, `hzk_<env>_<prefix>_<secret>`.

````

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