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

# Create Ticket

> Create a new support ticket

<Warning>
  **Requires Premium or Enterprise subscription**
</Warning>

## Overview

Create a new support ticket. The author does not need to be a workspace member unless the category requires it.

**Author Information:**

* `authorUserId` is required
* `authorAvatarUrl` is required
* `authorUsername` and `authorDisplayName` are optional but recommended for users not in the database

## Request Body

<ParamField body="subject" type="string" required>
  Ticket subject/title
</ParamField>

<ParamField body="category" type="string" required>
  Category ID (must exist in workspace configuration)
</ParamField>

<ParamField body="message" type="string" required>
  Initial message content
</ParamField>

<ParamField body="priority" type="string">
  Ticket priority: `low`, `medium`, `high`, `urgent` (default: `medium`)
</ParamField>

<ParamField body="authorUserId" type="integer" required>
  UserId of the ticket creator
</ParamField>

<ParamField body="authorUsername" type="string">
  Username of the author (used if not in database)
</ParamField>

<ParamField body="authorDisplayName" type="string">
  Display name of the author (used if not in database)
</ParamField>

<ParamField body="authorAvatarUrl" type="string" required>
  Avatar URL of the ticket author
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="TicketId" type="string">
      The generated ticket ID
    </ResponseField>

    <ResponseField name="_id" type="string">
      MongoDB document ID
    </ResponseField>

    <ResponseField name="WorkspaceId" type="string">
      The workspace ID
    </ResponseField>

    <ResponseField name="Subject" type="string">
      Ticket subject
    </ResponseField>

    <ResponseField name="Category" type="string">
      Category ID
    </ResponseField>

    <ResponseField name="Department" type="string">
      Assigned department ID
    </ResponseField>

    <ResponseField name="Status" type="string">
      Ticket status (always "open" for new tickets)
    </ResponseField>

    <ResponseField name="Priority" type="string">
      Ticket priority
    </ResponseField>

    <ResponseField name="Author" type="object">
      Author information including UserId, Username, DisplayName, and AvatarUrl
    </ResponseField>

    <ResponseField name="CreatedAt" type="string">
      Creation timestamp (ISO 8601)
    </ResponseField>

    <ResponseField name="UpdatedAt" type="string">
      Last update timestamp (ISO 8601)
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.series.hr/tickets/create \
    -H "apikey: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "subject": "Help with ranking",
      "category": "support",
      "message": "I need help getting ranked in the group",
      "priority": "medium",
      "authorUserId": 123456789,
      "authorUsername": "player123",
      "authorDisplayName": "Player Name",
      "authorAvatarUrl": "https://tr.rbxcdn.com/avatar-url"
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch('https://api.series.hr/tickets/create', {
    method: 'POST',
    headers: {
      'apikey': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      subject: 'Help with ranking',
      category: 'support',
      message: 'I need help getting ranked in the group',
      priority: 'medium',
      authorUserId: 123456789,
      authorUsername: 'player123',
      authorDisplayName: 'Player Name',
      authorAvatarUrl: 'https://tr.rbxcdn.com/avatar-url'
    })
  });

  const data = await response.json();
  ```

  ```lua Lua (Roblox) theme={null}
  local HttpService = game:GetService("HttpService")

  local response = HttpService:RequestAsync({
      Url = "https://api.series.hr/tickets/create",
      Method = "POST",
      Headers = {
          ["apikey"] = "YOUR_API_KEY",
          ["Content-Type"] = "application/json"
      },
      Body = HttpService:JSONEncode({
          subject = "Help with ranking",
          category = "support",
          message = "I need help getting ranked in the group",
          priority = "medium",
          authorUserId = 123456789,
          authorUsername = "player123",
          authorDisplayName = "Player Name",
          authorAvatarUrl = "https://tr.rbxcdn.com/avatar-url"
      })
  })

  local data = HttpService:JSONDecode(response.Body)
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.series.hr/tickets/create',
      headers={
          'apikey': 'YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'subject': 'Help with ranking',
          'category': 'support',
          'message': 'I need help getting ranked in the group',
          'priority': 'medium',
          'authorUserId': 123456789,
          'authorUsername': 'player123',
          'authorDisplayName': 'Player Name',
          'authorAvatarUrl': 'https://tr.rbxcdn.com/avatar-url'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response Example

```json theme={null}
{
  "success": true,
  "data": {
    "TicketId": "TICKET-1234567890-ABCD",
    "_id": "...",
    "WorkspaceId": "a7d5339a-5531-4336-99c6-6f3249c9ac20",
    "Subject": "Help with ranking",
    "Category": "support",
    "Department": "support-dept",
    "Status": "open",
    "Priority": "medium",
    "Author": {
      "UserId": 123456789,
      "Username": "player123",
      "DisplayName": "Player Name",
      "AvatarUrl": "https://..."
    },
    "CreatedAt": "2025-01-15T10:30:00.000Z",
    "UpdatedAt": "2025-01-15T10:30:00.000Z"
  }
}
```

## Error Responses

<AccordionGroup>
  <Accordion title="400 - Validation Error">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 400,
        "message": "Validation error: Subject is required"
      }
    }
    ```
  </Accordion>

  <Accordion title="400 - Missing authorAvatarUrl">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 400,
        "message": "authorAvatarUrl is required"
      }
    }
    ```
  </Accordion>

  <Accordion title="403 - Premium Required">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 403,
        "message": "Tickets module requires a Premium or Enterprise subscription"
      }
    }
    ```
  </Accordion>

  <Accordion title="403 - Module Not Enabled">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 403,
        "message": "Tickets module is not enabled for this workspace"
      }
    }
    ```
  </Accordion>

  <Accordion title="403 - Membership Required">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 403,
        "message": "Workspace membership is required to create tickets in this category"
      }
    }
    ```
  </Accordion>

  <Accordion title="400 - Max Tickets Reached">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 400,
        "message": "You can only have 5 open tickets in this category"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Rate Limit

**25 requests per second** per API key


## OpenAPI

````yaml POST /tickets/create
openapi: 3.0.0
info:
  title: Series API
  version: 1.0.0
  description: >-
    Series API — a free REST API by Sailboat Games, LLC that lets Roblox
    communities programmatically manage workspaces, staff, sessions, time-off
    and activity data.
  contact:
    name: Sailboat Games, LLC.
    email: admin@sailboatgames.com
servers:
  - url: https://api.series.hr
    description: Production API
security:
  - ApiKeyAuth: []
paths:
  /tickets/create:
    post:
      tags:
        - Tickets
      summary: Create ticket
      description: >-
        Create a new support ticket. The author does not need to be a workspace
        member unless the category requires it. Requires Premium or Enterprise
        subscription.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - subject
                - category
                - message
                - authorUserId
                - authorAvatarUrl
              properties:
                subject:
                  type: string
                  description: Ticket subject
                category:
                  type: string
                  description: Category ID
                message:
                  type: string
                  description: Initial message content
                priority:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                    - urgent
                  default: medium
                authorUserId:
                  type: integer
                  description: UserId of the ticket creator
                authorUsername:
                  type: string
                  description: Username of the author
                authorDisplayName:
                  type: string
                  description: Display name of the author
                authorAvatarUrl:
                  type: string
                  description: Avatar URL of the ticket author
      responses:
        '201':
          description: Ticket created successfully
        '400':
          description: Invalid request body or category
        '401':
          description: API key is required
        '403':
          description: Tickets module not enabled, Premium required, or membership required
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: >-
        Pass your API key in the `apikey` header. Alternatively, the `x-api-key`
        header is also accepted.

````