{
	"info": {
		"name": "SupportLayer API",
		"description": "Official Postman collection for the SupportLayer REST API (v1).\n\nSet the `base_url` and `api_key` variables in your Postman environment before sending requests.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{api_key}}",
				"type": "string"
			}
		]
	},
	"variable": [
		{
			"key": "base_url",
			"value": "https://www.supportlayer.app",
			"type": "string"
		},
		{
			"key": "api_key",
			"value": "sl_live_YOUR_KEY_HERE",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Tickets",
			"item": [
				{
					"name": "List tickets",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/tickets?status=open",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets"],
							"query": [
								{ "key": "status", "value": "open", "description": "Filter by status key (e.g. open, in_progress, closed)" },
								{ "key": "assignee", "value": "", "description": "Filter by assignee user ID", "disabled": true },
								{ "key": "category", "value": "", "description": "Filter by category ID", "disabled": true },
								{ "key": "product", "value": "", "description": "Filter by product ID", "disabled": true },
								{ "key": "sla", "value": "", "description": "Filter by SLA health (ok, at_risk, breached)", "disabled": true },
								{ "key": "search", "value": "", "description": "Full-text search on subject and body", "disabled": true }
							]
						},
						"description": "Returns tickets ordered by most recently updated. Supports filtering by status, assignee, category, product, SLA health, and free-text search."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"total\": 2,\n  \"tickets\": [\n    {\n      \"id\": 42,\n      \"subject\": \"Cannot export PDF on Safari\",\n      \"status\": { \"id\": 1, \"key\": \"open\", \"label\": \"Open\" },\n      \"urgency\": { \"id\": 2, \"name\": \"High\" },\n      \"assignee\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n      \"reporter\": { \"id\": 12, \"name\": \"Sam Kim\" },\n      \"category\": { \"id\": 3, \"name\": \"Bug\" },\n      \"sla_deadline\": \"2026-04-06T14:30:00+00:00\",\n      \"created_at\": \"2026-04-06T10:00:00+00:00\",\n      \"updated_at\": \"2026-04-06T12:15:00+00:00\"\n    }\n  ]\n}"
						}
					]
				},
				{
					"name": "Get ticket",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42"]
						},
						"description": "Returns full ticket details including body, tags, attachments, and escalation history."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 42,\n  \"subject\": \"Cannot export PDF on Safari\",\n  \"body\": \"When I click Export > PDF the page just spins.\",\n  \"status\": { \"id\": 1, \"key\": \"open\", \"label\": \"Open\" },\n  \"urgency\": { \"id\": 2, \"name\": \"High\" },\n  \"assignee\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n  \"reporter\": { \"id\": 12, \"name\": \"Sam Kim\" },\n  \"category\": { \"id\": 3, \"name\": \"Bug\" },\n  \"product\": null,\n  \"tags\": [{ \"id\": 1, \"name\": \"safari\", \"color\": \"#3b82f6\" }],\n  \"attachments\": [],\n  \"escalation_history\": [],\n  \"sla_deadline\": \"2026-04-06T14:30:00+00:00\",\n  \"sla_first_response_at\": null,\n  \"created_at\": \"2026-04-06T10:00:00+00:00\",\n  \"updated_at\": \"2026-04-06T12:15:00+00:00\"\n}"
						}
					]
				},
				{
					"name": "Create ticket",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"subject\": \"Login page returns 500 error\",\n  \"body\": \"Users are seeing a 500 error on the login page after the latest deploy.\",\n  \"reporter_email\": \"customer@example.com\",\n  \"urgency_id\": 2,\n  \"category_id\": 3,\n  \"tag_ids\": [1]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tickets",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets"]
						},
						"description": "Creates a new ticket. The ticket is automatically assigned the \"Open\" status and SLA tracking begins immediately.\n\nRequired fields: subject, body.\nOptional fields: reporter_email, assignee_id, category_id, product_id, urgency_id, tag_ids."
					},
					"response": [
						{
							"name": "201 Created",
							"status": "Created",
							"code": 201,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 43,\n  \"subject\": \"Login page returns 500 error\",\n  \"body\": \"Users are seeing a 500 error on the login page after the latest deploy.\",\n  \"status\": { \"id\": 1, \"key\": \"open\", \"label\": \"Open\" },\n  \"urgency\": { \"id\": 2, \"name\": \"High\" },\n  \"assignee\": null,\n  \"reporter\": { \"id\": 12, \"name\": \"Customer\" },\n  \"category\": { \"id\": 3, \"name\": \"Bug\" },\n  \"tags\": [{ \"id\": 1, \"name\": \"safari\", \"color\": \"#3b82f6\" }],\n  \"sla_deadline\": \"2026-04-06T14:00:00+00:00\",\n  \"created_at\": \"2026-04-06T10:00:00+00:00\",\n  \"updated_at\": \"2026-04-06T10:00:00+00:00\"\n}"
						}
					]
				},
				{
					"name": "Update ticket",
					"request": {
						"method": "PUT",
						"header": [
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"urgency_id\": 1,\n  \"category_id\": 3\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42"]
						},
						"description": "Updates one or more fields on an existing ticket. Only the fields you include in the request body are changed.\n\nOptional fields: subject, body, status_id, category_id, product_id, urgency_id, assignee_id, tag_ids."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 42,\n  \"subject\": \"Cannot export PDF on Safari\",\n  \"urgency\": { \"id\": 1, \"name\": \"Critical\" },\n  \"category\": { \"id\": 3, \"name\": \"Bug\" },\n  \"updated_at\": \"2026-04-06T13:00:00+00:00\"\n}"
						}
					]
				},
				{
					"name": "Close ticket",
					"request": {
						"method": "POST",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42/close",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42", "close"]
						},
						"description": "Sets the ticket status to \"Closed\"."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 42,\n  \"status\": { \"id\": 5, \"key\": \"closed\", \"label\": \"Closed\" },\n  \"updated_at\": \"2026-04-06T13:30:00+00:00\"\n}"
						}
					]
				},
				{
					"name": "Assign ticket",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"assignee_id\": 7\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42/assign",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42", "assign"]
						},
						"description": "Assigns or unassigns a ticket. Pass assignee_id as a user ID, or null to unassign."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 42,\n  \"assignee\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n  \"updated_at\": \"2026-04-06T13:45:00+00:00\"\n}"
						}
					]
				},
				{
					"name": "Escalate ticket",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"target_user_id\": 3\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42/escalate",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42", "escalate"]
						},
						"description": "Escalates the ticket to a target user who has escalation permission. The escalation is recorded in the ticket's escalation history."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 42,\n  \"assignee\": { \"id\": 3, \"name\": \"Alex Morgan\" },\n  \"escalation_history\": [\n    {\n      \"from\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n      \"to\": { \"id\": 3, \"name\": \"Alex Morgan\" },\n      \"escalated_at\": \"2026-04-06T14:00:00+00:00\"\n    }\n  ],\n  \"updated_at\": \"2026-04-06T14:00:00+00:00\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "Messages",
			"item": [
				{
					"name": "List messages",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42/messages",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42", "messages"]
						},
						"description": "Returns all messages on a ticket, ordered chronologically."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"total\": 2,\n  \"messages\": [\n    {\n      \"id\": 101,\n      \"body\": \"I've reproduced this on Safari 17.4.\",\n      \"internal\": false,\n      \"author\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n      \"created_at\": \"2026-04-06T11:00:00+00:00\"\n    },\n    {\n      \"id\": 102,\n      \"body\": \"Escalating to the frontend team.\",\n      \"internal\": true,\n      \"author\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n      \"created_at\": \"2026-04-06T11:30:00+00:00\"\n    }\n  ]\n}"
						}
					]
				},
				{
					"name": "Create message",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"body\": \"We have identified the issue and a fix is being deployed now.\",\n  \"internal\": false\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tickets/42/messages",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tickets", "42", "messages"]
						},
						"description": "Adds a message (reply or internal note) to a ticket.\n\nRequired: body.\nOptional: internal (boolean, defaults to false)."
					},
					"response": [
						{
							"name": "201 Created",
							"status": "Created",
							"code": 201,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 103,\n  \"body\": \"We have identified the issue and a fix is being deployed now.\",\n  \"internal\": false,\n  \"author\": { \"id\": 7, \"name\": \"Jordan Lee\" },\n  \"created_at\": \"2026-04-06T14:30:00+00:00\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "Lookups",
			"item": [
				{
					"name": "List statuses",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/statuses",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "statuses"]
						},
						"description": "Returns all ticket statuses sorted by display order."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 1, \"key\": \"open\", \"label\": \"Open\", \"sort_order\": 0, \"pauses_sla\": false, \"is_locked\": true },\n  { \"id\": 2, \"key\": \"in_progress\", \"label\": \"In Progress\", \"sort_order\": 1, \"pauses_sla\": false, \"is_locked\": false },\n  { \"id\": 3, \"key\": \"on_hold\", \"label\": \"On Hold\", \"sort_order\": 2, \"pauses_sla\": true, \"is_locked\": false },\n  { \"id\": 4, \"key\": \"with_client\", \"label\": \"With Client\", \"sort_order\": 3, \"pauses_sla\": true, \"is_locked\": false },\n  { \"id\": 5, \"key\": \"closed\", \"label\": \"Closed\", \"sort_order\": 4, \"pauses_sla\": false, \"is_locked\": true }\n]"
						}
					]
				},
				{
					"name": "List categories",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/categories",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "categories"]
						},
						"description": "Returns all ticket categories sorted by display order."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 1, \"name\": \"General\", \"slug\": \"general\", \"sort_order\": 0, \"parent_id\": null },\n  { \"id\": 2, \"name\": \"Billing\", \"slug\": \"billing\", \"sort_order\": 1, \"parent_id\": null },\n  { \"id\": 3, \"name\": \"Bug\", \"slug\": \"bug\", \"sort_order\": 2, \"parent_id\": null }\n]"
						}
					]
				},
				{
					"name": "List urgencies",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/urgencies",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "urgencies"]
						},
						"description": "Returns urgency levels with their SLA first-response windows."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 1, \"name\": \"Critical\", \"slug\": \"critical\", \"sort_order\": 0, \"first_response_minutes\": 60 },\n  { \"id\": 2, \"name\": \"High\", \"slug\": \"high\", \"sort_order\": 1, \"first_response_minutes\": 240 },\n  { \"id\": 3, \"name\": \"Medium\", \"slug\": \"medium\", \"sort_order\": 2, \"first_response_minutes\": 480 },\n  { \"id\": 4, \"name\": \"Low\", \"slug\": \"low\", \"sort_order\": 3, \"first_response_minutes\": 1440 }\n]"
						}
					]
				},
				{
					"name": "List tags",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/tags",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tags"]
						},
						"description": "Returns all tags available in your organization."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 1, \"name\": \"safari\", \"color\": \"#3b82f6\" },\n  { \"id\": 2, \"name\": \"regression\", \"color\": \"#ef4444\" },\n  { \"id\": 3, \"name\": \"feature-request\", \"color\": \"#10b981\" }\n]"
						}
					]
				},
				{
					"name": "List products",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/products",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "products"]
						},
						"description": "Returns all products sorted by display order."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 1, \"name\": \"Web App\", \"slug\": \"web-app\", \"sort_order\": 0 },\n  { \"id\": 2, \"name\": \"Mobile App\", \"slug\": \"mobile-app\", \"sort_order\": 1 }\n]"
						}
					]
				}
			]
		},
		{
			"name": "Users",
			"item": [
				{
					"name": "List users",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/users",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "users"]
						},
						"description": "Returns all active users (agents, managers, admins) in your organization."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 3, \"email\": \"alex@example.com\", \"first_name\": \"Alex\", \"last_name\": \"Morgan\", \"name\": \"Alex Morgan\" },\n  { \"id\": 7, \"email\": \"jordan@example.com\", \"first_name\": \"Jordan\", \"last_name\": \"Lee\", \"name\": \"Jordan Lee\" }\n]"
						}
					]
				},
				{
					"name": "Get user",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/users/7",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "users", "7"]
						},
						"description": "Returns details for a single user."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 7,\n  \"email\": \"jordan@example.com\",\n  \"first_name\": \"Jordan\",\n  \"last_name\": \"Lee\",\n  \"name\": \"Jordan Lee\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "End Users",
			"item": [
				{
					"name": "List end users",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/end-users",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "end-users"]
						},
						"description": "Returns all end users in your organization."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "[\n  { \"id\": 12, \"email\": \"sam@customer.com\", \"first_name\": \"Sam\", \"last_name\": \"Kim\", \"name\": \"Sam Kim\", \"status\": \"active\" },\n  { \"id\": 15, \"email\": \"pat@customer.com\", \"first_name\": \"Pat\", \"last_name\": \"Chen\", \"name\": \"Pat Chen\", \"status\": \"active\" }\n]"
						}
					]
				},
				{
					"name": "Create end user",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"email\": \"new.customer@example.com\",\n  \"first_name\": \"Taylor\",\n  \"last_name\": \"Brooks\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/end-users",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "end-users"]
						},
						"description": "Creates a new end-user account and adds them to your organization.\n\nRequired fields: email, first_name, last_name."
					},
					"response": [
						{
							"name": "201 Created",
							"status": "Created",
							"code": 201,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"id\": 20,\n  \"email\": \"new.customer@example.com\",\n  \"first_name\": \"Taylor\",\n  \"last_name\": \"Brooks\",\n  \"name\": \"Taylor Brooks\",\n  \"status\": \"active\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "Statistics",
			"item": [
				{
					"name": "Dashboard stats",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/stats/dashboard",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "stats", "dashboard"]
						},
						"description": "Returns real-time dashboard counters: open tickets, your open tickets, unassigned, overdue, at-risk, and closed today."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"open\": 12,\n  \"my_open\": 3,\n  \"unassigned\": 2,\n  \"overdue\": 1,\n  \"at_risk\": 2,\n  \"closed_today\": 7\n}"
						}
					]
				},
				{
					"name": "Reporting stats",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/api/v1/stats/reporting",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "stats", "reporting"]
						},
						"description": "Returns reporting analytics: tickets by status, average first response time, SLA compliance percentage, tickets by agent, and volume by day."
					},
					"response": [
						{
							"name": "200 OK",
							"status": "OK",
							"code": 200,
							"header": [{ "key": "Content-Type", "value": "application/json" }],
							"body": "{\n  \"by_status\": [\n    { \"status\": \"Open\", \"count\": 12 },\n    { \"status\": \"In Progress\", \"count\": 8 },\n    { \"status\": \"Closed\", \"count\": 45 }\n  ],\n  \"avg_first_response_minutes\": 42,\n  \"sla_compliance_pct\": 94.5,\n  \"by_agent\": [\n    { \"agent\": \"Jordan Lee\", \"open\": 3, \"closed\": 15 },\n    { \"agent\": \"Alex Morgan\", \"open\": 5, \"closed\": 12 }\n  ],\n  \"volume_by_day\": [\n    { \"date\": \"2026-04-01\", \"created\": 8, \"closed\": 6 },\n    { \"date\": \"2026-04-02\", \"created\": 5, \"closed\": 7 }\n  ]\n}"
						}
					]
				}
			]
		}
	]
}
