New API version v7.8.64 has been released! 🎉
REST Documentation
POST Create Subtask

Create Subtask

This endpoint allows you to add a new subtask to an existing ticket.

Request

POST /api/v1/tickets/:id/subtasks
curl --request POST \
     --url 'https://www.zep-online.de/zepinstanz/next/api/v1/tickets/123/subtasks' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer {token}' \
     --header 'Content-Type: application/json' \
     --data '{
  "subject": "Perform database optimization",
  "name": "DB Optimization Phase 1",
  "creator_username": "john.doe",
  "status": 1,
  "categories": ["Performance", "Backend"],
  "start_date": "2024-11-20",
  "deadline": "2024-11-25",
  "planned_hours": 12.5,
  "processor_username": "jane.smith"
}'

Parameters

  • id (integer, required): The ID of the parent ticket

Required Fields

  • subject (string): Subject of the subtask (max. 255 characters)
  • name (string): Name/title of the subtask (max. 255 characters)
  • creator_username (string): Username of the creator (required if customer_contact_person is not provided)
  • status (integer): Subtask status
    • 1 - STATUS_NEW: New subtask
    • 2 - STATUS_IN_PROCESS: Subtask is being processed
    • 3 - STATUS_DONE: Subtask is completed
    • 4 - STATUS_REJECTED: Subtask was rejected
    • 5 - STATUS_APPROVED: Subtask was approved
    • 8 - STATUS_BILLED: Subtask was billed
  • categories (array): Array of category names

Optional Fields

  • customer_reference (string): Customer reference number (max. 255 characters, required if creator_username is not provided)
  • start_date (string): Start date for processing (Format: YYYY-MM-DD)
  • receipt_date (string): Receipt date (Format: YYYY-MM-DD)
  • deadline (string): Due date (Format: YYYY-MM-DD)
  • planned_hours (number): Estimated hours for completion
  • prevent_overbooking (integer): Overbooking prevention
    • 0 - YES_ALL: All work can exceed planned hours
    • 1 - YES_ONLY_NON_BILLABLE: Only non-billable work
    • 2 - NO_ALL: No work can exceed
    • 3 - YES_TRAVEL_OR_NON_BILLABLE: Travel or non-billable work
    • 4 - YES_ONLY_TRAVEL: Only travel work
  • processor_username (string): Username of the processor
  • keywords (string): Comma-separated keywords/tags (max. 255 characters)
  • customer_contact_person (string): Customer contact email (required if creator_username is not provided)

Response

{
	"data": {
		"id": 456,
		"ticket_id": 123,
		"subject": "Perform database optimization",
		"name": "DB Optimization Phase 1",
		"status": 1,
		"creator_username": "john.doe",
		"processor_username": "jane.smith",
		"start_date": "2024-11-20",
		"deadline": "2024-11-25",
		"planned_hours": "12.50",
		"created": "2024-11-18T14:30:00.000000Z",
		"modified": "2024-11-18T14:30:00.000000Z",
		"categories": [
			{
				"id": 22,
				"name": "Performance"
			},
			{
				"id": 18,
				"name": "Backend"
			}
		]
	}
}

Error Codes

  • 401 Unauthorized: Invalid or missing authentication
  • 404 Not Found: Parent ticket not found
  • 422 Unprocessable Entity: Validation error

Notes

  • The subtask will be associated with the ticket with the specified ID
  • Either creator_username or customer_contact_person must be provided
  • All usernames must be valid employee usernames
  • Categories must exist in the category table
  • The subtask inherits permissions from the parent ticket