Ticket event

When a ticket is created or updated, Papaya sends a POST request to your server endpoint with the details of the event.

{
   "action":"update",
   "created":"2023-12-14T10:13:32Z",
   "data":{
      "created_at":"2023-12-14 10:07:26 UTC",
      "updated_at":"2023-12-14 10:08:24 UTC",
      "closed_at": null,
      "close_reason":null,
      "description":"The brakes have been fading and not don't work when it rains.",
      "documents":[ ],
      "due_date":null,
      "fleet":{
         "id":"db9623f3-9e74-41d9-b895-0b64006ce6fe",
         "name":"We deliver Fleet",
         "public_resource":true,
         "type":"organization"
      },
      "fleet_state":{
         "cancellation_reason":null,
         "rejection_reason":null,
         "state":"in_progress",
         "state_pretty":"In progress"
      },
      "id":"c61c2238-bb4c-4b50-b61c-686e5c17e0f6",
      "labels":[
         "Repair"
      ],
      "move_ticket_metadata":null,
      "priority":"priority_low",
      "priority_pretty":"Low",
      "public_resource":true,
      "rideable":false,
      "sequential_id":"GIR-9",
      "service_provider_state":{
         "cancellation_reason":null,
         "rejection_reason":null,
         "state":"in_progress",
         "state_pretty":"In progress"
      },
      "service_providers":[
         {
            "id":"6bd6b5f2-5ead-4810-8a1c-0faead1bf277",
            "name":"We fix e-bikes",
            "public_resource":true,
            "type":"organization"
         }
      ],
      "ticket_type":"DamageTicket",
      "ticket_type_pretty":"Damage Ticket",
      "title":"Brakes don't work well in wet weather",
      "type":"ticket",
      "url":"https://papayadash.com/ticket/c61c2238-bb4c-4b50-b61c-686e5c17e0f6",
      "work_order_id":"fffefa64-ab10-4ea9-baf0-f695fc040754",
      "user":{
         "id":"37c07dec-8e39-4726-8ff5-e30218b4d90f",
         "name":"John Smith",
         "title":null
      },
      "vehicle":{
         "hub":{
            "city_text":"Barcelona",
            "country_text":"Spain",
            "external_id":null,
            "id":"ec21fd88-343e-423e-9b9e-aa08d1f12102",
            "name":"Barcelona Hub"
         },
         "id":"0ee7a233-1def-421a-ab46-0d11ac396ec9",
         "legal_identifier":"ABC-123",
         "mileage":{
            "distance":2000,
            "unit":"km"
         },
         "model":{
            "brand":{
               "id":"5dfd3289-f3ab-4fb1-8b91-f08b6d5bb9f0",
               "name":"Cowboy"
            },
            "id":"0eae62c6-f91f-4922-93eb-df7bfb27124f",
            "image_url":"https://images.papayadash.com/model/0eae62c6-f91f-4922-93eb-df7bfb27124f/logo/small-b1ec8082a0f517b78fc3d6fe1beb1113.png",
            "name":"4S"
         },
         "name":"ABC-123",
         "partner_id":"ABC-123",
         "state":"unavailable",
         "url":"https://papayadash.com/vehicle/0ee7a233-1def-421a-ab46-0d11ac396ec9"
      },
      "files": [
        {
          "public_resource":true,
          "type":"document",
          "name":"front_wheel_damaged.png",
          "url": "https://papaya-stg.s3.eu-west-1.amazonaws.com/document/6cb1a7e9-9f72-427e-a04d-a8b2615ec1c4/file/e46d9632577496197c8c9c9d01ce6b3a.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZPDF72P5ERR67CLV%2F20241205%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20241205T120305Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=83c40d45472cf6104df32852953e9a0f26e45b8b2d174ed846e0395e3a5109dd",
          "metadata":{"size":382240, "filename":"front_wheel_damaged.png", "mime_type":"image/png"}
        }
      ],
   },
   "id":"event 12345",
   "resource":"ticket"
}

You should always respond with a 200-level status code to indicate that you received the notification. Papaya ignores the body of your response, so a 204 status with an empty body is ideal:

204 No Content