Create Ticket
You can use this endpoint to create a new ticket.
Request
POST /api/v1/tickets
curl --request POST \
--url 'https://www.zep-online.de/zepinstanz/next/api/v1/tickets' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"status": 1,
"project_id": 456,
"project_task_id": "12",
"priority": 3,
"subject": "Fix user interface bug",
"planned_hours": 8.5,
"creator_username": "john.doe",
"receipt_date": "2024-11-15",
"processor_username": "jane.smith",
"start_date": "2024-11-16",
"deadline": "2024-11-20",
"categories": ["Bug", "UI"]
}'Required Fields
- status (integer): Ticket status
1- STATUS_NEW: New ticket2- STATUS_IN_PROCESS: Ticket is being processed3- STATUS_DONE: Ticket is completed4- STATUS_REJECTED: Ticket has been rejected5- STATUS_APPROVED: Ticket has been approved8- STATUS_BILLED: Ticket has been billed
- project_id (integer): Project ID
- project_task_id (string): Project task ID
- priority (integer): Priority from 1 (lowest) to 5 (highest)
- subject (string): Ticket subject/title (max. 255 characters)
Optional Fields
- planned_hours (number): Estimated hours to complete
- creator_username (string): Username of creator (required if customer_contact_person not provided)
- receipt_date (string): Receipt date (Format: YYYY-MM-DD)
- processor_username (string): Username of processor
- start_date (string): Start date of work (Format: YYYY-MM-DD)
- deadline (string): Deadline (Format: YYYY-MM-DD)
- from_mail (string): Email address from which ticket was created
- external_ticket_number (string): External ticket number (max. 255 characters)
- notify_of_completion (boolean): Notify on completion
- prevent_overbooking (integer): Overbooking prevention
0- YES_ALL: Allow all work to exceed planned hours1- YES_ONLY_NON_BILLABLE: Allow only non-billable work to exceed2- NO_ALL: Prevent all work from exceeding planned hours3- YES_TRAVEL_OR_NON_BILLABLE: Allow travel or non-billable work to exceed4- YES_ONLY_TRAVEL: Allow only travel work to exceed
- customer_contact_person (string): Customer contact email (required if creator_username not provided)
- customer_reference (string): Customer reference number (max. 255 characters)
- keywords (string): Comma-separated keywords/tags (max. 255 characters)
- categories (array): Array of category names
Response
{
"data": {
"id": 789,
"status": 1,
"project_id": 456,
"project_task_id": "12",
"priority": 3,
"subject": "Fix user interface bug",
"planned_hours": "8.50",
"creator_username": "john.doe",
"receipt_date": "2024-11-15",
"processor_username": "jane.smith",
"start_date": "2024-11-16",
"deadline": "2024-11-20",
"created": "2024-11-15T10:30:00.000000Z",
"modified": "2024-11-15T10:30:00.000000Z",
"categories": [
{
"id": 15,
"name": "Bug"
},
{
"id": 28,
"name": "UI"
}
]
}
}Error Codes
- 401 Unauthorized: Invalid or missing authentication
- 422 Unprocessable Entity: Validation error
Notes
- Either
creator_usernameorcustomer_contact_personmust be provided - All usernames must be valid employee usernames
- Project and project task must exist
- Categories must exist in the categories table