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

# Login externo

> Obtiene un accessToken para el cliente. El `businessId` puede ir en body o en header `x-client-id`.




## OpenAPI

````yaml openapi/external-v1.yaml post /authentication/login
openapi: 3.1.0
info:
  title: Goil Public API (External)
  description: >
    API pública para integraciones externas. Permite autenticación, gestión de
    cuentas

    y envío de notificaciones y alertas.


    **Autenticación**: La mayoría de endpoints requieren el header `x-client-id`
    (businessId).

    Tras llamar a `POST /authentication/login` obtendrás un `accessToken` para
    usar en

    endpoints que requieran Bearer token (p. ej. alertas).
  version: 1.0.0
  contact:
    name: Goil API Support
servers:
  - url: https://community.goil.app/api/v1/external
    description: Production
security: []
tags:
  - name: Authentication
    description: Login para integraciones externas
  - name: Account
    description: Crear, consultar, listar, actualizar y eliminar cuentas
  - name: Notification
    description: Envío de notificaciones push/SMS
  - name: Alert
    description: Creación y actualización de alertas geolocalizadas
paths:
  /authentication/login:
    post:
      tags:
        - Authentication
      summary: Login externo
      description: >
        Obtiene un accessToken para el cliente. El `businessId` puede ir en body
        o en header `x-client-id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Invalid arguments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    LoginRequest:
      type: object
      required:
        - externalId
        - businessId
      properties:
        externalId:
          type: string
          description: Identificador externo del usuario/integración
        businessId:
          type: string
          description: ID del negocio (también puede enviarse por header x-client-id)
        clientPlatform:
          type: string
          description: Plataforma cliente (opcional)
    LoginResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            accessToken:
              type: string
    ErrorResponse:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
        error:
          type: string
        data:
          type: object
          nullable: true

````