> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.simplified.com/api-reference/notifications/send-agent-notification/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.simplified.com/_mcp/server. # API · Notify · Send a notification from an AI agent to a user POST https://api.simplified.com/api/v1/service/agent/notify Content-Type: application/json Sends a single notification. It is routed through the notification registry, which determines delivery channels (in-app, websocket, email, Slack) based on the category. Reference: https://docs.simplified.com/api-reference/notifications/send-agent-notification ## Authentication - `Authorization` header (required) (prefixed with ` Api-Key `) — Header authentication of the form `Api-Key ` - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Body (application/json) This endpoint expects an AgentNotification. - `userId` (string, required) — ID of the user to notify - `workspaceId` (string, required) — ID of the workspace - `title` (string, required) — Short headline (sentence case). Becomes the email subject and the heading shown at the top of the email and in-app notification. Do NOT repeat the title inside `message` or `body`. - `message` (string, required) — One- or two-line summary for the in-app card, push and websocket. Keep it short and scannable. Used as the email/Slack body when `body` is omitted. - `category` (enum, required) — Determines delivery channels: - `agentTaskCompleted` — in-app + websocket + email - `agentNeedsInput` — in-app + websocket + email - `agentError` — in-app + websocket + Slack (#agent-alerts) - `agentProgress` — websocket only - `agentNudge` — in-app + websocket + email - Allowed values: `agentTaskCompleted`, `agentNeedsInput`, `agentError`, `agentProgress`, `agentNudge` - `threadId` (string, optional) — Optional. ID of the agent conversation/thread this notification originated from. Used to build a deep link back to the conversation (e.g. the email CTA) when `link` is not supplied. Authoritative — injected from run config, never model-supplied. - `body` (string, optional) — Optional long-form content in Markdown, written as a complete email: open with a greeting (e.g. "Hi Sarah,"), give the summary or report, and close with a brief sign-off. Rendered as the email body AND the Slack message. Use this (not `message`) when you have a detailed write-up. Do NOT restate the title. Falls back to `message` when omitted. - `ctaLabel` (string, optional) — Optional label for the email/Slack action button. Defaults to "Continue the conversation" when a thread exists, else "View details". - `link` (string, optional) — Deep link to the relevant page in Simplified - `_extra` (AgentNotificationExtra, optional) — Arbitrary metadata stored in the notification's JSON field. Frontend uses `event_type` to render each card differently. ## Response ### 200 Notification(s) sent successfully - `status` (string, optional) ## Errors ### 400 Bad Request Error Validation error - `any` ### 401 Unauthorized Error Missing or invalid API key - `any` ### 403 Forbidden Error API key does not have permission - `any` ## Types ### AgentNotificationExtra Arbitrary metadata stored in the notification's JSON field. Frontend uses `event_type` to render each card differently. - `event_type` (string, optional) — Machine-readable event type - `agent` (string, optional) — Name of the agent sending the notification - `task_id` (string, optional) — ID of the task this notification relates to ## Examples ### Task completed **Request** ```json { "userId": "12345", "workspaceId": "67890", "title": "Your brand kit is ready", "message": "I've finished generating the brand kit for Acme Corp.", "category": "agentTaskCompleted", "threadId": "thread_abc123", "body": "Hi Sarah,\n\nI've finished generating the **brand kit for Acme Corp**. Here's what's ready:\n\n- Color palette (primary, secondary, accents)\n- Font pairings for headings and body\n- Logo variants (full, mark, monochrome)\n\nOpen the conversation to review anything or ask me to tweak it.\n\n— Riley", "ctaLabel": "Review brand kit", "_extra": { "event_type": "task_completed", "agent": "riley", "task_id": "task_xyz", "task_type": "brand_kit" } } ``` **Response** ```json { "status": "success" } ``` **SDK Code** ```python Task completed import requests url = "https://api.simplified.com/api/v1/service/agent/notify" payload = { "userId": "12345", "workspaceId": "67890", "title": "Your brand kit is ready", "message": "I've finished generating the brand kit for Acme Corp.", "category": "agentTaskCompleted", "threadId": "thread_abc123", "body": "Hi Sarah, I've finished generating the **brand kit for Acme Corp**. Here's what's ready: - Color palette (primary, secondary, accents) - Font pairings for headings and body - Logo variants (full, mark, monochrome) Open the conversation to review anything or ask me to tweak it. — Riley", "ctaLabel": "Review brand kit", "_extra": { "event_type": "task_completed", "agent": "riley", "task_id": "task_xyz", "task_type": "brand_kit" } } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Task completed const url = 'https://api.simplified.com/api/v1/service/agent/notify'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"userId":"12345","workspaceId":"67890","title":"Your brand kit is ready","message":"I\'ve finished generating the brand kit for Acme Corp.","category":"agentTaskCompleted","threadId":"thread_abc123","body":"Hi Sarah,\n\nI\'ve finished generating the **brand kit for Acme Corp**. Here\'s what\'s ready:\n\n- Color palette (primary, secondary, accents)\n- Font pairings for headings and body\n- Logo variants (full, mark, monochrome)\n\nOpen the conversation to review anything or ask me to tweak it.\n\n— Riley","ctaLabel":"Review brand kit","_extra":{"event_type":"task_completed","agent":"riley","task_id":"task_xyz","task_type":"brand_kit"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Task completed package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/service/agent/notify" payload := strings.NewReader("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your brand kit is ready\",\n \"message\": \"I've finished generating the brand kit for Acme Corp.\",\n \"category\": \"agentTaskCompleted\",\n \"threadId\": \"thread_abc123\",\n \"body\": \"Hi Sarah,\\n\\nI've finished generating the **brand kit for Acme Corp**. Here's what's ready:\\n\\n- Color palette (primary, secondary, accents)\\n- Font pairings for headings and body\\n- Logo variants (full, mark, monochrome)\\n\\nOpen the conversation to review anything or ask me to tweak it.\\n\\n— Riley\",\n \"ctaLabel\": \"Review brand kit\",\n \"_extra\": {\n \"event_type\": \"task_completed\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"task_type\": \"brand_kit\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Task completed require 'uri' require 'net/http' url = URI("https://api.simplified.com/api/v1/service/agent/notify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your brand kit is ready\",\n \"message\": \"I've finished generating the brand kit for Acme Corp.\",\n \"category\": \"agentTaskCompleted\",\n \"threadId\": \"thread_abc123\",\n \"body\": \"Hi Sarah,\\n\\nI've finished generating the **brand kit for Acme Corp**. Here's what's ready:\\n\\n- Color palette (primary, secondary, accents)\\n- Font pairings for headings and body\\n- Logo variants (full, mark, monochrome)\\n\\nOpen the conversation to review anything or ask me to tweak it.\\n\\n— Riley\",\n \"ctaLabel\": \"Review brand kit\",\n \"_extra\": {\n \"event_type\": \"task_completed\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"task_type\": \"brand_kit\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Task completed import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/service/agent/notify") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your brand kit is ready\",\n \"message\": \"I've finished generating the brand kit for Acme Corp.\",\n \"category\": \"agentTaskCompleted\",\n \"threadId\": \"thread_abc123\",\n \"body\": \"Hi Sarah,\\n\\nI've finished generating the **brand kit for Acme Corp**. Here's what's ready:\\n\\n- Color palette (primary, secondary, accents)\\n- Font pairings for headings and body\\n- Logo variants (full, mark, monochrome)\\n\\nOpen the conversation to review anything or ask me to tweak it.\\n\\n— Riley\",\n \"ctaLabel\": \"Review brand kit\",\n \"_extra\": {\n \"event_type\": \"task_completed\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"task_type\": \"brand_kit\"\n }\n}") .asString(); ``` ```php Task completed request('POST', 'https://api.simplified.com/api/v1/service/agent/notify', [ 'body' => '{ "userId": "12345", "workspaceId": "67890", "title": "Your brand kit is ready", "message": "I\'ve finished generating the brand kit for Acme Corp.", "category": "agentTaskCompleted", "threadId": "thread_abc123", "body": "Hi Sarah,\\n\\nI\'ve finished generating the **brand kit for Acme Corp**. Here\'s what\'s ready:\\n\\n- Color palette (primary, secondary, accents)\\n- Font pairings for headings and body\\n- Logo variants (full, mark, monochrome)\\n\\nOpen the conversation to review anything or ask me to tweak it.\\n\\n— Riley", "ctaLabel": "Review brand kit", "_extra": { "event_type": "task_completed", "agent": "riley", "task_id": "task_xyz", "task_type": "brand_kit" } }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Task completed using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/service/agent/notify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your brand kit is ready\",\n \"message\": \"I've finished generating the brand kit for Acme Corp.\",\n \"category\": \"agentTaskCompleted\",\n \"threadId\": \"thread_abc123\",\n \"body\": \"Hi Sarah,\\n\\nI've finished generating the **brand kit for Acme Corp**. Here's what's ready:\\n\\n- Color palette (primary, secondary, accents)\\n- Font pairings for headings and body\\n- Logo variants (full, mark, monochrome)\\n\\nOpen the conversation to review anything or ask me to tweak it.\\n\\n— Riley\",\n \"ctaLabel\": \"Review brand kit\",\n \"_extra\": {\n \"event_type\": \"task_completed\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"task_type\": \"brand_kit\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Task completed import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "userId": "12345", "workspaceId": "67890", "title": "Your brand kit is ready", "message": "I've finished generating the brand kit for Acme Corp.", "category": "agentTaskCompleted", "threadId": "thread_abc123", "body": "Hi Sarah, I've finished generating the **brand kit for Acme Corp**. Here's what's ready: - Color palette (primary, secondary, accents) - Font pairings for headings and body - Logo variants (full, mark, monochrome) Open the conversation to review anything or ask me to tweak it. — Riley", "ctaLabel": "Review brand kit", "_extra": [ "event_type": "task_completed", "agent": "riley", "task_id": "task_xyz", "task_type": "brand_kit" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/agent/notify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Agent needs user input **Request** ```json { "userId": "12345", "workspaceId": "67890", "title": "Which template should I use?", "message": "I found 3 templates that match your brand. Pick one so I can continue.", "category": "agentNeedsInput", "link": "https://app.simplified.com/tasks/abc/choose", "_extra": { "event_type": "needs_input", "agent": "riley", "task_id": "task_abc", "options": [ "Modern Clean", "Bold Impact", "Minimal Mono" ] } } ``` **Response** ```json { "status": "success" } ``` **SDK Code** ```python Agent needs user input import requests url = "https://api.simplified.com/api/v1/service/agent/notify" payload = { "userId": "12345", "workspaceId": "67890", "title": "Which template should I use?", "message": "I found 3 templates that match your brand. Pick one so I can continue.", "category": "agentNeedsInput", "link": "https://app.simplified.com/tasks/abc/choose", "_extra": { "event_type": "needs_input", "agent": "riley", "task_id": "task_abc", "options": ["Modern Clean", "Bold Impact", "Minimal Mono"] } } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Agent needs user input const url = 'https://api.simplified.com/api/v1/service/agent/notify'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"userId":"12345","workspaceId":"67890","title":"Which template should I use?","message":"I found 3 templates that match your brand. Pick one so I can continue.","category":"agentNeedsInput","link":"https://app.simplified.com/tasks/abc/choose","_extra":{"event_type":"needs_input","agent":"riley","task_id":"task_abc","options":["Modern Clean","Bold Impact","Minimal Mono"]}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Agent needs user input package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/service/agent/notify" payload := strings.NewReader("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Which template should I use?\",\n \"message\": \"I found 3 templates that match your brand. Pick one so I can continue.\",\n \"category\": \"agentNeedsInput\",\n \"link\": \"https://app.simplified.com/tasks/abc/choose\",\n \"_extra\": {\n \"event_type\": \"needs_input\",\n \"agent\": \"riley\",\n \"task_id\": \"task_abc\",\n \"options\": [\n \"Modern Clean\",\n \"Bold Impact\",\n \"Minimal Mono\"\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Agent needs user input require 'uri' require 'net/http' url = URI("https://api.simplified.com/api/v1/service/agent/notify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Which template should I use?\",\n \"message\": \"I found 3 templates that match your brand. Pick one so I can continue.\",\n \"category\": \"agentNeedsInput\",\n \"link\": \"https://app.simplified.com/tasks/abc/choose\",\n \"_extra\": {\n \"event_type\": \"needs_input\",\n \"agent\": \"riley\",\n \"task_id\": \"task_abc\",\n \"options\": [\n \"Modern Clean\",\n \"Bold Impact\",\n \"Minimal Mono\"\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java Agent needs user input import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/service/agent/notify") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Which template should I use?\",\n \"message\": \"I found 3 templates that match your brand. Pick one so I can continue.\",\n \"category\": \"agentNeedsInput\",\n \"link\": \"https://app.simplified.com/tasks/abc/choose\",\n \"_extra\": {\n \"event_type\": \"needs_input\",\n \"agent\": \"riley\",\n \"task_id\": \"task_abc\",\n \"options\": [\n \"Modern Clean\",\n \"Bold Impact\",\n \"Minimal Mono\"\n ]\n }\n}") .asString(); ``` ```php Agent needs user input request('POST', 'https://api.simplified.com/api/v1/service/agent/notify', [ 'body' => '{ "userId": "12345", "workspaceId": "67890", "title": "Which template should I use?", "message": "I found 3 templates that match your brand. Pick one so I can continue.", "category": "agentNeedsInput", "link": "https://app.simplified.com/tasks/abc/choose", "_extra": { "event_type": "needs_input", "agent": "riley", "task_id": "task_abc", "options": [ "Modern Clean", "Bold Impact", "Minimal Mono" ] } }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Agent needs user input using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/service/agent/notify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Which template should I use?\",\n \"message\": \"I found 3 templates that match your brand. Pick one so I can continue.\",\n \"category\": \"agentNeedsInput\",\n \"link\": \"https://app.simplified.com/tasks/abc/choose\",\n \"_extra\": {\n \"event_type\": \"needs_input\",\n \"agent\": \"riley\",\n \"task_id\": \"task_abc\",\n \"options\": [\n \"Modern Clean\",\n \"Bold Impact\",\n \"Minimal Mono\"\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Agent needs user input import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "userId": "12345", "workspaceId": "67890", "title": "Which template should I use?", "message": "I found 3 templates that match your brand. Pick one so I can continue.", "category": "agentNeedsInput", "link": "https://app.simplified.com/tasks/abc/choose", "_extra": [ "event_type": "needs_input", "agent": "riley", "task_id": "task_abc", "options": ["Modern Clean", "Bold Impact", "Minimal Mono"] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/agent/notify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Agent encountered an error **Request** ```json { "userId": "12345", "workspaceId": "67890", "title": "Could not access your S3 bucket", "message": "Permission denied when trying to upload the generated assets. Please check your storage settings.", "category": "agentError", "_extra": { "event_type": "error", "agent": "riley", "task_id": "task_xyz", "error_code": "s3_access_denied", "recoverable": true } } ``` **Response** ```json { "status": "success" } ``` **SDK Code** ```python Agent encountered an error import requests url = "https://api.simplified.com/api/v1/service/agent/notify" payload = { "userId": "12345", "workspaceId": "67890", "title": "Could not access your S3 bucket", "message": "Permission denied when trying to upload the generated assets. Please check your storage settings.", "category": "agentError", "_extra": { "event_type": "error", "agent": "riley", "task_id": "task_xyz", "error_code": "s3_access_denied", "recoverable": True } } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Agent encountered an error const url = 'https://api.simplified.com/api/v1/service/agent/notify'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"userId":"12345","workspaceId":"67890","title":"Could not access your S3 bucket","message":"Permission denied when trying to upload the generated assets. Please check your storage settings.","category":"agentError","_extra":{"event_type":"error","agent":"riley","task_id":"task_xyz","error_code":"s3_access_denied","recoverable":true}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Agent encountered an error package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/service/agent/notify" payload := strings.NewReader("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Could not access your S3 bucket\",\n \"message\": \"Permission denied when trying to upload the generated assets. Please check your storage settings.\",\n \"category\": \"agentError\",\n \"_extra\": {\n \"event_type\": \"error\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"error_code\": \"s3_access_denied\",\n \"recoverable\": true\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Agent encountered an error require 'uri' require 'net/http' url = URI("https://api.simplified.com/api/v1/service/agent/notify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Could not access your S3 bucket\",\n \"message\": \"Permission denied when trying to upload the generated assets. Please check your storage settings.\",\n \"category\": \"agentError\",\n \"_extra\": {\n \"event_type\": \"error\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"error_code\": \"s3_access_denied\",\n \"recoverable\": true\n }\n}" response = http.request(request) puts response.read_body ``` ```java Agent encountered an error import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/service/agent/notify") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Could not access your S3 bucket\",\n \"message\": \"Permission denied when trying to upload the generated assets. Please check your storage settings.\",\n \"category\": \"agentError\",\n \"_extra\": {\n \"event_type\": \"error\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"error_code\": \"s3_access_denied\",\n \"recoverable\": true\n }\n}") .asString(); ``` ```php Agent encountered an error request('POST', 'https://api.simplified.com/api/v1/service/agent/notify', [ 'body' => '{ "userId": "12345", "workspaceId": "67890", "title": "Could not access your S3 bucket", "message": "Permission denied when trying to upload the generated assets. Please check your storage settings.", "category": "agentError", "_extra": { "event_type": "error", "agent": "riley", "task_id": "task_xyz", "error_code": "s3_access_denied", "recoverable": true } }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Agent encountered an error using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/service/agent/notify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Could not access your S3 bucket\",\n \"message\": \"Permission denied when trying to upload the generated assets. Please check your storage settings.\",\n \"category\": \"agentError\",\n \"_extra\": {\n \"event_type\": \"error\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"error_code\": \"s3_access_denied\",\n \"recoverable\": true\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Agent encountered an error import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "userId": "12345", "workspaceId": "67890", "title": "Could not access your S3 bucket", "message": "Permission denied when trying to upload the generated assets. Please check your storage settings.", "category": "agentError", "_extra": [ "event_type": "error", "agent": "riley", "task_id": "task_xyz", "error_code": "s3_access_denied", "recoverable": true ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/agent/notify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Progress update **Request** ```json { "userId": "12345", "workspaceId": "67890", "title": "Rendering video", "message": "Processing step 3 of 5 — applying transitions", "category": "agentProgress", "_extra": { "event_type": "progress", "agent": "riley", "task_id": "task_xyz", "step": 3, "step_label": "Applying transitions", "total_steps": 5 } } ``` **Response** ```json { "status": "success" } ``` **SDK Code** ```python Progress update import requests url = "https://api.simplified.com/api/v1/service/agent/notify" payload = { "userId": "12345", "workspaceId": "67890", "title": "Rendering video", "message": "Processing step 3 of 5 — applying transitions", "category": "agentProgress", "_extra": { "event_type": "progress", "agent": "riley", "task_id": "task_xyz", "step": 3, "step_label": "Applying transitions", "total_steps": 5 } } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Progress update const url = 'https://api.simplified.com/api/v1/service/agent/notify'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"userId":"12345","workspaceId":"67890","title":"Rendering video","message":"Processing step 3 of 5 — applying transitions","category":"agentProgress","_extra":{"event_type":"progress","agent":"riley","task_id":"task_xyz","step":3,"step_label":"Applying transitions","total_steps":5}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Progress update package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/service/agent/notify" payload := strings.NewReader("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Rendering video\",\n \"message\": \"Processing step 3 of 5 — applying transitions\",\n \"category\": \"agentProgress\",\n \"_extra\": {\n \"event_type\": \"progress\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"step\": 3,\n \"step_label\": \"Applying transitions\",\n \"total_steps\": 5\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Progress update require 'uri' require 'net/http' url = URI("https://api.simplified.com/api/v1/service/agent/notify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Rendering video\",\n \"message\": \"Processing step 3 of 5 — applying transitions\",\n \"category\": \"agentProgress\",\n \"_extra\": {\n \"event_type\": \"progress\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"step\": 3,\n \"step_label\": \"Applying transitions\",\n \"total_steps\": 5\n }\n}" response = http.request(request) puts response.read_body ``` ```java Progress update import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/service/agent/notify") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Rendering video\",\n \"message\": \"Processing step 3 of 5 — applying transitions\",\n \"category\": \"agentProgress\",\n \"_extra\": {\n \"event_type\": \"progress\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"step\": 3,\n \"step_label\": \"Applying transitions\",\n \"total_steps\": 5\n }\n}") .asString(); ``` ```php Progress update request('POST', 'https://api.simplified.com/api/v1/service/agent/notify', [ 'body' => '{ "userId": "12345", "workspaceId": "67890", "title": "Rendering video", "message": "Processing step 3 of 5 — applying transitions", "category": "agentProgress", "_extra": { "event_type": "progress", "agent": "riley", "task_id": "task_xyz", "step": 3, "step_label": "Applying transitions", "total_steps": 5 } }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Progress update using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/service/agent/notify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Rendering video\",\n \"message\": \"Processing step 3 of 5 — applying transitions\",\n \"category\": \"agentProgress\",\n \"_extra\": {\n \"event_type\": \"progress\",\n \"agent\": \"riley\",\n \"task_id\": \"task_xyz\",\n \"step\": 3,\n \"step_label\": \"Applying transitions\",\n \"total_steps\": 5\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Progress update import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "userId": "12345", "workspaceId": "67890", "title": "Rendering video", "message": "Processing step 3 of 5 — applying transitions", "category": "agentProgress", "_extra": [ "event_type": "progress", "agent": "riley", "task_id": "task_xyz", "step": 3, "step_label": "Applying transitions", "total_steps": 5 ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/agent/notify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Proactive nudge **Request** ```json { "userId": "12345", "workspaceId": "67890", "title": "Your blog post hasn't been shared yet", "message": "The post \"5 Signs Your Q3 Plan Is Cooked\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?", "category": "agentNudge", "link": "https://app.simplified.com/scheduler/suggest/abc", "_extra": { "event_type": "nudge", "agent": "riley", "action_label": "Schedule it now", "context": "blog_post_idle_3_days", "suggestion": "Schedule blog post to LinkedIn and Twitter" } } ``` **Response** ```json { "status": "success" } ``` **SDK Code** ```python Proactive nudge import requests url = "https://api.simplified.com/api/v1/service/agent/notify" payload = { "userId": "12345", "workspaceId": "67890", "title": "Your blog post hasn't been shared yet", "message": "The post \"5 Signs Your Q3 Plan Is Cooked\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?", "category": "agentNudge", "link": "https://app.simplified.com/scheduler/suggest/abc", "_extra": { "event_type": "nudge", "agent": "riley", "action_label": "Schedule it now", "context": "blog_post_idle_3_days", "suggestion": "Schedule blog post to LinkedIn and Twitter" } } headers = { "Authorization": "Api-Key ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Proactive nudge const url = 'https://api.simplified.com/api/v1/service/agent/notify'; const options = { method: 'POST', headers: {Authorization: 'Api-Key ', 'Content-Type': 'application/json'}, body: '{"userId":"12345","workspaceId":"67890","title":"Your blog post hasn\'t been shared yet","message":"The post \"5 Signs Your Q3 Plan Is Cooked\" was published 3 days ago but hasn\'t been scheduled on any channel. Want me to schedule it?","category":"agentNudge","link":"https://app.simplified.com/scheduler/suggest/abc","_extra":{"event_type":"nudge","agent":"riley","action_label":"Schedule it now","context":"blog_post_idle_3_days","suggestion":"Schedule blog post to LinkedIn and Twitter"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Proactive nudge package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.simplified.com/api/v1/service/agent/notify" payload := strings.NewReader("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your blog post hasn't been shared yet\",\n \"message\": \"The post \\\"5 Signs Your Q3 Plan Is Cooked\\\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?\",\n \"category\": \"agentNudge\",\n \"link\": \"https://app.simplified.com/scheduler/suggest/abc\",\n \"_extra\": {\n \"event_type\": \"nudge\",\n \"agent\": \"riley\",\n \"action_label\": \"Schedule it now\",\n \"context\": \"blog_post_idle_3_days\",\n \"suggestion\": \"Schedule blog post to LinkedIn and Twitter\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Api-Key ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Proactive nudge require 'uri' require 'net/http' url = URI("https://api.simplified.com/api/v1/service/agent/notify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Api-Key ' request["Content-Type"] = 'application/json' request.body = "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your blog post hasn't been shared yet\",\n \"message\": \"The post \\\"5 Signs Your Q3 Plan Is Cooked\\\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?\",\n \"category\": \"agentNudge\",\n \"link\": \"https://app.simplified.com/scheduler/suggest/abc\",\n \"_extra\": {\n \"event_type\": \"nudge\",\n \"agent\": \"riley\",\n \"action_label\": \"Schedule it now\",\n \"context\": \"blog_post_idle_3_days\",\n \"suggestion\": \"Schedule blog post to LinkedIn and Twitter\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Proactive nudge import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.simplified.com/api/v1/service/agent/notify") .header("Authorization", "Api-Key ") .header("Content-Type", "application/json") .body("{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your blog post hasn't been shared yet\",\n \"message\": \"The post \\\"5 Signs Your Q3 Plan Is Cooked\\\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?\",\n \"category\": \"agentNudge\",\n \"link\": \"https://app.simplified.com/scheduler/suggest/abc\",\n \"_extra\": {\n \"event_type\": \"nudge\",\n \"agent\": \"riley\",\n \"action_label\": \"Schedule it now\",\n \"context\": \"blog_post_idle_3_days\",\n \"suggestion\": \"Schedule blog post to LinkedIn and Twitter\"\n }\n}") .asString(); ``` ```php Proactive nudge request('POST', 'https://api.simplified.com/api/v1/service/agent/notify', [ 'body' => '{ "userId": "12345", "workspaceId": "67890", "title": "Your blog post hasn\'t been shared yet", "message": "The post \\"5 Signs Your Q3 Plan Is Cooked\\" was published 3 days ago but hasn\'t been scheduled on any channel. Want me to schedule it?", "category": "agentNudge", "link": "https://app.simplified.com/scheduler/suggest/abc", "_extra": { "event_type": "nudge", "agent": "riley", "action_label": "Schedule it now", "context": "blog_post_idle_3_days", "suggestion": "Schedule blog post to LinkedIn and Twitter" } }', 'headers' => [ 'Authorization' => 'Api-Key ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Proactive nudge using RestSharp; var client = new RestClient("https://api.simplified.com/api/v1/service/agent/notify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Api-Key "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"userId\": \"12345\",\n \"workspaceId\": \"67890\",\n \"title\": \"Your blog post hasn't been shared yet\",\n \"message\": \"The post \\\"5 Signs Your Q3 Plan Is Cooked\\\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?\",\n \"category\": \"agentNudge\",\n \"link\": \"https://app.simplified.com/scheduler/suggest/abc\",\n \"_extra\": {\n \"event_type\": \"nudge\",\n \"agent\": \"riley\",\n \"action_label\": \"Schedule it now\",\n \"context\": \"blog_post_idle_3_days\",\n \"suggestion\": \"Schedule blog post to LinkedIn and Twitter\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Proactive nudge import Foundation let headers = [ "Authorization": "Api-Key ", "Content-Type": "application/json" ] let parameters = [ "userId": "12345", "workspaceId": "67890", "title": "Your blog post hasn't been shared yet", "message": "The post \"5 Signs Your Q3 Plan Is Cooked\" was published 3 days ago but hasn't been scheduled on any channel. Want me to schedule it?", "category": "agentNudge", "link": "https://app.simplified.com/scheduler/suggest/abc", "_extra": [ "event_type": "nudge", "agent": "riley", "action_label": "Schedule it now", "context": "blog_post_idle_3_days", "suggestion": "Schedule blog post to LinkedIn and Twitter" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.simplified.com/api/v1/service/agent/notify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```