---
title: "Create a support ticket"
url: https://docs.corefinity.com/api/reference/support/create-support-ticket
type: endpoint
last_updated: 2026-11-13
feature: support
related:
  - https://docs.corefinity.com/guides/support/raise-and-follow-a-ticket.md
---
# Create a support ticket

Opens a ticket as the New Ticket form does, with the choices the ticket choices endpoint answers, and answers
the ticket; Corefinity's support team is told straight away and you are emailed. An `emergency` pages
Corefinity's on-call engineers, so it is refused unless `confirm_emergency` is `true`.

```http
POST /api/support/tickets
```

- Scope: `write`
- Rate limit: 60 a minute
- Try it in the console: off. It sends email to real people. Copy the request and run it yourself when you are sure.

## Body

- `body` (string, required): The problem, in Markdown.
- `company_id` (integer or null): The company the ticket is for. Required when the choices say `chooses_company`; refused for anyone else unless it is their own company.
- `confirm_emergency` (boolean): `true` for an `emergency`, once you agree to what the `emergency_notice` says. An emergency pages Corefinity's on-call engineers.
- `department_id` (integer, required): One of the `departments` the choices offer.
- `environment_id` (integer or null): One environment, in place of `environment_ids`.
- `environment_ids` (array of integers): Environments of those websites, from the choices.
- `priority` (string or null): `medium` when left out. One of `emergency`, `high`, `medium`, `low`, `null`.
- `replication_step` (string or null): The steps to see the problem, in Markdown.
- `subject` (string, required)
- `website_id` (integer or null): One website, in place of `website_ids`.
- `website_ids` (array of integers): The websites the ticket is about, from the choices.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/support/tickets \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Every order fails at the **payment** step since 09:00.",
    "department_id": 21,
    "environment_ids": [
      1311
    ],
    "priority": "high",
    "replication_step": "1. Add any product to the basket\n2. Pay by card",
    "subject": "Checkout fails at the payment step",
    "website_ids": [
      1310
    ]
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/support/tickets', [
        'body' => 'Every order fails at the **payment** step since 09:00.',
        'department_id' => 21,
        'environment_ids' => [
            1311,
        ],
        'priority' => 'high',
        'replication_step' => '1. Add any product to the basket
2. Pay by card',
        'subject' => 'Checkout fails at the payment step',
        'website_ids' => [
            1310,
        ],
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/support/tickets', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    body: 'Every order fails at the **payment** step since 09:00.',
    department_id: 21,
    environment_ids: [
      1311,
    ],
    priority: 'high',
    replication_step: '1. Add any product to the basket\n2. Pay by card',
    subject: 'Checkout fails at the payment step',
    website_ids: [
      1310,
    ],
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.post(
    "https://manage.corefinity.com/api/support/tickets",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "body": "Every order fails at the **payment** step since 09:00.",
        "department_id": 21,
        "environment_ids": [
            1311,
        ],
        "priority": "high",
        "replication_step": "1. Add any product to the basket\n2. Pay by card",
        "subject": "Checkout fails at the payment step",
        "website_ids": [
            1310,
        ],
    },
)

data = res.json() if res.content else None
```

## Responses

### 201 The ticket was opened.

```json
{
  "attachments": [],
  "body_html": "<p>Every order fails at the <strong>payment</strong> step since 09:00.</p>",
  "body_text": "Every order fails at the payment step since 09:00.",
  "can": {
    "change_priority": true,
    "close": true,
    "reopen": false,
    "reply": true
  },
  "company": {
    "id": 1204,
    "name": "Harbour & Finch"
  },
  "created_at": "2026-11-03T16:40:11Z",
  "department": {
    "id": 21,
    "name": "Support"
  },
  "environment": {
    "id": 1311,
    "name": "Production"
  },
  "environments": [
    {
      "id": 1311,
      "name": "Production"
    }
  ],
  "id": 48211,
  "priority": "high",
  "priority_label": "High",
  "raised_by": {
    "email": "eleanor.finch@harbourandfinch.example.com",
    "id": 2041,
    "name": "Eleanor Finch"
  },
  "replication_step_html": "<ol><li>Add any product to the basket</li><li>Pay by card</li></ol>",
  "replies": [],
  "reply_count": 0,
  "requester": {
    "email": "eleanor.finch@harbourandfinch.example.com",
    "id": 2041,
    "name": "Eleanor Finch"
  },
  "scheduled_for": null,
  "status": "pending",
  "status_label": "Pending",
  "subject": "Checkout fails at the payment step",
  "updated_at": "2026-11-03T16:40:11Z",
  "url": "https://manage.corefinity.com/resources/tickets/48211",
  "website": {
    "id": 1310,
    "name": "Harbour & Finch trade"
  },
  "websites": [
    {
      "id": 1310,
      "name": "Harbour & Finch trade"
    }
  ]
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the `write` scope (`scope_required`).

```json
{
  "code": "scope_required",
  "message": "This access token does not have the destructive scope this needs. Use a token with the destructive scope.",
  "reason": "scope_required",
  "scope": "destructive"
}
```

### 422 A field is missing or is a choice the form does not offer (`invalid`, with `field` and `errors`), or the ticket is an emergency without `confirm_emergency` (`confirm`). Nothing was opened.

```json
{
  "code": "invalid",
  "errors": {
    "company_id": [
      "You cannot raise a ticket for that company."
    ]
  },
  "field": "company_id",
  "message": "You cannot raise a ticket for that company.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 422 | `confirm` | The action needs an explicit confirmation field. Ask the person, then send it. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Support tickets](https://docs.corefinity.com/guides/support/raise-and-follow-a-ticket.md)
