> ## 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.

# Crear cuenta

> Registra una nueva cuenta (usuario externo). Requiere `x-client-id`.



## OpenAPI

````yaml openapi/external-v1.yaml post /account/create
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:
  /account/create:
    post:
      tags:
        - Account
      summary: Crear cuenta
      description: Registra una nueva cuenta (usuario externo). Requiere `x-client-id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountCreateRequest'
      responses:
        '200':
          description: Cuenta creada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountCreateResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Invalid arguments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AccountCreateRequest:
      type: object
      required:
        - accountType
        - phone
      properties:
        accountType:
          type: string
          description: ID del tipo de cuenta
        phone:
          type: string
          description: Teléfono en formato E.164
        attributesValue:
          type: array
          items:
            $ref: '#/components/schemas/AttributeValue'
        sendSMS:
          type: boolean
          default: true
          description: Si se envía SMS de bienvenida
    AccountCreateResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            account:
              $ref: '#/components/schemas/Account'
    ErrorResponse:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
        error:
          type: string
        data:
          type: object
          nullable: true
    AttributeValue:
      type: object
      required:
        - attributeId
        - value
      properties:
        attributeId:
          type: string
        tag:
          type: string
        value:
          type: object
          properties:
            text:
              type: string
              default: ''
            number:
              type: number
              default: 0
            boolean:
              type: boolean
              default: false
            date:
              type: string
              format: date-time
            image:
              type: string
              nullable: true
    Account:
      type: object
      properties:
        id:
          type: string
        accountType:
          type: string
        username:
          type: string
        phone:
          type: string
        role:
          type: string
        creationDate:
          type: string
          format: date-time
        subscribed:
          type: boolean
        blocked:
          type: boolean
        blockedDate:
          type: string
        validated:
          type: boolean
        expirationDate:
          type: string
        attributesValue:
          type: array
          items:
            $ref: '#/components/schemas/AttributeValue'
        businessId:
          type: string
        fullname:
          type: string
        birthday:
          type: string
        metadata:
          type: object

````