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

# Crear un ticket a nombre de un usuario de Atlas

> created_by = identidad de plataforma «Atlas»; autor = nombre del usuario; contact_id = Contact del cliente buscado o creado por correo.



## OpenAPI

````yaml /generated/specs/atlas-portal.json post /api/v1/internal/atlas-portal/clients/{atlasClientId}/tickets
openapi: 3.0.0
info:
  title: Raul API - Portal del cliente (Atlas)
  description: >-
    Namespace interno que consume el backend de Atlas: facturacion y soporte de
    un cliente comercial resuelto por Client.atlas_client_id, con token de
    servicio propio.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/internal/atlas-portal/clients/{atlasClientId}/tickets:
    post:
      tags:
        - Atlas portal
      summary: Crear un ticket a nombre de un usuario de Atlas
      description: >-
        created_by = identidad de plataforma «Atlas»; autor = nombre del
        usuario; contact_id = Contact del cliente buscado o creado por correo.
      operationId: AtlasPortalInternalController_createTicket
      parameters:
        - name: atlasClientId
          required: true
          in: path
          description: >-
            Id del client de Atlas (24 hex); se resuelve contra
            Client.atlas_client_id
          schema:
            example: 64f1c0ffee0ddba11ce55aa1
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AtlasPortalCreateTicketCommandDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalTicketDetailResponseDto'
        '400':
          description: Comando inválido (VALIDATION_ERROR)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalErrorResponseDto'
        '401':
          description: Token de servicio inválido (UNAUTHORIZED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalErrorResponseDto'
        '404':
          description: Cliente de Atlas sin vínculo comercial (CLIENT_NOT_LINKED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtlasPortalErrorResponseDto'
      security:
        - bearerAuth: []
components:
  schemas:
    AtlasPortalCreateTicketCommandDto:
      type: object
      properties:
        contractVersion:
          type: number
          description: Versión del contrato; el consumidor acepta la vigente y la anterior
          example: 1
          minimum: 1
        title:
          type: string
          minLength: 3
          maxLength: 100
        description:
          type: string
          minLength: 1
          maxLength: 10000
        category:
          type: string
          enum:
            - technical
            - billing
            - commercial
            - other
        author:
          $ref: '#/components/schemas/AtlasPortalAuthorDto'
      required:
        - contractVersion
        - title
        - description
        - category
        - author
    AtlasPortalTicketDetailResponseDto:
      type: object
      properties:
        contractVersion:
          type: number
          description: Versión del contrato; el consumidor acepta la vigente y la anterior
          example: 1
          minimum: 1
        ticket:
          $ref: '#/components/schemas/AtlasPortalTicketDetailDto'
      required:
        - contractVersion
        - ticket
    AtlasPortalErrorResponseDto:
      type: object
      properties:
        contractVersion:
          type: number
          description: Versión del contrato; el consumidor acepta la vigente y la anterior
          example: 1
          minimum: 1
        code:
          type: string
          enum:
            - CLIENT_NOT_LINKED
            - INVOICE_NOT_FOUND
            - TICKET_NOT_FOUND
            - TICKET_CLOSED
            - VALIDATION_ERROR
            - UNAUTHORIZED
        message:
          type: string
      required:
        - contractVersion
        - code
        - message
    AtlasPortalAuthorDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 60
          example: Paula Contreras
        email:
          type: string
          format: email
          minLength: 3
          maxLength: 255
      required:
        - name
        - email
    AtlasPortalTicketDetailDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
        status:
          $ref: '#/components/schemas/AtlasPortalTicketReferenceDto'
        category:
          type: string
          enum:
            - technical
            - billing
            - commercial
            - other
          nullable: true
        authorName:
          type: string
          nullable: true
        commentsCount:
          type: number
          minimum: 0
          description: Sin notas internas
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        closedAt:
          type: string
          format: date-time
          nullable: true
        description:
          type: string
          nullable: true
        comments:
          type: array
          items:
            $ref: '#/components/schemas/AtlasPortalTicketCommentDto'
      required:
        - id
        - title
        - status
        - category
        - authorName
        - commentsCount
        - createdAt
        - updatedAt
        - closedAt
        - description
        - comments
    AtlasPortalTicketReferenceDto:
      type: object
      properties:
        id:
          type: number
          example: 1
        name:
          type: string
          example: Abierto
      required:
        - id
        - name
    AtlasPortalTicketCommentDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        ticketId:
          type: string
          format: uuid
        authorName:
          type: string
          nullable: true
        authorRole:
          type: string
          enum:
            - client
            - staff
        content:
          type: string
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - ticketId
        - authorName
        - authorRole
        - content
        - createdAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Token de sesión Better Auth para rutas de backoffice; las rutas de
        portal usan su token propio.

````

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