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

# Create ticket

> Open a new support ticket with a subject and message to contact the Xquik team

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

<Callout icon="circle-check" color="#16a34a">
  **Free** - does not consume credits
</Callout>

<Info>
  Support tickets are free for all authenticated users.
</Info>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://xquik.com/api/v1/support/tickets \
    -H "x-api-key: xq_YOUR_KEY_HERE" \
    -H "Content-Type: application/json" \
    -d '{
      "subject": "Cannot connect X account",
      "body": "I keep getting a connection error when trying to link my account."
    }' | jq
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/support/tickets", {
    method: "POST",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      subject: "Cannot connect X account",
      body: "I keep getting a connection error when trying to link my account.",
    }),
  });
  const data = await response.json();
  ```

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

  response = requests.post(
      "https://xquik.com/api/v1/support/tickets",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
      json={
          "subject": "Cannot connect X account",
          "body": "I keep getting a connection error when trying to link my account.",
      },
  )
  data = response.json()
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      body, _ := json.Marshal(map[string]interface{}{
          "subject": "Cannot connect X account",
          "body":    "I keep getting a connection error when trying to link my account.",
      })

      req, err := http.NewRequest("POST", "https://xquik.com/api/v1/support/tickets", bytes.NewReader(body))
      if err != nil {
          panic(err)
      }
      req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")
      req.Header.Set("Content-Type", "application/json")

      resp, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var data map[string]interface{}
      if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
          panic(err)
      }
      fmt.Println(data)
  }
  ```
</CodeGroup>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://xquik.com/dashboard).
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

## Body

<ParamField body="subject" type="string" required>
  Ticket subject. 1-500 characters.
</ParamField>

<ParamField body="body" type="string" required>
  Initial message. 1-10,000 characters.
</ParamField>

## Response

<Tabs>
  <Tab title="201 Created">
    <ResponseField name="publicId" type="string">Unique ticket public ID.</ResponseField>

    ```json theme={null}
    {
      "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6"
    }
    ```
  </Tab>

  <Tab title="400 Invalid Input">
    ```json theme={null}
    { "error": "invalid_input", "message": "Invalid input. Check the request body." }
    ```

    Missing or invalid `subject` or `body` field.
  </Tab>

  <Tab title="401 Unauthenticated">
    ```json theme={null}
    { "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }
    ```

    Missing or invalid API key.
  </Tab>

  <Tab title="429 Rate Limited">
    ```json theme={null}
    { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }
    ```

    Wait for the `Retry-After` value before opening another ticket.
  </Tab>
</Tabs>

<Note>
  **Next steps:** [List Tickets](/api-reference/support/list) to see all your tickets, [Get Ticket](/api-reference/support/get) to fetch details and message history, or [Reply to Ticket](/api-reference/support/reply) to add a message.
</Note>
