{"info":{"_postman_id":"6877ba31-0c74-43cc-898f-495e31d0138b","name":"Task Manager API","description":"<html><head></head><body><p>The Task Manager API is a RESTful service that allows you to manage tasks through a simple HTTP interface. It provides endpoints for creating, reading, updating, and deleting tasks (CRUD operations). The API is built using Go and the Gin web framework.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"49835401","collectionId":"6877ba31-0c74-43cc-898f-495e31d0138b","publishedId":"2sB3WsNJk7","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-11-06T18:52:11.000Z"},"item":[{"name":"Get All Tasks","id":"e0a5e3b1-3a2c-47fb-b0a1-e036e1fba082","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicmVndWxhciIsInVzZXJuYW1lIjoiZ3VtYmFsbDA0In0.VAf7FDkaQ9rmh7L5O5kwfcR9u0n1C5kI5v1VZaXg5K8","type":"text"}],"url":"/tasks","description":"<p><strong>Summary:</strong>\nRetrieves a list of all tasks in the system.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /tasks\n</code></pre><p><strong>Required Headers:</strong></p>\n<ul>\n<li><code>Authorization: Bearer &lt;jwt-token&gt;</code> (required for authenticated endpoints)<ul>\n<li>Example: <code>Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...</code></li>\n</ul>\n</li>\n</ul>\n<p><strong>Request Body:</strong></p>\n<ul>\n<li>None</li>\n</ul>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><strong>200 OK</strong>: Returns an array of task objects.<ul>\n<li>Example:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n  {\n    \"id\": \"1\",\n    \"title\": \"Task Title\",\n    \"description\": \"Task details.\",\n    \"due_date\": \"2024-06-01T23:59:59Z\",\n    \"completed\": false\n  },\n  ...\n]\n</code></pre>\n</li>\n<li><strong>401 Unauthorized</strong>: Missing or invalid Authorization header.</li>\n<li><strong>500 Internal Server Error</strong>: Unexpected server error.</li>\n</ul>\n","urlObject":{"path":["tasks"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"f4d24b05-13f0-4fb3-b0f7-e7e2f91805c6","name":"Get All Tasks","originalRequest":{"method":"GET","header":[],"url":"localhost:8080/tasks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 06 Nov 2025 18:36:39 GMT"},{"key":"Content-Length","value":"377"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"2\",\n        \"title\": \"Task 2\",\n        \"description\": \"Second task\",\n        \"due_date\": \"2025-11-07T19:35:29.142634602+01:00\",\n        \"status\": \"In Progress\"\n    },\n    {\n        \"id\": \"3\",\n        \"title\": \"Task 3\",\n        \"description\": \"Third task\",\n        \"due_date\": \"2025-11-08T19:35:29.142721037+01:00\",\n        \"status\": \"Completed\"\n    },\n    {\n        \"id\": \"1\",\n        \"title\": \"Task 1\",\n        \"description\": \"First task\",\n        \"due_date\": \"2025-11-06T19:35:29.142631108+01:00\",\n        \"status\": \"Pending\"\n    }\n]"}],"_postman_id":"e0a5e3b1-3a2c-47fb-b0a1-e036e1fba082"},{"name":"Get Task","id":"54ab035c-890e-4c56-bbbd-ad62d13dda6f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicmVndWxhciIsInVzZXJuYW1lIjoiZ3VtYmFsbDA0In0.VAf7FDkaQ9rmh7L5O5kwfcR9u0n1C5kI5v1VZaXg5K8","type":"text"}],"url":"/tasks/1","description":"<p><strong>Summary:</strong>\nRetrieves a specific task by its unique ID.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /tasks/:id\n</code></pre><ul>\n<li>Replace <code>:id</code> with the ID of the task you want to retrieve.</li>\n</ul>\n<p><strong>Required Headers:</strong></p>\n<ul>\n<li><code>Authorization: Bearer &lt;jwt-token&gt;</code> (required for authenticated endpoints)<ul>\n<li>Example: <code>Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...</code></li>\n</ul>\n</li>\n</ul>\n<p><strong>Request Body:</strong></p>\n<ul>\n<li>None</li>\n</ul>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><strong>200 OK</strong>: Returns the task object.<ul>\n<li>Example:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": \"1\",\n  \"title\": \"Task Title\",\n  \"description\": \"Task details.\",\n  \"due_date\": \"2024-06-01T23:59:59Z\",\n  \"completed\": false\n}\n</code></pre>\n</li>\n<li><strong>401 Unauthorized</strong>: Missing or invalid Authorization header.</li>\n<li><strong>404 Not Found</strong>: Task with the specified ID does not exist.</li>\n<li><strong>500 Internal Server Error</strong>: Unexpected server error.</li>\n</ul>\n","urlObject":{"path":["tasks","1"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"bbfecf02-a074-420e-820c-af798ddcd3d3","name":"Get Task","originalRequest":{"method":"GET","header":[],"url":"localhost:8080/tasks/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 06 Nov 2025 18:35:47 GMT"},{"key":"Content-Length","value":"122"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"1\",\n    \"title\": \"Task 1\",\n    \"description\": \"First task\",\n    \"due_date\": \"2025-11-06T19:35:29.142631108+01:00\",\n    \"status\": \"Pending\"\n}"}],"_postman_id":"54ab035c-890e-4c56-bbbd-ad62d13dda6f"},{"name":"Update Task","id":"a63c1ebe-aab3-4557-93c6-139980a55c61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicmVndWxhciIsInVzZXJuYW1lIjoiZ3VtYmFsbDA0In0.VAf7FDkaQ9rmh7L5O5kwfcR9u0n1C5kI5v1VZaXg5K8","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"5\",\n    \"title\": \"Complete Task 5\",\n    \"description\": \"Complete Task Manager API and push work to github\"\n}","options":{"raw":{"language":"json"}}},"url":"/tasks/1","description":"<p><strong>Summary:</strong><br />Updates an existing task by its ID.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>PUT /tasks/:id\n\n</code></pre><ul>\n<li>Replace <code>:id</code> with the ID of the task you want to update.</li>\n</ul>\n<p><strong>Required Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type: application/json</code></p>\n</li>\n<li><p><code>Authorization: Bearer</code></p>\n<ul>\n<li>Example: <code>Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...</code></li>\n</ul>\n</li>\n</ul>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><p><strong>200 OK</strong>: Task updated successfully. Returns the updated task object.</p>\n</li>\n<li><p><strong>400 Bad Request</strong>: Invalid input (e.g., missing required fields, invalid data types).</p>\n</li>\n<li><p><strong>401 Unauthorized</strong>: Missing or invalid Authorization header.</p>\n</li>\n<li><p><strong>404 Not Found</strong>: Task with the specified ID does not exist.</p>\n</li>\n<li><p><strong>500 Internal Server Error</strong>: Unexpected server error.</p>\n</li>\n</ul>\n","urlObject":{"path":["tasks","1"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"dc6a060b-351a-4608-b22f-301ad3571925","name":"Update Task","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"id\": \"1\",\n    \"title\": \"Task 7\",\n    \"description\": \"Seventh task\",\n    \"due_date\": \"2025-11-06T19:35:29.142631108+01:00\",\n    \"status\": \"Finished\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/tasks/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 06 Nov 2025 18:36:06 GMT"},{"key":"Content-Length","value":"40"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Task Updated Successfully!\"\n}"}],"_postman_id":"a63c1ebe-aab3-4557-93c6-139980a55c61"},{"name":"Delete Task","id":"eb82130e-3904-4228-bcec-6e9ff923bbb9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicmVndWxhciIsInVzZXJuYW1lIjoiZ3VtYmFsbDA0In0.VAf7FDkaQ9rmh7L5O5kwfcR9u0n1C5kI5v1VZaXg5K8","type":"text"}],"url":"/tasks/1","description":"<p><strong>Summary:</strong>\nDeletes an existing task by its unique ID.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>DELETE /tasks/:id\n</code></pre><ul>\n<li>Replace <code>:id</code> with the ID of the task you wish to delete.</li>\n</ul>\n<p><strong>Required Headers:</strong></p>\n<ul>\n<li><code>Authorization: Bearer &lt;jwt-token&gt;</code> (required, admin only)<ul>\n<li>Example: <code>Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...</code></li>\n</ul>\n</li>\n</ul>\n<p><strong>Request Body:</strong></p>\n<ul>\n<li>None</li>\n</ul>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><strong>204 No Content</strong>: Task was successfully deleted.</li>\n<li><strong>401 Unauthorized</strong>: Missing or invalid authentication token.</li>\n<li><strong>403 Forbidden</strong>: Only administrators can delete tasks. Returned if the user does not have admin privileges.</li>\n<li><strong>404 Not Found</strong>: Task with the specified ID does not exist.</li>\n<li><strong>500 Internal Server Error</strong>: Unexpected server error.</li>\n</ul>\n<p><strong>Usage Notes:</strong></p>\n<ul>\n<li>This action is irreversible. Deleted tasks cannot be recovered.</li>\n</ul>\n","urlObject":{"path":["tasks","1"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"5456a458-5cb9-4211-8477-b2bc41a8b02a","name":"Delete Task","originalRequest":{"method":"DELETE","header":[],"url":"localhost:8080/tasks/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 06 Nov 2025 18:41:32 GMT"},{"key":"Content-Length","value":"42"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Task Deleteded Successfully!\"\n}"}],"_postman_id":"eb82130e-3904-4228-bcec-6e9ff923bbb9"},{"name":"Add Task","id":"d3344e98-dac0-41d7-8e91-f7fbbbb1831d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicmVndWxhciIsInVzZXJuYW1lIjoiZ3VtYmFsbDA0In0.VAf7FDkaQ9rmh7L5O5kwfcR9u0n1C5kI5v1VZaXg5K8","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"Id\": \"3\",\n    \"Title\": \"Complete Task 5\"\n}","options":{"raw":{"language":"json"}}},"url":"/tasks","description":"<p><strong>Summary:</strong>\nCreates a new task in the system.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /tasks\n</code></pre><p><strong>Required Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n<li><code>Authorization: Bearer &lt;jwt-token&gt;</code><ul>\n<li>Example: <code>Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...</code></li>\n</ul>\n</li>\n</ul>\n<p><strong>Request Body Schema:</strong>\nSend a JSON object with the following fields:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"title\": \"string\",        // (required) The title of the task\n  \"description\": \"string\",  // (optional) A detailed description of the task\n  \"due_date\": \"string\",     // (optional) Due date in ISO 8601 format (e.g., \"2024-06-01T23:59:59Z\")\n  \"completed\": \"boolean\"    // (optional) Whether the task is completed\n}\n</code></pre>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><strong>201 Created</strong>: Task created successfully. Returns the created task object.<ul>\n<li>Example:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": \"2\",\n  \"title\": \"New Task\",\n  \"description\": \"Description of the new task.\",\n  \"due_date\": \"2024-06-10T23:59:59Z\",\n  \"completed\": false\n}\n</code></pre>\n</li>\n<li><strong>400 Bad Request</strong>: Invalid input (e.g., missing required fields, invalid data types).</li>\n<li><strong>401 Unauthorized</strong>: Missing or invalid Authorization header.</li>\n<li><strong>500 Internal Server Error</strong>: Unexpected server error.</li>\n</ul>\n","urlObject":{"path":["tasks"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"945cf632-f7fc-4474-b68a-cb573834803e","name":"Add Task","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"id\": \"9\",\n    \"title\": \"nineth 1\",\n    \"description\": \"First task\",\n    \"due_date\": \"2025-11-06T19:35:29.142631108+01:00\",\n    \"status\": \"Finished\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/tasks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 06 Nov 2025 18:42:13 GMT"},{"key":"Content-Length","value":"37"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Task Added Successfully\"\n}"}],"_postman_id":"d3344e98-dac0-41d7-8e91-f7fbbbb1831d"},{"name":"Sign In","id":"128aa3ad-e7ab-4e90-a157-0a3c7dfdd280","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"gumball\",\r\n    \"password\": \"Angola1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/login","description":"<p><strong>Summary:</strong>\nAuthenticates a user and returns a JSON Web Token (JWT) for accessing protected resources in the Task Manager API.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /login\n</code></pre><p><strong>Required Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Request Body Schema:</strong>\nSend a JSON object with the following fields:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"username\": \"string\", // (required) The user's username\n  \"password\": \"string\"  // (required) The user's password\n}\n</code></pre>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><strong>200 OK</strong>: Returns a JSON object containing a <code>token</code> field with the JWT.<ul>\n<li>Example:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"token\": \"&lt;jwt-token&gt;\"\n}\n</code></pre>\n</li>\n<li><strong>400 Bad Request</strong>: Invalid credentials or missing fields.</li>\n<li><strong>500 Internal Server Error</strong>: Unexpected server error.</li>\n</ul>\n<p><strong>Usage Notes:</strong>\nUse the returned token for authenticated requests by including it in the <code>Authorization</code> header as a Bearer token.</p>\n","urlObject":{"path":["login"],"host":[""],"query":[],"variable":[]}},"response":[],"_postman_id":"128aa3ad-e7ab-4e90-a157-0a3c7dfdd280"},{"name":"Sign Up","id":"c9f5c931-0d46-4b2f-89b6-37c83b0e2682","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"gumball\",\r\n    \"password\": \"Angola1234\"\r\n}"},"url":"/register","description":"<p><strong>Summary:</strong>\nRegisters a new user account.</p>\n<p><strong>HTTP Method &amp; URL:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /register\n</code></pre><p><strong>Required Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Request Body Schema:</strong>\nSend a JSON object with the following fields:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"username\": \"string\", // (required) The desired username for the new account\n  \"password\": \"string\"  // (required) The password for the new account\n}\n</code></pre>\n<p><strong>Possible Responses:</strong></p>\n<ul>\n<li><strong>201 Created</strong>: User registered successfully.</li>\n<li><strong>400 Bad Request</strong>: Username already exists or missing required fields.</li>\n<li><strong>500 Internal Server Error</strong>: Unexpected server error.</li>\n</ul>\n","urlObject":{"path":["register"],"host":[""],"query":[],"variable":[]}},"response":[],"_postman_id":"c9f5c931-0d46-4b2f-89b6-37c83b0e2682"}],"event":[{"listen":"prerequest","script":{"id":"706e9770-1d2f-4cac-8981-ec25681fc40a","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"724a920b-0342-49cd-aba7-66837de25f55","type":"text/javascript","packages":{},"exec":[""]}}],"variable":[{"key":"baseURL","value":"","type":"default"},{"key":"authHeader","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoicmVndWxhciIsInVzZXJuYW1lIjoiZ3VtYmFsbDA0In0.VAf7FDkaQ9rmh7L5O5kwfcR9u0n1C5kI5v1VZaXg5K8"}]}