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

# Create support ticket



## OpenAPI

````yaml /api-reference/openapi.json post /ticket/create
openapi: 3.1.0
info:
  title: BillingServ API V2
  description: >-
    Resources and tools for developers to integrate with the BillingServ v2 API.
    v1 is deprecated; use the v2 base URL and bearer-token authentication unless
    an endpoint states otherwise.
  version: '2.0'
servers:
  - url: https://demo.onlinebillingform.com/api/v2
    description: BillingServ demo API
security:
  - bearerAuth: []
tags:
  - name: Customer
  - name: Package
  - name: Group
  - name: Country
  - name: County
  - name: VPN
  - name: Invoice
  - name: Order
  - name: Module
  - name: Report
  - name: Marketing
  - name: Setting
  - name: Checkout
  - name: Usage
  - name: Support
paths:
  /ticket/create:
    post:
      tags:
        - Support
      summary: Create support ticket
      operationId: POST_ticket_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  type: string
                  description: >-
                    Ticket subject. Letters, numbers, spaces, and basic
                    punctuation only.
                user_id:
                  type: integer
                  description: ID of the customer the ticket belongs to.
                message:
                  type: string
                  description: >-
                    Initial ticket message. Standard rich text formatting is
                    allowed; emojis and unsupported HTML tags are rejected.
                support_department:
                  type: string
                  description: >-
                    Support department the ticket is filed under. Required when
                    departments are configured.
                priority:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                    - emergency
                  default: low
                status:
                  type: string
                  enum:
                    - open
                    - pending
                    - close
                    - awaiting_reply
                  default: open
                assignee_by:
                  type: integer
                  description: Staff user ID to assign the ticket to.
              required:
                - subject
                - user_id
                - message
                - support_department
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
              example:
                success: true
                ticket:
                  id: 1
                  subject: Cannot access my invoices
                  user_id: 42
                  assignee_by: null
                  status: open
                  support_department: Billing
                  priority: low
                  last_action: Created
                  messages:
                    - id: 10
                      support_ticket_id: 1
                      replay_by: 5
                      message: >-
                        <p>Thanks for reaching out, we are looking into
                        this.</p>
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                errors: Invalid API Key
        '403':
          description: Authenticated key does not have permission for this endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                errors: Insufficient permissions for this endpoint.
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
              example:
                success: false
                errors:
                  id:
                    - The id field is required.
      security:
        - bearerAuth: []
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errors:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
            - type: object
              additionalProperties: true
      additionalProperties: true
    ValidationErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errors:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
              additionalProperties: true
            - type: string
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Use `Authorization: Bearer <live_api_key>`.'

````