Skip to content

Service & Ticket Endpoints

Services represent professional services or projects linked to SVC-class entitlements. Tickets are individual requests created against services or environments, tracked with SLA status.

Service Endpoints

Base path: /wp-json/middag-account/v1/services

MethodEndpointAuthScopeDescription
GET/servicesJWT + OrgentitlementsList organization services
GET/services/{id}JWT + OrgentitlementsService details
GET/services/{id}/ticketsJWT + OrgentitlementsService requests for service

GET /services

Query filters:

ParameterTypeValues
statusstringproposal, approved, in_progress, on_hold, delivered, closed, cancelled
lifecyclestringongoing, project

Response (200):

json
{
    "success": true,
    "data": [
        {
            "id": 801,
            "name": "Moodle Customization Project",
            "status": "in_progress",
            "lifecycle": "project",
            "entitlement_id": 103,
            "entitlement_code": "SVC-2026030005",
            "organization_id": 42,
            "created_at": "2026-03-15T10:00:00Z"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 20,
        "total": 1,
        "pages": 1
    }
}

GET /services/:id

Full service details.

Response fields: id, name, status, lifecycle, description, entitlement_id, entitlement_code, organization_id, metadata, created_at, updated_at.

Ticket Endpoints

Base path: /wp-json/middag-account/v1/tickets

MethodEndpointAuthScopeDescription
GET/ticketsJWT + OrgentitlementsList organization SRs
GET/tickets/{id}JWT + OrgentitlementsSR details
POST/ticketsJWT + OrgentitlementsCreate service request
GET/tickets/{id}/historyJWT + OrgentitlementsStatus transition history

SR Number Format

Service request numbers follow the pattern SR-{YEAR}{SEQ:4d}. Example: SR-20260001, SR-20260042.

POST /tickets

Create a new service request. Clients can only create SRs for ENV-class entitlements (standalone). Admin users can create for any entitlement or service.

Request:

json
{
    "title": "SSL Certificate Renewal",
    "description": "The SSL certificate for lms.example.com expires soon. Please renew.",
    "entitlement_id": 102,
    "priority": "high"
}

Response (201):

json
{
    "success": true,
    "data": {
        "id": 901,
        "number": "SR-20260042",
        "status": "open",
        "title": "SSL Certificate Renewal",
        "entitlement_id": 102
    },
    "message": "Service request created"
}

GET /tickets/:id/history

Returns the full status transition history for a service request.

Response (200):

json
{
    "success": true,
    "data": [
        {
            "from_status": null,
            "to_status": "open",
            "changed_at": "2026-04-01T10:00:00Z",
            "changed_by": 15
        },
        {
            "from_status": "open",
            "to_status": "in_progress",
            "changed_at": "2026-04-01T14:30:00Z",
            "changed_by": 1
        }
    ]
}

Service Statuses

StatusDescription
proposalService proposed, awaiting approval
approvedApproved, work not yet started
in_progressWork actively underway
on_holdTemporarily paused
deliveredWork completed, awaiting sign-off
closedSigned off and closed (terminal)
cancelledCancelled before completion (terminal)

Ticket Statuses

StatusDescription
openNewly created, awaiting assignment
in_progressBeing worked on
waitingBlocked, waiting on client or third party
resolvedSolution provided, awaiting confirmation
closedConfirmed resolved (terminal)
cancelledCancelled (terminal)