{"openapi":"3.0.3","info":{"title":"Reloop API","version":"1.0.0","description":"Open-source email infrastructure: send email, manage domains, contacts, templates, webhooks, automations and agent inboxes. Every error is JSON matching the `Error` schema, with a stable `code`. List endpoints support cursor pagination: pass `nextCursor` back as `cursor` until `hasMore` is false (https://reloop.sh/docs/api/pagination). The API is versioned in the URL (`/v1`); breaking changes ship as a new version, and deprecated endpoints send `Deprecation` and `Sunset` headers at least 180 days before removal. Policy: https://reloop.sh/docs/api/versioning","contact":{"name":"Reloop Labs","url":"https://reloop.sh/contact"},"license":{"name":"Reloop License","url":"https://reloop.sh/license"}},"externalDocs":{"description":"Reloop docs","url":"https://reloop.sh/docs/api"},"x-api-lifecycle":{"versioning":"url","currentVersion":"v1","deprecationPolicy":"https://reloop.sh/docs/api/versioning","minimumSunsetNoticeDays":180},"servers":[{"url":"https://reloop.sh","description":"Reloop Cloud"}],"security":[{"apiKey":[]},{"bearer":[]}],"tags":[],"paths":{"/api/mail/v1/send":{"post":{"summary":"Send email","description":"Send an email through the KumoMTA mail server","tags":["Mail"],"x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { response, emailError } = await reloop.mail.send({\n  from: \"Reloop <hello@send.example.com>\",\n  to: \"user@example.com\",\n  subject: \"Welcome to Reloop\",\n  html: \"<p>Thanks for signing up.</p>\",\n  text: \"Thanks for signing up.\",\n  reply_to: \"support@example.com\",\n  tags: [{ name: \"campaign\", value: \"welcome\" }],\n});\nif (emailError) throw emailError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/mail/v1/send \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"from\":\"Reloop <hello@send.example.com>\",\"to\":\"user@example.com\",\"subject\":\"Welcome to Reloop\",\"html\":\"<p>Thanks for signing up.</p>\",\"text\":\"Thanks for signing up.\",\"reply_to\":\"support@example.com\",\"tags\":[{\"name\":\"campaign\",\"value\":\"welcome\"}]}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.mail.send({\n  \"from\": \"Reloop <hello@send.example.com>\",\n  \"to\": \"user@example.com\",\n  \"subject\": \"Welcome to Reloop\",\n  \"html\": \"<p>Thanks for signing up.</p>\",\n  \"text\": \"Thanks for signing up.\",\n  \"reply_to\": \"support@example.com\",\n  \"tags\": [\n    {\n      \"name\": \"campaign\",\n      \"value\": \"welcome\",\n    },\n  ],\n})\nif result.email_error:\n    raise result.email_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$response = $reloop->mail->send([\n    'from' => 'Reloop <hello@send.example.com>',\n    'to' => 'user@example.com',\n    'subject' => 'Welcome to Reloop',\n    'html' => '<p>Thanks for signing up.</p>',\n    'text' => 'Thanks for signing up.',\n    'reply_to' => 'support@example.com',\n    'tags' => [\n        [\n            'name' => 'campaign',\n            'value' => 'welcome',\n        ],\n    ],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nSendMailParams params = new SendMailParams();\nparams.from = \"Reloop <hello@send.example.com>\";\nparams.to = \"user@example.com\";\nparams.subject = \"Welcome to Reloop\";\nparams.html = \"<p>Thanks for signing up.</p>\";\nparams.text = \"Thanks for signing up.\";\nparams.replyTo = \"support@example.com\";\nparams.tags = List.of(new SendMailTag(\"campaign\", \"welcome\"));\nvar response = reloop.mail.send(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar result = await reloop.Mail.SendAsync(new Dictionary<string, object?>\n{\n    [\"from\"] = \"Reloop <hello@send.example.com>\",\n    [\"to\"] = \"user@example.com\",\n    [\"subject\"] = \"Welcome to Reloop\",\n    [\"html\"] = \"<p>Thanks for signing up.</p>\",\n    [\"text\"] = \"Thanks for signing up.\",\n    [\"reply_to\"] = \"support@example.com\",\n    [\"tags\"] = new object[] { new { name = \"campaign\", value = \"welcome\" } },\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go/v2\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nresult, _ := client.Mail.Send(reloop.SendMailParams{\n    From:    \"Reloop <hello@send.example.com>\",\n    To:      \"user@example.com\",\n    Subject: \"Welcome to Reloop\",\n    HTML:    reloop.String(\"<p>Thanks for signing up.</p>\"),\n    Text:    reloop.String(\"Thanks for signing up.\"),\n    ReplyTo: \"support@example.com\",\n    Tags: []reloop.SendMailTag{\n        {Name: \"campaign\", Value: \"welcome\"},\n    },\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\nuse serde_json::json;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.mail().send(json!({\n        \"from\": \"Reloop <hello@send.example.com>\",\n        \"to\": \"user@example.com\",\n        \"subject\": \"Welcome to Reloop\",\n        \"html\": \"<p>Thanks for signing up.</p>\",\n        \"text\": \"Thanks for signing up.\",\n        \"reply_to\": \"support@example.com\",\n        \"tags\": [{\"name\": \"campaign\", \"value\": \"welcome\"}],\n    })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nresult = reloop.mail.send(\n  from: \"Reloop <hello@send.example.com>\",\n  to: \"user@example.com\",\n  subject: \"Welcome to Reloop\",\n  html: \"<p>Thanks for signing up.</p>\",\n  text: \"Thanks for signing up.\",\n  reply_to: \"support@example.com\",\n  tags: [{ name: \"campaign\", value: \"welcome\" }],\n)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Mail.send(client, %{\n  from: \"Reloop <hello@send.example.com>\",\n  to: \"user@example.com\",\n  subject: \"Welcome to Reloop\",\n  html: \"<p>Thanks for signing up.</p>\",\n  text: \"Thanks for signing up.\",\n  reply_to: \"support@example.com\",\n  tags: [%{name: \"campaign\", value: \"welcome\"}]\n})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to","subject"],"properties":{"from":{"pattern":"^(?:.*<[^\\s@]+@[^\\s@]+\\.[^\\s@]+>|[^\\s@]+@[^\\s@]+\\.[^\\s@]+)$","description":"Sender email address","examples":["user@example.com","Your Name <user@example.com>"],"type":"string"},"to":{"description":"Recipient email address(es) (max 50)","examples":["recipient@example.com",["user1@example.com","user2@example.com"]],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"subject":{"minLength":1,"maxLength":255,"description":"Email subject","examples":["Test Email"],"type":"string"},"cc":{"description":"CC email address(es) (max 50)","examples":["cc@example.com"],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC email address(es) (max 50)","examples":["bcc@example.com"],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"text":{"description":"Plain text content","examples":["This is a test email"],"type":"string"},"html":{"description":"HTML content","examples":["<h1>Test Email</h1><p>This is a test email</p>","If not provided, the HTML will be used to generate a plain text version. You can opt out of this behavior by setting value to an empty string."],"type":"string"},"reply_to":{"description":"Reply-to email address","examples":["noreply@example.com"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"scheduled_at":{"format":"date-time","description":"Schedule email to be sent later (ISO 8601)","examples":["2026-08-05T11:52:01.858Z"],"type":"string"},"headers":{"description":"Custom headers to add to the email","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"channel_id":{"description":"The channel ID to receive the email","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{}]},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"tags":{"description":"Custom tags passed in key/value pairs","type":"array","items":{"type":"object","required":["name","value"],"properties":{"name":{"pattern":"^[a-zA-Z0-9_-]+$","maxLength":256,"description":"The name of the email tag.","error":"The name of the email tag. It can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). It can contain no more than 256 characters.","type":"string"},"value":{"pattern":"^[a-zA-Z0-9_-]+$","maxLength":256,"description":"The value of the email tag.","error":"The value of the email tag. It can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). It can contain no more than 256 characters.","type":"string"}}}},"template":{"description":"Email template to use, by id or slug","type":"object","properties":{"id":{"description":"Template ID","type":"string"},"slug":{"maxLength":128,"description":"Template slug, e.g. welcome-email. Use instead of id.","type":"string"},"variables":{"description":"Variables to replace in the template","type":"object","patternProperties":{"^(?!FIRST_NAME$|LAST_NAME$|EMAIL$|UNSUBSCRIBE_URL$)[a-zA-Z0-9_]{1,50}$":{"description":"The value of the variable.","error":"Variable value must be a string (max 2,000 characters) or a number (not greater than 2^53 - 1).","anyOf":[{"maxLength":2000,"description":"The value of the variable (string).","type":"string"},{"maximum":9007199254740991,"description":"The value of the variable (number).","type":"number"}]}}}}},"thread_id":{"description":"Thread ID to link this email to an existing conversation thread","examples":["thr_abc123xyz"],"type":"string"},"idempotency_key":{"maxLength":500,"description":"Client idempotency key — retries with the same key return the original send without duplicate delivery. Header Idempotency-Key takes precedence.","examples":["order-123-confirmation"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["from","to","subject"],"properties":{"from":{"pattern":"^(?:.*<[^\\s@]+@[^\\s@]+\\.[^\\s@]+>|[^\\s@]+@[^\\s@]+\\.[^\\s@]+)$","description":"Sender email address","examples":["user@example.com","Your Name <user@example.com>"],"type":"string"},"to":{"description":"Recipient email address(es) (max 50)","examples":["recipient@example.com",["user1@example.com","user2@example.com"]],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"subject":{"minLength":1,"maxLength":255,"description":"Email subject","examples":["Test Email"],"type":"string"},"cc":{"description":"CC email address(es) (max 50)","examples":["cc@example.com"],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC email address(es) (max 50)","examples":["bcc@example.com"],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"text":{"description":"Plain text content","examples":["This is a test email"],"type":"string"},"html":{"description":"HTML content","examples":["<h1>Test Email</h1><p>This is a test email</p>","If not provided, the HTML will be used to generate a plain text version. You can opt out of this behavior by setting value to an empty string."],"type":"string"},"reply_to":{"description":"Reply-to email address","examples":["noreply@example.com"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"scheduled_at":{"format":"date-time","description":"Schedule email to be sent later (ISO 8601)","examples":["2026-08-05T11:52:01.858Z"],"type":"string"},"headers":{"description":"Custom headers to add to the email","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"channel_id":{"description":"The channel ID to receive the email","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{}]},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"tags":{"description":"Custom tags passed in key/value pairs","type":"array","items":{"type":"object","required":["name","value"],"properties":{"name":{"pattern":"^[a-zA-Z0-9_-]+$","maxLength":256,"description":"The name of the email tag.","error":"The name of the email tag. It can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). It can contain no more than 256 characters.","type":"string"},"value":{"pattern":"^[a-zA-Z0-9_-]+$","maxLength":256,"description":"The value of the email tag.","error":"The value of the email tag. It can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). It can contain no more than 256 characters.","type":"string"}}}},"template":{"description":"Email template to use, by id or slug","type":"object","properties":{"id":{"description":"Template ID","type":"string"},"slug":{"maxLength":128,"description":"Template slug, e.g. welcome-email. Use instead of id.","type":"string"},"variables":{"description":"Variables to replace in the template","type":"object","patternProperties":{"^(?!FIRST_NAME$|LAST_NAME$|EMAIL$|UNSUBSCRIBE_URL$)[a-zA-Z0-9_]{1,50}$":{"description":"The value of the variable.","error":"Variable value must be a string (max 2,000 characters) or a number (not greater than 2^53 - 1).","anyOf":[{"maxLength":2000,"description":"The value of the variable (string).","type":"string"},{"maximum":9007199254740991,"description":"The value of the variable (number).","type":"number"}]}}}}},"thread_id":{"description":"Thread ID to link this email to an existing conversation thread","examples":["thr_abc123xyz"],"type":"string"},"idempotency_key":{"maxLength":500,"description":"Client idempotency key — retries with the same key return the original send without duplicate delivery. Header Idempotency-Key takes precedence.","examples":["order-123-confirmation"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["from","to","subject"],"properties":{"from":{"pattern":"^(?:.*<[^\\s@]+@[^\\s@]+\\.[^\\s@]+>|[^\\s@]+@[^\\s@]+\\.[^\\s@]+)$","description":"Sender email address","examples":["user@example.com","Your Name <user@example.com>"],"type":"string"},"to":{"description":"Recipient email address(es) (max 50)","examples":["recipient@example.com",["user1@example.com","user2@example.com"]],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"subject":{"minLength":1,"maxLength":255,"description":"Email subject","examples":["Test Email"],"type":"string"},"cc":{"description":"CC email address(es) (max 50)","examples":["cc@example.com"],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC email address(es) (max 50)","examples":["bcc@example.com"],"anyOf":[{"type":"string"},{"maxItems":50,"type":"array","items":{"type":"string"}}]},"text":{"description":"Plain text content","examples":["This is a test email"],"type":"string"},"html":{"description":"HTML content","examples":["<h1>Test Email</h1><p>This is a test email</p>","If not provided, the HTML will be used to generate a plain text version. You can opt out of this behavior by setting value to an empty string."],"type":"string"},"reply_to":{"description":"Reply-to email address","examples":["noreply@example.com"],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"scheduled_at":{"format":"date-time","description":"Schedule email to be sent later (ISO 8601)","examples":["2026-08-05T11:52:01.858Z"],"type":"string"},"headers":{"description":"Custom headers to add to the email","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"channel_id":{"description":"The channel ID to receive the email","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"anyOf":[{"type":"string"},{}]},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"tags":{"description":"Custom tags passed in key/value pairs","type":"array","items":{"type":"object","required":["name","value"],"properties":{"name":{"pattern":"^[a-zA-Z0-9_-]+$","maxLength":256,"description":"The name of the email tag.","error":"The name of the email tag. It can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). It can contain no more than 256 characters.","type":"string"},"value":{"pattern":"^[a-zA-Z0-9_-]+$","maxLength":256,"description":"The value of the email tag.","error":"The value of the email tag. It can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). It can contain no more than 256 characters.","type":"string"}}}},"template":{"description":"Email template to use, by id or slug","type":"object","properties":{"id":{"description":"Template ID","type":"string"},"slug":{"maxLength":128,"description":"Template slug, e.g. welcome-email. Use instead of id.","type":"string"},"variables":{"description":"Variables to replace in the template","type":"object","patternProperties":{"^(?!FIRST_NAME$|LAST_NAME$|EMAIL$|UNSUBSCRIBE_URL$)[a-zA-Z0-9_]{1,50}$":{"description":"The value of the variable.","error":"Variable value must be a string (max 2,000 characters) or a number (not greater than 2^53 - 1).","anyOf":[{"maxLength":2000,"description":"The value of the variable (string).","type":"string"},{"maximum":9007199254740991,"description":"The value of the variable (number).","type":"number"}]}}}}},"thread_id":{"description":"Thread ID to link this email to an existing conversation thread","examples":["thr_abc123xyz"],"type":"string"},"idempotency_key":{"maxLength":500,"description":"Client idempotency key — retries with the same key return the original send without duplicate delivery. Header Idempotency-Key takes precedence.","examples":["order-123-confirmation"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","messageId","status","timestamp","id"],"properties":{"success":{"description":"Whether the email was sent successfully","type":"boolean"},"messageId":{"description":"Unique message ID","type":"string"},"status":{"description":"Email status","type":"string"},"timestamp":{"description":"Timestamp when email was sent","type":"string"},"id":{"description":"Email log database ID","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Authentication required","type":"string"}}}]}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"User is not a member of an organization","type":"string"}}}]}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"description":"Response for status 413","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response for status 503","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiMailV1Send","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/mail/v1/resend/{id}":{"post":{"summary":"Resend email","description":"Resend a previously sent or failed email by its log ID","tags":["Mail"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"minLength":1,"description":"Email log ID to resend","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","messageId","status","timestamp","id"],"properties":{"success":{"description":"Whether the email was sent successfully","type":"boolean"},"messageId":{"description":"Unique message ID","type":"string"},"status":{"description":"Email status","type":"string"},"timestamp":{"description":"Timestamp when email was sent","type":"string"},"id":{"description":"Email log database ID","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Authentication required","type":"string"}}}]}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"User is not a member of an organization","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Response for status 503","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiMailV1ResendById"}},"/api/inbox/v1/mailboxes/list":{"get":{"tags":["Mailboxes"],"summary":"List Mailboxes","description":"Retrieve all mailboxes associated with the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { mailboxes, mailboxError } = await reloop.inbox.mailboxes.list();\nif (mailboxError) throw mailboxError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/inbox/v1/mailboxes/list\"   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.mailboxes.list()\nif result.mailbox_error:\n    raise result.mailbox_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$mailboxes = $reloop->inbox->mailboxes->list();"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar mailboxes = reloop.inbox.mailboxes.list();"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","email","quota","status","displayName","createdAt"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"quota":{"type":"string"},"status":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MailboxesList"}},"/api/inbox/v1/mailboxes/selected":{"get":{"tags":["Mailboxes"],"summary":"Get selected mailbox","description":"Returns the last mailbox (and folder) this user selected in the active organization. Null when nothing was saved yet.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["mailboxId","folder"],"properties":{"mailboxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"folder":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MailboxesSelected"},"put":{"tags":["Mailboxes"],"summary":"Save selected mailbox","description":"Persists the user's selected mailbox (and folder) scoped to the user + active organization.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailboxId"],"properties":{"mailboxId":{"description":"Selected mailbox ID","type":"string"},"folder":{"description":"Selected folder, e.g. inbox, starred","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["mailboxId"],"properties":{"mailboxId":{"description":"Selected mailbox ID","type":"string"},"folder":{"description":"Selected folder, e.g. inbox, starred","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["mailboxId"],"properties":{"mailboxId":{"description":"Selected mailbox ID","type":"string"},"folder":{"description":"Selected folder, e.g. inbox, starred","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["mailboxId","folder"],"properties":{"mailboxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"folder":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"putApiInboxV1MailboxesSelected"}},"/api/inbox/v1/mailboxes/{id}":{"get":{"tags":["Mailboxes"],"summary":"Get Mailbox","description":"Retrieve details of a specific mailbox by ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { mailbox, mailboxError } = await reloop.inbox.mailboxes.get(\"mbx_123456789\");\nif (mailboxError) throw mailboxError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/inbox/v1/mailboxes/mbx_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.mailboxes.get(\"mbx_123456789\")\nif result.mailbox_error:\n    raise result.mailbox_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$mailbox = $reloop->inbox->mailboxes->get('mbx_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar mailbox = reloop.inbox.mailboxes.get(\"mbx_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Mailbox ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","email","quota","status","displayName","domainId","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"quota":{"type":"string"},"status":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"domainId":{"type":"string"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MailboxesById"},"patch":{"tags":["Mailboxes"],"summary":"Update Mailbox","description":"Update settings or status of an existing mailbox","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { mailbox, mailboxError } = await reloop.inbox.mailboxes.update(\"mbx_123456789\", {\n  status: \"disabled\",\n});\nif (mailboxError) throw mailboxError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/mailboxes/mbx_123456789   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"status\":\"disabled\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.mailboxes.update(\"mbx_123456789\", {\n  \"status\": \"disabled\",\n})\nif result.mailbox_error:\n    raise result.mailbox_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$mailbox = $reloop->inbox->mailboxes->update('mbx_123456789', [\n    'status' => 'disabled',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateMailboxParams params = new UpdateMailboxParams();\nparams.status = \"disabled\";\nvar mailbox = reloop.inbox.mailboxes.update(\"mbx_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Mailbox ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"description":"Friendly name of the mailbox sender","type":"string"},"status":{"type":"string","enum":["active","disabled"]},"quota":{"description":"Storage quota limit","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"displayName":{"description":"Friendly name of the mailbox sender","type":"string"},"status":{"type":"string","enum":["active","disabled"]},"quota":{"description":"Storage quota limit","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"displayName":{"description":"Friendly name of the mailbox sender","type":"string"},"status":{"type":"string","enum":["active","disabled"]},"quota":{"description":"Storage quota limit","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1MailboxesById"},"delete":{"tags":["Mailboxes"],"summary":"Delete Mailbox","description":"Permanently delete a mailbox and its associated emails","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { mailbox, mailboxError } = await reloop.inbox.mailboxes.delete(\"mbx_123456789\");\nif (mailboxError) throw mailboxError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/inbox/v1/mailboxes/mbx_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.mailboxes.delete(\"mbx_123456789\")\nif result.mailbox_error:\n    raise result.mailbox_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$mailbox = $reloop->inbox->mailboxes->delete('mbx_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar mailbox = reloop.inbox.mailboxes.delete(\"mbx_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Mailbox ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiInboxV1MailboxesById"}},"/api/inbox/v1/mailboxes/create":{"post":{"tags":["Mailboxes"],"summary":"Create Mailbox","description":"Register a new email mailbox for the active organization under a verified domain","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { mailbox, mailboxError } = await reloop.inbox.mailboxes.create({\n  domainId: \"dom_123456789\",\n  email: \"support@example.com\",\n  displayName: \"Support\",\n});\nif (mailboxError) throw mailboxError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/mailboxes/create   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"domainId\":\"dom_123456789\",\"email\":\"support@example.com\",\"displayName\":\"Support\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.mailboxes.create({\n  \"domainId\": \"dom_123456789\",\n  \"email\": \"support@example.com\",\n  \"displayName\": \"Support\",\n})\nif result.mailbox_error:\n    raise result.mailbox_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$mailbox = $reloop->inbox->mailboxes->create([\n    'domainId' => 'dom_123456789',\n    'email' => 'support@example.com',\n    'displayName' => 'Support',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateMailboxParams params = new CreateMailboxParams();\nparams.domainId = \"dom_123456789\";\nparams.email = \"support@example.com\";\nparams.displayName = \"Support\";\nvar mailbox = reloop.inbox.mailboxes.create(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domainId","email"],"properties":{"domainId":{"description":"Associated verified Domain ID","type":"string"},"email":{"description":"Full email address for the mailbox","type":"string"},"password":{"description":"Mailbox password","type":"string"},"quota":{"description":"Storage quota, defaults to 5 GB","type":"string"},"displayName":{"description":"Friendly name of the mailbox sender","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domainId","email"],"properties":{"domainId":{"description":"Associated verified Domain ID","type":"string"},"email":{"description":"Full email address for the mailbox","type":"string"},"password":{"description":"Mailbox password","type":"string"},"quota":{"description":"Storage quota, defaults to 5 GB","type":"string"},"displayName":{"description":"Friendly name of the mailbox sender","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domainId","email"],"properties":{"domainId":{"description":"Associated verified Domain ID","type":"string"},"email":{"description":"Full email address for the mailbox","type":"string"},"password":{"description":"Mailbox password","type":"string"},"quota":{"description":"Storage quota, defaults to 5 GB","type":"string"},"displayName":{"description":"Friendly name of the mailbox sender","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","email","status"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MailboxesCreate","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/messages/":{"get":{"tags":["Messages"],"summary":"List Messages","description":"Retrieve inbox emails for the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { messages, messageError } = await reloop.inbox.messages.list({\n  mailboxId: \"mbx_123456789\",\n  limit: 100,\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/inbox/v1/messages?mailboxId=mbx_123456789&limit=100\"   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.list({\n  \"mailboxId\": \"mbx_123456789\",\n  \"limit\": 100,\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$messages = $reloop->inbox->messages->list([\n    'mailboxId' => 'mbx_123456789',\n    'limit' => 100,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListMessagesParams params = new ListMessagesParams();\nparams.mailboxId = \"mbx_123456789\";\nparams.limit = 100;\nvar messages = reloop.inbox.messages.list(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"mailboxId","in":"query","required":false,"schema":{"description":"Filter messages by mailbox ID","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"maximum":200,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":100,"maximum":200,"type":"number","anyOf":[{"default":0,"maximum":200,"type":"string","format":"numeric"},{"default":100,"maximum":200,"type":"number"}]}]}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":0,"type":"number","anyOf":[{"default":0,"type":"string","format":"numeric"},{"default":0,"type":"number"}]}]}},{"name":"q","in":"query","required":false,"schema":{"description":"Search subject, snippet, sender","type":"string"}},{"name":"isSpam","in":"query","required":false,"schema":{"description":"Filter by spam status","anyOf":[{"description":"Filter by spam status","type":"boolean"},{"description":"Filter by spam status","format":"boolean","default":false,"type":"string"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","mailboxId","organizationId","fromEmail","fromName","toEmails","ccEmails","bccEmails","replyTo","subject","textBody","htmlBody","snippet","size","status","isRead","isStarred","isSpam","spamScore","messageId","threadId","inReplyTo","references","headers","date","createdAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"bccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"type":"number"},"status":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"spamScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"references":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"headers":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"},{"type":"undefined"}]},"date":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"attachments":{"type":"array","items":{"type":"object","required":["id","inboundEmailId","filename","contentType","size","storagePath","contentDisposition","contentId","createdAt"],"properties":{"id":{"type":"string"},"inboundEmailId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1Messages"}},"/api/inbox/v1/messages/sent":{"get":{"tags":["Messages"],"summary":"List Sent Messages","description":"Retrieve sent emails (outbound logs) for the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { messages, messageError } = await reloop.inbox.messages.listSent({\n  mailboxId: \"mbx_123456789\",\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/inbox/v1/messages/sent?mailboxId=mbx_123456789\"   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.listSent({\n  \"mailboxId\": \"mbx_123456789\",\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$messages = $reloop->inbox->messages->listSent([\n    'mailboxId' => 'mbx_123456789',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListSentMessagesParams params = new ListSentMessagesParams();\nparams.mailboxId = \"mbx_123456789\";\nvar messages = reloop.inbox.messages.listSent(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"mailboxId","in":"query","required":false,"schema":{"description":"Filter sent messages by mailbox ID","type":"string"}},{"name":"q","in":"query","required":false,"schema":{"description":"Search subject, body, and recipients","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","messageId","organizationId","domainId","fromEmail","fromName","toEmails","ccEmails","bccEmails","subject","textBody","htmlBody","status","createdAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"messageId":{"type":"string"},"organizationId":{"type":"string"},"domainId":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"bccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"subject":{"type":"string"},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStarred":{"type":"boolean"},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","contentType","size","storagePath","contentDisposition","contentId"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MessagesSent"}},"/api/inbox/v1/messages/{id}":{"get":{"tags":["Messages"],"summary":"Get Message","description":"Retrieve details of a single email message by ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.get(\"msg_123456789\");\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/inbox/v1/messages/msg_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.get(\"msg_123456789\")\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->get('msg_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar message = reloop.inbox.messages.get(\"msg_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","mailboxId","organizationId","fromEmail","fromName","toEmails","ccEmails","bccEmails","replyTo","subject","textBody","htmlBody","snippet","size","status","isRead","isStarred","isSpam","spamScore","messageId","threadId","inReplyTo","references","headers","date","createdAt"],"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"bccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"type":"number"},"status":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"spamScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"references":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"headers":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"},{"type":"undefined"}]},"date":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"attachments":{"type":"array","items":{"type":"object","required":["id","inboundEmailId","filename","contentType","size","storagePath","contentDisposition","contentId","createdAt"],"properties":{"id":{"type":"string"},"inboundEmailId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MessagesById"},"patch":{"tags":["Messages"],"summary":"Update Message Status","description":"Update status attributes (isRead, isStarred, isSpam) of a message","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.update(\"msg_123456789\", {\n  isRead: true,\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/messages/msg_123456789   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"isRead\":true}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.update(\"msg_123456789\", {\n  \"isRead\": True,\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->update('msg_123456789', [\n    'isRead' => true,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateMessageParams params = new UpdateMessageParams();\nparams.isRead = true;\nvar message = reloop.inbox.messages.update(\"msg_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isRead":{"description":"Read status of the message","type":"boolean"},"isStarred":{"description":"Starred status of the message","type":"boolean"},"isSpam":{"description":"Spam status of the message","type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"isRead":{"description":"Read status of the message","type":"boolean"},"isStarred":{"description":"Starred status of the message","type":"boolean"},"isSpam":{"description":"Spam status of the message","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"isRead":{"description":"Read status of the message","type":"boolean"},"isStarred":{"description":"Starred status of the message","type":"boolean"},"isSpam":{"description":"Spam status of the message","type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1MessagesById"},"delete":{"tags":["Messages"],"summary":"Delete Message","description":"Permanently delete an email message","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.delete(\"msg_123456789\");\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/inbox/v1/messages/msg_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.delete(\"msg_123456789\")\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->delete('msg_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar message = reloop.inbox.messages.delete(\"msg_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiInboxV1MessagesById"}},"/api/inbox/v1/messages/batch":{"post":{"tags":["Messages"],"summary":"Batch Get Messages","description":"Retrieve multiple email messages by their IDs (max 100)","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { messages, messageError } = await reloop.inbox.messages.batch({\n  ids: [\"msg_123456789\", \"msg_987654321\"],\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/messages/batch   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"ids\":[\"msg_123456789\",\"msg_987654321\"]}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.batch({\n  \"ids\": [\"msg_123456789\", \"msg_987654321\"],\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$messages = $reloop->inbox->messages->batch([\n    'ids' => ['msg_123456789', 'msg_987654321'],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nBatchMessagesParams params = new BatchMessagesParams();\nparams.ids = List.of(\"msg_123456789\", \"msg_987654321\");\nvar messages = reloop.inbox.messages.batch(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"maxItems":100,"type":"array","items":{"description":"Message ID","type":"string"}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"maxItems":100,"type":"array","items":{"description":"Message ID","type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"maxItems":100,"type":"array","items":{"description":"Message ID","type":"string"}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","mailboxId","organizationId","fromEmail","fromName","toEmails","ccEmails","bccEmails","replyTo","subject","textBody","htmlBody","snippet","size","status","isRead","isStarred","isSpam","spamScore","messageId","threadId","inReplyTo","references","headers","date","createdAt"],"additionalProperties":false,"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"bccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"type":"number"},"status":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"spamScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"references":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"headers":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"},{"type":"undefined"}]},"date":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"attachments":{"type":"array","items":{"type":"object","required":["id","inboundEmailId","filename","contentType","size","storagePath","contentDisposition","contentId","createdAt"],"properties":{"id":{"type":"string"},"inboundEmailId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MessagesBatch","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/messages/{id}/attachments/{attachmentId}":{"get":{"tags":["Messages"],"summary":"Get Message Attachment","description":"Retrieve attachment details of a message","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.getAttachment(\n  \"msg_123456789\",\n  \"att_123456789\",\n);\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/inbox/v1/messages/msg_123456789/attachments/att_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.getAttachment(\"msg_123456789\", \"att_123456789\")\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->getAttachment('msg_123456789', 'att_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar message = reloop.inbox.messages.getAttachment(\"msg_123456789\", \"att_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}},{"name":"attachmentId","in":"path","required":true,"schema":{"description":"Attachment ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","filename","contentType","size","storagePath","contentDisposition","contentId","createdAt"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MessagesByIdAttachmentsByAttachmentId"}},"/api/inbox/v1/messages/{id}/raw":{"get":{"tags":["Messages"],"summary":"Get Raw Message","description":"Retrieve the raw, RFC822 formatted string content of a message","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.getRaw(\"msg_123456789\");\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/inbox/v1/messages/msg_123456789/raw   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.getRaw(\"msg_123456789\")\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->getRaw('msg_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar message = reloop.inbox.messages.getRaw(\"msg_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","messageId","raw"],"properties":{"id":{"type":"string"},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"raw":{"type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1MessagesByIdRaw"}},"/api/inbox/v1/messages/{id}/read":{"patch":{"tags":["Messages"],"summary":"Mark Message Read","description":"Direct endpoint to update read/unread status of a message","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.setRead(\"msg_123456789\", {\n  isRead: true,\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/messages/msg_123456789/read   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"isRead\":true}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.setRead(\"msg_123456789\", {\n  \"isRead\": True,\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->setRead('msg_123456789', [\n    'isRead' => true,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nSetReadParams params = new SetReadParams();\nparams.isRead = true;\nvar message = reloop.inbox.messages.setRead(\"msg_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["isRead"],"properties":{"isRead":{"description":"Whether to mark the message as read","type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["isRead"],"properties":{"isRead":{"description":"Whether to mark the message as read","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["isRead"],"properties":{"isRead":{"description":"Whether to mark the message as read","type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1MessagesByIdRead"}},"/api/inbox/v1/messages/{id}/star":{"patch":{"tags":["Messages"],"summary":"Toggle Message Star","description":"Direct endpoint to toggle starred status of a message","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.setStar(\"msg_123456789\", {\n  isStarred: true,\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/messages/msg_123456789/star   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"isStarred\":true}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.setStar(\"msg_123456789\", {\n  \"isStarred\": True,\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->setStar('msg_123456789', [\n    'isStarred' => true,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nSetStarParams params = new SetStarParams();\nparams.isStarred = true;\nvar message = reloop.inbox.messages.setStar(\"msg_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["isStarred"],"properties":{"isStarred":{"description":"Whether to star the message","type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["isStarred"],"properties":{"isStarred":{"description":"Whether to star the message","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["isStarred"],"properties":{"isStarred":{"description":"Whether to star the message","type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1MessagesByIdStar"}},"/api/inbox/v1/messages/send":{"post":{"tags":["Messages"],"summary":"Send Email","description":"Send a new email message on behalf of a mailbox","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.send({\n  mailboxId: \"mbx_123456789\",\n  to: \"user@example.com\",\n  subject: \"Hello from Reloop Inbox\",\n  html: \"<p>Thanks for reaching out.</p>\",\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/messages/send   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"mailboxId\":\"mbx_123456789\",\"to\":\"user@example.com\",\"subject\":\"Hello from Reloop Inbox\",\"html\":\"<p>Thanks for reaching out.</p>\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.send({\n  \"mailboxId\": \"mbx_123456789\",\n  \"to\": \"user@example.com\",\n  \"subject\": \"Hello from Reloop Inbox\",\n  \"html\": \"<p>Thanks for reaching out.</p>\",\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->send([\n    'mailboxId' => 'mbx_123456789',\n    'to' => 'user@example.com',\n    'subject' => 'Hello from Reloop Inbox',\n    'html' => '<p>Thanks for reaching out.</p>',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nSendMessageParams params = new SendMessageParams();\nparams.mailboxId = \"mbx_123456789\";\nparams.to = \"user@example.com\";\nparams.subject = \"Hello from Reloop Inbox\";\nparams.html = \"<p>Thanks for reaching out.</p>\";\nvar message = reloop.inbox.messages.send(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailboxId","to","subject"],"properties":{"mailboxId":{"description":"Sender Mailbox ID","type":"string"},"to":{"description":"Recipient email address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"description":"Email subject","type":"string"},"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"scheduledAt":{"description":"ISO 8601 datetime to send the email later","type":"string"},"undoWindowSeconds":{"minimum":0,"description":"Seconds to wait before sending (default 0 = immediate; set >0 for an undo window)","type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["mailboxId","to","subject"],"properties":{"mailboxId":{"description":"Sender Mailbox ID","type":"string"},"to":{"description":"Recipient email address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"description":"Email subject","type":"string"},"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"scheduledAt":{"description":"ISO 8601 datetime to send the email later","type":"string"},"undoWindowSeconds":{"minimum":0,"description":"Seconds to wait before sending (default 0 = immediate; set >0 for an undo window)","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["mailboxId","to","subject"],"properties":{"mailboxId":{"description":"Sender Mailbox ID","type":"string"},"to":{"description":"Recipient email address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"description":"Email subject","type":"string"},"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"scheduledAt":{"description":"ISO 8601 datetime to send the email later","type":"string"},"undoWindowSeconds":{"minimum":0,"description":"Seconds to wait before sending (default 0 = immediate; set >0 for an undo window)","type":"number"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","messageId","status","timestamp","id"],"properties":{"success":{"description":"Whether the email was sent successfully","type":"boolean"},"messageId":{"description":"Unique message ID","type":"string"},"status":{"description":"Email status","type":"string"},"timestamp":{"description":"Timestamp when email was sent","type":"string"},"id":{"description":"Email log database ID","type":"string"}}},{"type":"object","required":["success","pending","id","sendAt","messageId"],"properties":{"success":{"type":"boolean"},"pending":{"const":true,"type":"boolean"},"id":{"type":"string"},"sendAt":{"type":"string"},"messageId":{"type":"string"}}}]}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MessagesSend","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/messages/pending/{id}/cancel":{"post":{"tags":["Messages"],"summary":"Cancel Pending Send","description":"Cancel a scheduled or undo-window pending outbound email before it is sent","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.cancelPending(\"pnd_123456789\");\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/messages/pending/pnd_123456789/cancel   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.cancelPending(\"pnd_123456789\")\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->cancelPending('pnd_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar message = reloop.inbox.messages.cancelPending(\"pnd_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MessagesPendingByIdCancel"}},"/api/inbox/v1/messages/{id}/reply":{"post":{"tags":["Messages"],"summary":"Reply to Message","description":"Reply to an email message, preserving thread context and header references","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.reply(\"msg_123456789\", {\n  html: \"<p>Thanks for your message.</p>\",\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/messages/msg_123456789/reply   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"html\":\"<p>Thanks for your message.</p>\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.reply(\"msg_123456789\", {\n  \"html\": \"<p>Thanks for your message.</p>\",\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->reply('msg_123456789', [\n    'html' => '<p>Thanks for your message.</p>',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nReplyMessageParams params = new ReplyMessageParams();\nparams.html = \"<p>Thanks for your message.</p>\";\nvar message = reloop.inbox.messages.reply(\"msg_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID to reply to","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"to":{"description":"Override To recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"threadId":{"description":"Conversation thread to append this reply to","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"to":{"description":"Override To recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"threadId":{"description":"Conversation thread to append this reply to","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"to":{"description":"Override To recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"threadId":{"description":"Conversation thread to append this reply to","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","messageId","status","timestamp","id"],"properties":{"success":{"description":"Whether the email was sent successfully","type":"boolean"},"messageId":{"description":"Unique message ID","type":"string"},"status":{"description":"Email status","type":"string"},"timestamp":{"description":"Timestamp when email was sent","type":"string"},"id":{"description":"Email log database ID","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MessagesByIdReply"}},"/api/inbox/v1/messages/{id}/reply-all":{"post":{"tags":["Messages"],"summary":"Reply All to Message","description":"Reply all to an email message, copying all original recipients","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.replyAll(\"msg_123456789\", {\n  html: \"<p>Thanks everyone.</p>\",\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/messages/msg_123456789/reply-all   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"html\":\"<p>Thanks everyone.</p>\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.replyAll(\"msg_123456789\", {\n  \"html\": \"<p>Thanks everyone.</p>\",\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->replyAll('msg_123456789', [\n    'html' => '<p>Thanks everyone.</p>',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nReplyMessageParams params = new ReplyMessageParams();\nparams.html = \"<p>Thanks everyone.</p>\";\nvar message = reloop.inbox.messages.replyAll(\"msg_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID to reply all to","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"to":{"description":"Override To recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"description":"Override CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"threadId":{"description":"Conversation thread to append this reply to","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"to":{"description":"Override To recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"description":"Override CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"threadId":{"description":"Conversation thread to append this reply to","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"description":"Plain text body content","type":"string"},"html":{"description":"HTML body content","type":"string"},"to":{"description":"Override To recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"description":"Override CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"threadId":{"description":"Conversation thread to append this reply to","type":"string"},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","messageId","status","timestamp","id"],"properties":{"success":{"description":"Whether the email was sent successfully","type":"boolean"},"messageId":{"description":"Unique message ID","type":"string"},"status":{"description":"Email status","type":"string"},"timestamp":{"description":"Timestamp when email was sent","type":"string"},"id":{"description":"Email log database ID","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MessagesByIdReply-all"}},"/api/inbox/v1/messages/{id}/forward":{"post":{"tags":["Messages"],"summary":"Forward Message","description":"Forward an email message to new recipients, appending original headers","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { message, messageError } = await reloop.inbox.messages.forward(\"msg_123456789\", {\n  to: \"colleague@example.com\",\n  html: \"<p>See the thread below.</p>\",\n});\nif (messageError) throw messageError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/messages/msg_123456789/forward   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"to\":\"colleague@example.com\",\"html\":\"<p>See the thread below.</p>\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.messages.forward(\"msg_123456789\", {\n  \"to\": \"colleague@example.com\",\n  \"html\": \"<p>See the thread below.</p>\",\n})\nif result.message_error:\n    raise result.message_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$message = $reloop->inbox->messages->forward('msg_123456789', [\n    'to' => 'colleague@example.com',\n    'html' => '<p>See the thread below.</p>',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nForwardMessageParams params = new ForwardMessageParams();\nparams.to = \"colleague@example.com\";\nparams.html = \"<p>See the thread below.</p>\";\nvar message = reloop.inbox.messages.forward(\"msg_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Message ID to forward","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"description":"Recipient email address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"text":{"description":"Plain text body context prefix","type":"string"},"html":{"description":"HTML body context prefix","type":"string"},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["to"],"properties":{"to":{"description":"Recipient email address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"text":{"description":"Plain text body context prefix","type":"string"},"html":{"description":"HTML body context prefix","type":"string"},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["to"],"properties":{"to":{"description":"Recipient email address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"text":{"description":"Plain text body context prefix","type":"string"},"html":{"description":"HTML body context prefix","type":"string"},"cc":{"description":"CC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"description":"BCC recipient address(es)","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"attachments":{"description":"Email attachments","type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","messageId","status","timestamp","id"],"properties":{"success":{"description":"Whether the email was sent successfully","type":"boolean"},"messageId":{"description":"Unique message ID","type":"string"},"status":{"description":"Email status","type":"string"},"timestamp":{"description":"Timestamp when email was sent","type":"string"},"id":{"description":"Email log database ID","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1MessagesByIdForward"}},"/api/inbox/v1/threads/":{"get":{"tags":["Threads"],"summary":"List Threads","description":"Retrieve email conversations (threads) for the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { threads, threadError } = await reloop.inbox.threads.list({ limit: 50 });\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/inbox/v1/threads?limit=50\"   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.list({\n  \"limit\": 50,\n})\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$threads = $reloop->inbox->threads->list([\n    'limit' => 50,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListThreadsParams params = new ListThreadsParams();\nparams.limit = 50;\nvar threads = reloop.inbox.threads.list(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"mailboxId","in":"query","required":false,"schema":{"description":"Filter threads by mailbox ID","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"maximum":200,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":50,"maximum":200,"type":"number"}]}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":0,"type":"number"}]}},{"name":"folder","in":"query","required":false,"schema":{"description":"Filter by folder: inbox, archive, trash (omit for all)","type":"string"}},{"name":"q","in":"query","required":false,"schema":{"description":"Search subject and preview","type":"string"}},{"name":"isPinned","in":"query","required":false,"schema":{"description":"Filter by pinned status","type":"boolean"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","enum":["primary","alerts","person","tag"]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","mailboxId","organizationId","subject","lastMessagePreview","lastMessageAt","status","messageCount","participants","isRead","isStarred","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"mailboxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessagePreview":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"status":{"type":"string"},"messageCount":{"type":"number"},"participants":{"type":"array","items":{"type":"string"}},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"pinnedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"labels":{"type":"array","items":{"type":"object","required":["id","name","color"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1Threads"}},"/api/inbox/v1/threads/batch":{"post":{"tags":["Threads"],"summary":"Batch Thread Actions","description":"Apply archive, trash, restore, star, read, important, or spam actions to multiple threads","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.batch({\n  ids: [\"thr_123456789\", \"thr_987654321\"],\n  action: \"archive\",\n});\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/threads/batch   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"ids\":[\"thr_123456789\",\"thr_987654321\"],\"action\":\"archive\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.batch({\n  \"ids\": [\"thr_123456789\", \"thr_987654321\"],\n  \"action\": \"archive\",\n})\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->batch([\n    'ids' => ['thr_123456789', 'thr_987654321'],\n    'action' => 'archive',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nBatchThreadsParams params = new BatchThreadsParams();\nparams.ids = List.of(\"thr_123456789\", \"thr_987654321\");\nparams.action = \"archive\";\nvar thread = reloop.inbox.threads.batch(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"action":{"type":"string","enum":["archive","unarchive","trash","restore","star","unstar","read","unread","important","unimportant","spam","unspam","pin","unpin"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"action":{"type":"string","enum":["archive","unarchive","trash","restore","star","unstar","read","unread","important","unimportant","spam","unspam","pin","unpin"]}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"action":{"type":"string","enum":["archive","unarchive","trash","restore","star","unstar","read","unread","important","unimportant","spam","unspam","pin","unpin"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","ids","action"],"properties":{"success":{"type":"boolean"},"ids":{"type":"array","items":{"type":"string"}},"action":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1ThreadsBatch","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/threads/{id}":{"get":{"tags":["Threads"],"summary":"Get Thread","description":"Retrieve a specific thread by ID, including its conversation messages and attachments","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.get(\"thr_123456789\");\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/inbox/v1/threads/thr_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.get(\"thr_123456789\")\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->get('thr_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar thread = reloop.inbox.threads.get(\"thr_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","mailboxId","organizationId","subject","lastMessagePreview","lastMessageAt","status","messageCount","participants","isRead","isStarred","createdAt","updatedAt","messages"],"properties":{"id":{"type":"string"},"mailboxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessagePreview":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastMessageAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"status":{"type":"string"},"messageCount":{"type":"number"},"participants":{"type":"array","items":{"type":"string"}},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"pinnedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"messages":{"type":"array","items":{"type":"object","required":["id","threadId","direction","inboundEmailId","emailLogId","fromEmail","fromName","subject","preview","messageAt","errorMessage","rfc822MessageId","inReplyTo","createdAt","email"],"properties":{"id":{"type":"string"},"threadId":{"type":"string"},"direction":{"type":"string"},"inboundEmailId":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"emailLogId":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"preview":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"messageAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"rfc822MessageId":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"inReplyTo":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"email":{"anyOf":[{"type":"object","required":["id","fromEmail","fromName","toEmails","ccEmails","replyTo","subject","textBody","htmlBody","isRead","isStarred","attachments","createdAt"],"properties":{"id":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"attachments":{"type":"array","items":{"type":"object","required":["id","inboundEmailId","filename","contentType","size","storagePath","contentDisposition","contentId","createdAt"],"properties":{"id":{"type":"string"},"inboundEmailId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}},{"type":"object","required":["id","fromEmail","fromName","toEmails","ccEmails","bccEmails","subject","textBody","htmlBody","status","errorMessage","sentAt","createdAt"],"properties":{"id":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"bccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"},{"type":"undefined"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"undefined"}]},"sentAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","contentType","size","storagePath","contentDisposition","contentId"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},{"type":"null"}]}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1ThreadsById"},"patch":{"tags":["Threads"],"summary":"Update Thread","description":"Update thread-wide attributes like read/starred/important status or workflow state","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.update(\"thr_123456789\", {\n  isRead: true,\n});\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/threads/thr_123456789   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"isRead\":true}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.update(\"thr_123456789\", {\n  \"isRead\": True,\n})\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->update('thr_123456789', [\n    'isRead' => true,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateThreadParams params = new UpdateThreadParams();\nparams.isRead = true;\nvar thread = reloop.inbox.threads.update(\"thr_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isRead":{"description":"Read/unread status of the thread","type":"boolean"},"isStarred":{"description":"Starred/unstarred status of the thread","type":"boolean"},"isImportant":{"description":"Important flag for the thread","type":"boolean"},"isPinned":{"description":"Pinned status of the thread","type":"boolean"},"status":{"type":"string","enum":["active","archived","closed","trash"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"isRead":{"description":"Read/unread status of the thread","type":"boolean"},"isStarred":{"description":"Starred/unstarred status of the thread","type":"boolean"},"isImportant":{"description":"Important flag for the thread","type":"boolean"},"isPinned":{"description":"Pinned status of the thread","type":"boolean"},"status":{"type":"string","enum":["active","archived","closed","trash"]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"isRead":{"description":"Read/unread status of the thread","type":"boolean"},"isStarred":{"description":"Starred/unstarred status of the thread","type":"boolean"},"isImportant":{"description":"Important flag for the thread","type":"boolean"},"isPinned":{"description":"Pinned status of the thread","type":"boolean"},"status":{"type":"string","enum":["active","archived","closed","trash"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1ThreadsById"},"delete":{"tags":["Threads"],"summary":"Delete Thread","description":"Permanently delete a thread and all of its conversation logs","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.delete(\"thr_123456789\");\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/inbox/v1/threads/thr_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.delete(\"thr_123456789\")\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->delete('thr_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar thread = reloop.inbox.threads.delete(\"thr_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiInboxV1ThreadsById"}},"/api/inbox/v1/threads/{id}/attachments/{attachmentId}":{"get":{"tags":["Threads"],"summary":"Get Thread Attachment","description":"Retrieve an attachment within a specific thread conversation","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread: attachment, threadError } = await reloop.inbox.threads.getAttachment(\n  \"thr_123456789\",\n  \"att_123456789\",\n);\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/inbox/v1/threads/thr_123456789/attachments/att_123456789   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.getAttachment(\"thr_123456789\", \"att_123456789\")\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->getAttachment('thr_123456789', 'att_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar thread = reloop.inbox.threads.getAttachment(\"thr_123456789\", \"att_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}},{"name":"attachmentId","in":"path","required":true,"schema":{"description":"Attachment ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","filename","contentType","size","storagePath","contentDisposition","contentId","createdAt"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1ThreadsByIdAttachmentsByAttachmentId"}},"/api/inbox/v1/threads/{id}/read":{"patch":{"tags":["Threads"],"summary":"Mark Thread Read","description":"Direct endpoint to update read/unread status of a thread","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.setRead(\"thr_123456789\", {\n  isRead: true,\n});\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/threads/thr_123456789/read   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"isRead\":true}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.setRead(\"thr_123456789\", {\n  \"isRead\": True,\n})\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->setRead('thr_123456789', [\n    'isRead' => true,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nSetReadParams params = new SetReadParams();\nparams.isRead = true;\nvar thread = reloop.inbox.threads.setRead(\"thr_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["isRead"],"properties":{"isRead":{"description":"Whether to mark the thread as read","type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["isRead"],"properties":{"isRead":{"description":"Whether to mark the thread as read","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["isRead"],"properties":{"isRead":{"description":"Whether to mark the thread as read","type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1ThreadsByIdRead"}},"/api/inbox/v1/threads/{id}/star":{"patch":{"tags":["Threads"],"summary":"Toggle Thread Star","description":"Direct endpoint to toggle starred status of a thread","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.setStar(\"thr_123456789\", {\n  isStarred: true,\n});\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/inbox/v1/threads/thr_123456789/star   -H \"x-api-key: rl_123456789\"   -H \"Content-Type: application/json\"   -d '{\"isStarred\":true}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.setStar(\"thr_123456789\", {\n  \"isStarred\": True,\n})\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->setStar('thr_123456789', [\n    'isStarred' => true,\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nSetStarParams params = new SetStarParams();\nparams.isStarred = true;\nvar thread = reloop.inbox.threads.setStar(\"thr_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["isStarred"],"properties":{"isStarred":{"description":"Whether to star the thread","type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["isStarred"],"properties":{"isStarred":{"description":"Whether to star the thread","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["isStarred"],"properties":{"isStarred":{"description":"Whether to star the thread","type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1ThreadsByIdStar"}},"/api/inbox/v1/threads/{id}/archive":{"post":{"tags":["Threads"],"summary":"Archive Thread","description":"Archive a thread to hide it from active list","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.archive(\"thr_123456789\");\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/threads/thr_123456789/archive   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.archive(\"thr_123456789\")\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->archive('thr_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar thread = reloop.inbox.threads.archive(\"thr_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1ThreadsByIdArchive"}},"/api/inbox/v1/threads/{id}/trash":{"post":{"tags":["Threads"],"summary":"Move Thread to Trash","description":"Soft-delete a thread by moving it to the trash folder","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.trash(\"thr_123456789\");\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/threads/thr_123456789/trash   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.trash(\"thr_123456789\")\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->trash('thr_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar thread = reloop.inbox.threads.trash(\"thr_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1ThreadsByIdTrash"}},"/api/inbox/v1/threads/{id}/restore":{"post":{"tags":["Threads"],"summary":"Restore Thread","description":"Restore a thread from trash, archive, or spam back to the inbox","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { thread, threadError } = await reloop.inbox.threads.restore(\"thr_123456789\");\nif (threadError) throw threadError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/inbox/v1/threads/thr_123456789/restore   -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.inbox.threads.restore(\"thr_123456789\")\nif result.thread_error:\n    raise result.thread_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$thread = $reloop->inbox->threads->restore('thr_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar thread = reloop.inbox.threads.restore(\"thr_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Inbox SDK support coming soon — use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Inbox SDK support coming soon — use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Inbox SDK support coming soon — use the REST API"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"description":"Thread ID","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1ThreadsByIdRestore"}},"/api/inbox/v1/webhooks/":{"post":{"tags":["Webhooks"],"summary":"Create webhook","description":"Creates a webhook for the active organization. Requires a logged-in user (session or API key).","security":[{"apiKey":[]}],"operationId":"postApiInboxV1Webhooks","responses":{"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"get":{"tags":["Webhooks"],"summary":"List webhooks","description":"Lists webhooks for the active organization. Requires a logged-in user (session or API key).","security":[{"apiKey":[]}],"operationId":"getApiInboxV1Webhooks","responses":{"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/inbox/v1/webhooks/{webhook_id}":{"get":{"tags":["Webhooks"],"summary":"Get webhook","description":"Retrieves a webhook by its ID. Requires a logged-in user (session or API key) with access to the webhook's organization.","security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"operationId":"getApiInboxV1WebhooksByWebhook_id","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"tags":["Webhooks"],"summary":"Update webhook","description":"Updates a webhook by its ID. Requires a logged-in user (session or API key) with access to the webhook's organization.","security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"operationId":"patchApiInboxV1WebhooksByWebhook_id","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Webhooks"],"summary":"Delete webhook","description":"Soft deletes a webhook by its ID. Requires a logged-in user (session or API key) with access to the webhook's organization.","security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"operationId":"deleteApiInboxV1WebhooksByWebhook_id","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/inbox/v1/webhooks/{webhook_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","description":"Fetches a paginated list of delivery attempts for a specific webhook. Requires a logged-in user (session or API key) with access to the webhook's organization.","security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"operationId":"getApiInboxV1WebhooksByWebhook_idDeliveries","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/inbox/v1/webhooks/deliveries/{delivery_id}/retry":{"post":{"tags":["Webhooks"],"summary":"Retry webhook delivery","description":"Manually re-enqueues a specific webhook delivery attempt. Requires a logged-in user (session or API key) with access to the delivery's organization.","security":[{"apiKey":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook Delivery ID","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"operationId":"postApiInboxV1WebhooksDeliveriesByDelivery_idRetry","responses":{"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/inbox/v1/labels/":{"get":{"tags":["Labels"],"summary":"List Labels","description":"List email labels for the organization or mailbox","security":[{"apiKey":[]}],"parameters":[{"name":"mailboxId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","mailboxId","organizationId","name","color","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1Labels"},"post":{"tags":["Labels"],"summary":"Create Label","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailboxId","name"],"properties":{"mailboxId":{"type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"color":{"maxLength":32,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["mailboxId","name"],"properties":{"mailboxId":{"type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"color":{"maxLength":32,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["mailboxId","name"],"properties":{"mailboxId":{"type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"color":{"maxLength":32,"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","mailboxId","organizationId","name","color","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1Labels","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/labels/{id}":{"patch":{"tags":["Labels"],"summary":"Update Label","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":100,"type":"string"},"color":{"maxLength":32,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":100,"type":"string"},"color":{"maxLength":32,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":100,"type":"string"},"color":{"maxLength":32,"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","mailboxId","organizationId","name","color","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1LabelsById"},"delete":{"tags":["Labels"],"summary":"Delete Label","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiInboxV1LabelsById"}},"/api/inbox/v1/labels/{id}/threads":{"get":{"tags":["Labels"],"summary":"List Thread IDs for Label","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["threadIds"],"properties":{"threadIds":{"type":"array","items":{"type":"string"}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1LabelsByIdThreads"}},"/api/inbox/v1/labels/threads/{threadId}":{"get":{"tags":["Labels"],"summary":"List Thread Labels","security":[{"apiKey":[]}],"parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","mailboxId","organizationId","name","color","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"mailboxId":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1LabelsThreadsByThreadId"}},"/api/inbox/v1/labels/threads/{threadId}/assign":{"post":{"tags":["Labels"],"summary":"Assign Label to Thread","security":[{"apiKey":[]}],"parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["labelId"],"properties":{"labelId":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["labelId"],"properties":{"labelId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["labelId"],"properties":{"labelId":{"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1LabelsThreadsByThreadIdAssign"}},"/api/inbox/v1/labels/threads/{threadId}/unassign":{"post":{"tags":["Labels"],"summary":"Unassign Label from Thread","security":[{"apiKey":[]}],"parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["labelId"],"properties":{"labelId":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["labelId"],"properties":{"labelId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["labelId"],"properties":{"labelId":{"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1LabelsThreadsByThreadIdUnassign"}},"/api/inbox/v1/notes/":{"get":{"tags":["Notes"],"summary":"List Thread Notes","security":[{"apiKey":[]}],"parameters":[{"name":"threadId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","threadId","organizationId","content","color","isPinned","order","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"threadId":{"type":"string"},"organizationId":{"type":"string"},"content":{"type":"string"},"color":{"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1Notes"},"post":{"tags":["Notes"],"summary":"Create Note","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["threadId","content"],"properties":{"threadId":{"type":"string"},"content":{"minLength":1,"type":"string"},"color":{"maxLength":32,"type":"string"},"isPinned":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["threadId","content"],"properties":{"threadId":{"type":"string"},"content":{"minLength":1,"type":"string"},"color":{"maxLength":32,"type":"string"},"isPinned":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["threadId","content"],"properties":{"threadId":{"type":"string"},"content":{"minLength":1,"type":"string"},"color":{"maxLength":32,"type":"string"},"isPinned":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","threadId","organizationId","content","color","isPinned","order","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"threadId":{"type":"string"},"organizationId":{"type":"string"},"content":{"type":"string"},"color":{"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1Notes","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/notes/{id}":{"patch":{"tags":["Notes"],"summary":"Update Note","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"minLength":1,"type":"string"},"color":{"maxLength":32,"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"content":{"minLength":1,"type":"string"},"color":{"maxLength":32,"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"content":{"minLength":1,"type":"string"},"color":{"maxLength":32,"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","threadId","organizationId","content","color","isPinned","order","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"threadId":{"type":"string"},"organizationId":{"type":"string"},"content":{"type":"string"},"color":{"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1NotesById"},"delete":{"tags":["Notes"],"summary":"Delete Note","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiInboxV1NotesById"}},"/api/inbox/v1/notes/reorder":{"post":{"tags":["Notes"],"summary":"Reorder Notes","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["threadId","orderedIds"],"properties":{"threadId":{"type":"string"},"orderedIds":{"minItems":1,"type":"array","items":{"type":"string"}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["threadId","orderedIds"],"properties":{"threadId":{"type":"string"},"orderedIds":{"minItems":1,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["threadId","orderedIds"],"properties":{"threadId":{"type":"string"},"orderedIds":{"minItems":1,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","threadId","organizationId","content","color","isPinned","order","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"threadId":{"type":"string"},"organizationId":{"type":"string"},"content":{"type":"string"},"color":{"type":"string"},"isPinned":{"type":"boolean"},"order":{"type":"number"},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1NotesReorder","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/drafts/":{"get":{"tags":["Drafts"],"summary":"List Drafts","description":"List compose drafts for the organization or mailbox","security":[{"apiKey":[]}],"parameters":[{"name":"mailboxId","in":"query","required":false,"schema":{"type":"string"}},{"name":"threadId","in":"query","required":false,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["compose","reply","reply_all","forward"]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","organizationId","mailboxId","kind","threadId","inReplyToMessageId","to","cc","bcc","subject","html","text","attachments","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"mailboxId":{"type":"string"},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1Drafts"},"post":{"tags":["Drafts"],"summary":"Create Draft","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mailboxId"],"properties":{"mailboxId":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["mailboxId"],"properties":{"mailboxId":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["mailboxId"],"properties":{"mailboxId":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","mailboxId","kind","threadId","inReplyToMessageId","to","cc","bcc","subject","html","text","attachments","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"mailboxId":{"type":"string"},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1Drafts","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/drafts/{id}":{"get":{"tags":["Drafts"],"summary":"Get Draft","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","mailboxId","kind","threadId","inReplyToMessageId","to","cc","bcc","subject","html","text","attachments","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"mailboxId":{"type":"string"},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiInboxV1DraftsById"},"patch":{"tags":["Drafts"],"summary":"Update Draft","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mailboxId":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"mailboxId":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"mailboxId":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","mailboxId","kind","threadId","inReplyToMessageId","to","cc","bcc","subject","html","text","attachments","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"mailboxId":{"type":"string"},"kind":{"type":"string","enum":["compose","reply","reply_all","forward"]},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"inReplyToMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"string"}}}},"createdAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]},"updatedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"string"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiInboxV1DraftsById"},"delete":{"tags":["Drafts"],"summary":"Delete Draft","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isStarred":{"type":"boolean"},"isSpam":{"type":"boolean"},"isImportant":{"type":"boolean"},"isPinned":{"type":"boolean"},"status":{"type":"string"},"deletedAt":{"anyOf":[{"type":"string"},{"type":"null"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiInboxV1DraftsById"}},"/api/inbox/v1/ai/subject":{"post":{"tags":["AI"],"summary":"Generate Subject","description":"Generate an email subject line from body text","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"body":{"type":"string"},"currentSubject":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"text":{"type":"string"},"body":{"type":"string"},"currentSubject":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"type":"string"},"body":{"type":"string"},"currentSubject":{"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1AiSubject","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/ai/update-subject":{"post":{"tags":["AI"],"summary":"Update Subject From Body","description":"Update and generate a subject line based on the email body","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"body":{"type":"string"},"currentSubject":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"text":{"type":"string"},"body":{"type":"string"},"currentSubject":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"type":"string"},"body":{"type":"string"},"currentSubject":{"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1AiUpdate-subject","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/ai/compose":{"post":{"tags":["AI"],"summary":"Generate Compose (stream)","description":"Stream a plain-text email body draft from a prompt and compose context — sender identity, recipients, subject, tone. Prompt optional when subject/recipients are present (text/plain)","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"subject":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"tone":{"type":"string"},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"subject":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"tone":{"type":"string"},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"subject":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"tone":{"type":"string"},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}}}}}}},"responses":{"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1AiCompose","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/ai/reply":{"post":{"tags":["AI"],"summary":"Generate Reply (stream)","description":"Stream a plain-text reply draft from thread context (text/plain)","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["threadId"],"properties":{"threadId":{"minLength":1,"type":"string"},"tone":{"type":"string"},"instruction":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["threadId"],"properties":{"threadId":{"minLength":1,"type":"string"},"tone":{"type":"string"},"instruction":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["threadId"],"properties":{"threadId":{"minLength":1,"type":"string"},"tone":{"type":"string"},"instruction":{"type":"string"}}}}}},"responses":{"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiInboxV1AiReply","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/inbox/v1/ws":{"ws":{"security":[{"apiKey":[]}],"operationId":"wsApiInboxV1Ws"}},"/api/domain/v1/create":{"post":{"tags":["Domains"],"summary":"Create Domain","description":"Creates a new domain","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { domain, domainError } = await reloop.domain.create({\n  domain: \"send.example.com\",\n  click_tracking: true,\n  open_tracking: true,\n  tls: \"opportunistic\",\n  sending_email: true,\n  receiving_email: false,\n});\n\nif (domainError) throw domainError;\n\nconsole.log(domain.id, domain.domain);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/domain/v1/create \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"domain\": \"send.example.com\",\"click_tracking\": true,\"open_tracking\": true,\"tls\": \"opportunistic\",\"sending_email\": true,\"receiving_email\": false}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.domain.create({\n  \"domain\": \"send.example.com\",\n  \"click_tracking\": True,\n  \"open_tracking\": True,\n  \"tls\": \"opportunistic\",\n  \"sending_email\": True,\n  \"receiving_email\": False,\n})\n\nif result.domain_error:\n    raise result.domain_error\n\nprint(result.domain[\"id\"], result.domain[\"domain\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$domain = $reloop->domain->create([\n    'domain' => 'send.example.com',\n    'click_tracking' => true,\n    'open_tracking' => true,\n    'tls' => 'opportunistic',\n    'sending_email' => true,\n    'receiving_email' => false,\n]);\necho $domain['id'] . ' ' . $domain['domain'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateDomainParams params = new CreateDomainParams();\nparams.domain = \"send.example.com\";\nparams.clickTracking = true;\nparams.openTracking = true;\nparams.tls = \"opportunistic\";\nparams.sendingEmail = true;\nparams.receivingEmail = false;\nvar domain = reloop.domain.create(params);\nSystem.out.println(domain.id + \" \" + domain.domain);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar domain = await reloop.Domain.CreateAsync(new CreateDomainParams(\n    Domain: \"send.example.com\",\n    ClickTracking: true,\n    OpenTracking: true,\n    Tls: \"opportunistic\",\n    SendingEmail: true,\n    ReceivingEmail: false\n));"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ndomain, _ := client.Domain.Create(reloop.CreateDomainParams{\n    Domain: \"send.example.com\",\n    ClickTracking: reloop.Bool(true),\n    OpenTracking: reloop.Bool(true),\n    Tls: reloop.String(\"opportunistic\"),\n    SendingEmail: reloop.Bool(true),\n    ReceivingEmail: reloop.Bool(false),\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.domain().create(CreateDomainParams {\n        domain: \"send.example.com\".to_string(),\n        click_tracking: Some(true),\n        open_tracking: Some(true),\n        tls: Some(\"opportunistic\".to_string()),\n        sending_email: Some(true),\n        receiving_email: Some(false),\n        ..Default::default()\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ndomain = reloop.domain.create(\n  domain: \"send.example.com\",\n  click_tracking: true,\n  open_tracking: true,\n  tls: \"opportunistic\",\n  sending_email: true,\n  receiving_email: false,\n)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, domain} = Reloop.Services.Domain.create(client, %{\n  domain: \"send.example.com\",\n  click_tracking: true,\n  open_tracking: true,\n  tls: \"opportunistic\",\n  sending_email: true,\n  receiving_email: false\n})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"domain":"send.example.com","click_tracking":true,"open_tracking":true,"tls":"opportunistic","sending_email":true,"receiving_email":true}],"type":"object","required":["domain"],"properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain name (e.g., send.reloop.com)","type":"string"},"click_tracking":{"default":true,"description":"Whether click tracking is enabled","type":"boolean"},"open_tracking":{"default":true,"description":"Whether open tracking is enabled","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"sending_email":{"default":true,"description":"Whether sending email is enabled","type":"boolean"},"receiving_email":{"default":true,"description":"Whether receiving email is enabled","type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"domain":"send.example.com","click_tracking":true,"open_tracking":true,"tls":"opportunistic","sending_email":true,"receiving_email":true}],"type":"object","required":["domain"],"properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain name (e.g., send.reloop.com)","type":"string"},"click_tracking":{"default":true,"description":"Whether click tracking is enabled","type":"boolean"},"open_tracking":{"default":true,"description":"Whether open tracking is enabled","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"sending_email":{"default":true,"description":"Whether sending email is enabled","type":"boolean"},"receiving_email":{"default":true,"description":"Whether receiving email is enabled","type":"boolean"}}}},"multipart/form-data":{"schema":{"examples":[{"domain":"send.example.com","click_tracking":true,"open_tracking":true,"tls":"opportunistic","sending_email":true,"receiving_email":true}],"type":"object","required":["domain"],"properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain name (e.g., send.reloop.com)","type":"string"},"click_tracking":{"default":true,"description":"Whether click tracking is enabled","type":"boolean"},"open_tracking":{"default":true,"description":"Whether open tracking is enabled","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"sending_email":{"default":true,"description":"Whether sending email is enabled","type":"boolean"},"receiving_email":{"default":true,"description":"Whether receiving email is enabled","type":"boolean"}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"type":"object","required":["object","id","domain","status","userVerifiedDomain","systemVerified","customReturnPath","trackingSubdomain","isClickTrackingEnabled","isOpenTrackingEnabled","tls","isTrackingDomain","isSendingEmailEnabled","isReceivingEmailEnabled","verificationFailedReason","dnsRecords","lastVerifiedAt","createdAt","updatedAt"],"properties":{"object":{"default":"domain","const":"domain","type":"string"},"id":{"description":"Unique domain identifier","type":"string"},"domain":{"description":"Domain name (e.g., send.reloop.com)","type":"string"},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"userVerifiedDomain":{"description":"Whether user has verified the domain","type":"boolean"},"systemVerified":{"description":"Whether system has verified the domain","type":"boolean"},"customReturnPath":{"description":"Custom return path subdomain for SPF and bounce handling","default":"inbound","type":"string"},"trackingSubdomain":{"description":"Custom tracking subdomain for click/open tracking","default":"tracking","type":"string"},"isClickTrackingEnabled":{"description":"Whether click tracking is enabled for the domain","type":"boolean"},"isOpenTrackingEnabled":{"description":"Whether open tracking is enabled for the domain","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"isTrackingDomain":{"description":"Whether domain is used for tracking","type":"boolean"},"smtpProviderId":{"description":"Bring-your-own SMTP relay used for this domain (null = Reloop delivery)","anyOf":[{"type":"string"},{"type":"null"}]},"isSendingEmailEnabled":{"description":"Whether sending email is enabled for the domain","type":"boolean"},"isReceivingEmailEnabled":{"description":"Whether receiving email is enabled for the domain","type":"boolean"},"verificationFailedReason":{"description":"Reason for verification failure","anyOf":[{"type":"string"},{"type":"null"}]},"sendingBlockedAt":{"description":"When Reloop blocked sending from this domain (null = not blocked)","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"sendingBlockedMessage":{"description":"Why Reloop blocked sending from this domain","anyOf":[{"type":"string"},{"type":"null"}]},"sentCount":{"description":"Number of emails sent using this domain","type":"number"},"registrarCreatedAt":{"description":"Registrar creation date from RDAP","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ageDays":{"description":"Domain age in days from registrar","type":"number"},"dailyCap":{"description":"Effective daily cap (override wins over age band)","anyOf":[{"type":"number"},{"type":"null"}]},"dailyCapOverride":{"description":"Admin override for the daily cap (null = automatic)","anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"description":"Emails sent today for this domain","type":"number"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"Age source: rdap or reloop","type":"string"},"dnsRecords":{"description":"DNS records for the domain","type":"array","items":{"examples":[{"id":"dns_123456789","recordType":"MX","recordTypeName":"MX","domain":"example.com","name":"@","value":"feedback-smtp.us-east-1.amazonses.com","ttl":"Auto","priority":10,"status":"active","createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"type":"object","required":["id","recordType","recordTypeName","domain","name","value","ttl","priority","verificationError","purpose","createdAt","status","updatedAt"],"properties":{"id":{"description":"Unique DNS record identifier","type":"string"},"recordType":{"type":"string","enum":["A","AAAA","CNAME","MX","TXT","SPF","DKIM","DMARC"]},"recordTypeName":{"type":"string","enum":["MX","SPF","DKIM","DMARC","CNAME"]},"domain":{"description":"Domain name","type":"string"},"name":{"description":"DNS record name","type":"string"},"value":{"description":"DNS record value","type":"string"},"ttl":{"description":"Time to live in seconds or Auto","type":"string"},"priority":{"description":"Record priority (for MX records)","anyOf":[{"type":"number"},{"type":"null"}]},"verificationError":{"description":"Verification error message","anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["sending","receiving","tracking"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"lastVerifiedAt":{"description":"Last verification timestamp","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiDomainV1Create","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/domain/v1/list":{"get":{"tags":["Domains"],"summary":"List domains","description":"Retrieves a paginated list of domains with optional filters","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { domains, domainError } = await reloop.domain.list({\n  page: 1,\n  limit: 10,\n  status: \"active\",\n});\n\nif (domainError) throw domainError;\n\nconsole.log(domains.total, domains.domains);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/domain/v1/list?page=1&limit=10&status=active\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.domain.list({\n  \"page\": 1,\n  \"limit\": 10,\n  \"status\": \"active\",\n})\n\nif result.domain_error:\n    raise result.domain_error\n\nprint(result.domains[\"total\"], result.domains[\"domains\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$domains = $reloop->domain->list([\n    'page' => 1,\n    'limit' => 10,\n    'status' => 'active',\n]);\necho $domains['total'] . ' ' . $domains['domains'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListDomainsParams params = new ListDomainsParams();\nparams.page = 1;\nparams.limit = 10;\nparams.status = \"active\";\nvar domains = reloop.domain.list(params);\nSystem.out.println(domains.total + \" \" + domains.domains);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar domains = await reloop.Domain.ListAsync(new ListDomainsParams\n{\n    Page = 1,\n    Limit = 10,\n    Status = \"active\",\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ndomains, _ := client.Domain.List(&reloop.ListDomainsParams{\n    Page: reloop.Int(1),\n    Limit: reloop.Int(10),\n    Status: reloop.DomainStatusActive,\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.domain().list(Some(ListDomainsParams {\n        page: Some(1),\n        limit: Some(10),\n        status: Some(DomainStatus::Active),\n        ..Default::default()\n    })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ndomains = reloop.domain.list(page: 1, limit: 10, status: \"active\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, domains} = Reloop.Services.Domain.list(client, %{page: 1, limit: 10, status: \"active\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"anyOf":[{"minimum":1,"default":0,"format":"numeric","type":"string"},{"minimum":1,"default":1,"type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":10,"anyOf":[{"minimum":1,"maximum":100,"default":0,"format":"numeric","type":"string"},{"minimum":1,"maximum":100,"default":10,"type":"number"}]}},{"name":"q","in":"query","required":false,"schema":{"description":"Search query for domain name","type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","verifying","active","suspended","failed"]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","domains","total","page","limit","hasMore","nextCursor","event"],"properties":{"object":{"default":"domain","const":"domain","type":"string"},"domains":{"type":"array","items":{"examples":[{"object":"domain","id":"domain_123456789","domain":"send.example.com","status":"active","userVerifiedDomain":true,"systemVerified":true,"customReturnPath":"inbound","isClickTrackingEnabled":true,"isOpenTrackingEnabled":true,"tls":"opportunistic","isTrackingDomain":false,"isSendingEmailEnabled":true,"isReceivingEmailEnabled":true,"dnsRecords":[{"id":"dns_123456789","recordType":"MX","recordTypeName":"MX","domain":"example.com","name":"@","value":"inbound.reloop.sh","ttl":"Auto","priority":10,"status":"active","createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"type":"object","required":["object","id","domain","status","userVerifiedDomain","systemVerified","customReturnPath","trackingSubdomain","isClickTrackingEnabled","isOpenTrackingEnabled","tls","isTrackingDomain","isSendingEmailEnabled","isReceivingEmailEnabled","verificationFailedReason","dnsRecords","lastVerifiedAt","createdAt","updatedAt"],"properties":{"object":{"default":"domain","const":"domain","type":"string"},"id":{"description":"Unique domain identifier","type":"string"},"domain":{"description":"Domain name (e.g., send.reloop.com)","type":"string"},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"userVerifiedDomain":{"description":"Whether user has verified the domain","type":"boolean"},"systemVerified":{"description":"Whether system has verified the domain","type":"boolean"},"customReturnPath":{"description":"Custom return path subdomain for SPF and bounce handling","default":"inbound","type":"string"},"trackingSubdomain":{"description":"Custom tracking subdomain for click/open tracking","default":"tracking","type":"string"},"isClickTrackingEnabled":{"description":"Whether click tracking is enabled for the domain","type":"boolean"},"isOpenTrackingEnabled":{"description":"Whether open tracking is enabled for the domain","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"isTrackingDomain":{"description":"Whether domain is used for tracking","type":"boolean"},"smtpProviderId":{"description":"Bring-your-own SMTP relay used for this domain (null = Reloop delivery)","anyOf":[{"type":"string"},{"type":"null"}]},"isSendingEmailEnabled":{"description":"Whether sending email is enabled for the domain","type":"boolean"},"isReceivingEmailEnabled":{"description":"Whether receiving email is enabled for the domain","type":"boolean"},"verificationFailedReason":{"description":"Reason for verification failure","anyOf":[{"type":"string"},{"type":"null"}]},"sendingBlockedAt":{"description":"When Reloop blocked sending from this domain (null = not blocked)","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"sendingBlockedMessage":{"description":"Why Reloop blocked sending from this domain","anyOf":[{"type":"string"},{"type":"null"}]},"sentCount":{"description":"Number of emails sent using this domain","type":"number"},"registrarCreatedAt":{"description":"Registrar creation date from RDAP","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ageDays":{"description":"Domain age in days from registrar","type":"number"},"dailyCap":{"description":"Effective daily cap (override wins over age band)","anyOf":[{"type":"number"},{"type":"null"}]},"dailyCapOverride":{"description":"Admin override for the daily cap (null = automatic)","anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"description":"Emails sent today for this domain","type":"number"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"Age source: rdap or reloop","type":"string"},"dnsRecords":{"description":"DNS records for the domain","type":"array","items":{"examples":[{"id":"dns_123456789","recordType":"MX","recordTypeName":"MX","domain":"example.com","name":"@","value":"feedback-smtp.us-east-1.amazonses.com","ttl":"Auto","priority":10,"status":"active","createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"type":"object","required":["id","recordType","recordTypeName","domain","name","value","ttl","priority","verificationError","purpose","createdAt","status","updatedAt"],"properties":{"id":{"description":"Unique DNS record identifier","type":"string"},"recordType":{"type":"string","enum":["A","AAAA","CNAME","MX","TXT","SPF","DKIM","DMARC"]},"recordTypeName":{"type":"string","enum":["MX","SPF","DKIM","DMARC","CNAME"]},"domain":{"description":"Domain name","type":"string"},"name":{"description":"DNS record name","type":"string"},"value":{"description":"DNS record value","type":"string"},"ttl":{"description":"Time to live in seconds or Auto","type":"string"},"priority":{"description":"Record priority (for MX records)","anyOf":[{"type":"number"},{"type":"null"}]},"verificationError":{"description":"Verification error message","anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["sending","receiving","tracking"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"lastVerifiedAt":{"description":"Last verification timestamp","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the list request","type":"string"}},"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiDomainV1List"}},"/api/domain/v1/sending-ips":{"get":{"tags":["Sending IPs"],"summary":"List dedicated sending IPs","description":"Returns dedicated sending IPs assigned to the active organization, including per-provider warmup progress.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["dedicatedIpCount","assignedCount","items"],"properties":{"dedicatedIpCount":{"type":"number"},"assignedCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","address","hostname","isPrimary","assignedAt","warmup"],"properties":{"id":{"type":"string"},"address":{"type":"string"},"hostname":{"type":"string"},"isPrimary":{"type":"boolean"},"assignedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"warmup":{"anyOf":[{"type":"object","required":["status","overflow","day","dailyCap","sentToday","providers","startedAt","completedAt","pausedAt"],"properties":{"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"active","type":"string"},{"const":"paused","type":"string"},{"const":"completed","type":"string"},{"const":"aborted","type":"string"}]},"overflow":{"anyOf":[{"const":"shared","type":"string"},{"const":"defer","type":"string"}]},"day":{"type":"number"},"dailyCap":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"type":"number"},"providers":{"type":"array","items":{"type":"object","required":["provider","dailyCap","sentToday"],"properties":{"provider":{"anyOf":[{"const":"gmail","type":"string"},{"const":"microsoft","type":"string"},{"const":"yahoo","type":"string"},{"const":"apple","type":"string"},{"const":"other","type":"string"}]},"dailyCap":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"type":"number"}}}},"startedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"completedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"pausedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}},{"type":"null"}]}}}}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiDomainV1Sending-ips"}},"/api/domain/v1/smtp-providers":{"get":{"tags":["SMTP Providers"],"summary":"List SMTP providers","description":"Returns the organization's bring-your-own SMTP relays. Passwords are never returned.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","limit","items"],"properties":{"object":{"const":"list","type":"string"},"limit":{"description":"Plan cap on providers (null = unlimited)","anyOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["object","id","name","host","port","security","username","hasPassword","domains","status","lastTestedAt","lastError","createdAt","updatedAt"],"properties":{"object":{"const":"smtp_provider","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"host":{"type":"string"},"port":{"type":"number"},"security":{"type":"string","enum":["starttls","none"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean"},"domains":{"description":"Sending domains relayed through this provider","type":"array","items":{"type":"object","required":["id","domain"],"properties":{"id":{"type":"string"},"domain":{"type":"string"}}}},"status":{"type":"string","enum":["unverified","ok","failing"]},"lastTestedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiDomainV1Smtp-providers"},"post":{"tags":["SMTP Providers"],"summary":"Create SMTP provider","description":"Stores a bring-your-own SMTP relay and sets up `domain` to send through it in one step: the domain is created (or reused) automatically, needs no Reloop DNS records, and the connection is tested immediately.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain","host","port","username","password"],"properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain you send from (the part after @ in From). Created automatically if it isn't in Reloop yet — no DNS setup needed.","type":"string"},"name":{"minLength":1,"maxLength":100,"description":"Defaults to the sending domain","type":"string"},"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain","host","port","username","password"],"properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain you send from (the part after @ in From). Created automatically if it isn't in Reloop yet — no DNS setup needed.","type":"string"},"name":{"minLength":1,"maxLength":100,"description":"Defaults to the sending domain","type":"string"},"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain","host","port","username","password"],"properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain you send from (the part after @ in From). Created automatically if it isn't in Reloop yet — no DNS setup needed.","type":"string"},"name":{"minLength":1,"maxLength":100,"description":"Defaults to the sending domain","type":"string"},"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"type":"string"}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"type":"object","required":["object","id","name","host","port","security","username","hasPassword","domains","status","lastTestedAt","lastError","createdAt","updatedAt"],"properties":{"object":{"const":"smtp_provider","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"host":{"type":"string"},"port":{"type":"number"},"security":{"type":"string","enum":["starttls","none"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean"},"domains":{"description":"Sending domains relayed through this provider","type":"array","items":{"type":"object","required":["id","domain"],"properties":{"id":{"type":"string"},"domain":{"type":"string"}}}},"status":{"type":"string","enum":["unverified","ok","failing"]},"lastTestedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiDomainV1Smtp-providers","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/domain/v1/smtp-providers/test-send":{"post":{"tags":["SMTP Providers"],"summary":"Send a test email","description":"Sends a real test email through SMTP credentials without saving them, so you can confirm the server accepts your login and From address. `ok: false` carries the server's error.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["host","port","username","password","from","to"],"properties":{"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"type":"string"},"from":{"format":"email","maxLength":320,"type":"string","description":"From address on the sending domain, e.g. hello@example.com"},"to":{"format":"email","maxLength":320,"type":"string","description":"Where to deliver the test email"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["host","port","username","password","from","to"],"properties":{"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"type":"string"},"from":{"format":"email","maxLength":320,"type":"string","description":"From address on the sending domain, e.g. hello@example.com"},"to":{"format":"email","maxLength":320,"type":"string","description":"Where to deliver the test email"}}}},"multipart/form-data":{"schema":{"type":"object","required":["host","port","username","password","from","to"],"properties":{"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"type":"string"},"from":{"format":"email","maxLength":320,"type":"string","description":"From address on the sending domain, e.g. hello@example.com"},"to":{"format":"email","maxLength":320,"type":"string","description":"Where to deliver the test email"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiDomainV1Smtp-providersTest-send","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/domain/v1/smtp-providers/{provider_id}/test":{"post":{"tags":["SMTP Providers"],"summary":"Test SMTP provider","description":"Connects to the relay, negotiates STARTTLS and authenticates. Pass `to` to also deliver a real test email (from `from`, default hello@ the first sending domain).","security":[{"apiKey":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"format":"email","maxLength":320,"type":"string","description":"Also send a real test email to this address"},"from":{"format":"email","maxLength":320,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"to":{"format":"email","maxLength":320,"type":"string","description":"Also send a real test email to this address"},"from":{"format":"email","maxLength":320,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"to":{"format":"email","maxLength":320,"type":"string","description":"Also send a real test email to this address"},"from":{"format":"email","maxLength":320,"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["ok","error","provider"],"properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"type":"object","required":["object","id","name","host","port","security","username","hasPassword","domains","status","lastTestedAt","lastError","createdAt","updatedAt"],"properties":{"object":{"const":"smtp_provider","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"host":{"type":"string"},"port":{"type":"number"},"security":{"type":"string","enum":["starttls","none"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean"},"domains":{"description":"Sending domains relayed through this provider","type":"array","items":{"type":"object","required":["id","domain"],"properties":{"id":{"type":"string"},"domain":{"type":"string"}}}},"status":{"type":"string","enum":["unverified","ok","failing"]},"lastTestedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiDomainV1Smtp-providersByProvider_idTest"}},"/api/domain/v1/smtp-providers/{provider_id}":{"patch":{"tags":["SMTP Providers"],"summary":"Update SMTP provider","description":"Updates a relay. Omit `password` to keep the stored one. Connection changes reset status to unverified.","security":[{"apiKey":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain you send from (the part after @ in From). Created automatically if it isn't in Reloop yet — no DNS setup needed.","type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"description":"Omit to keep the stored password","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain you send from (the part after @ in From). Created automatically if it isn't in Reloop yet — no DNS setup needed.","type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"description":"Omit to keep the stored password","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"domain":{"minLength":4,"maxLength":255,"pattern":"^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$","description":"Domain you send from (the part after @ in From). Created automatically if it isn't in Reloop yet — no DNS setup needed.","type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"host":{"minLength":1,"maxLength":255,"pattern":"^[A-Za-z0-9.-]+$","description":"SMTP server hostname, e.g. smtp.sendgrid.net","type":"string"},"port":{"minimum":1,"maximum":65535,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":65535,"type":"integer"}]},"security":{"type":"string","enum":["starttls","none"]},"username":{"minLength":1,"maxLength":255,"type":"string"},"password":{"minLength":1,"maxLength":1024,"description":"Omit to keep the stored password","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","name","host","port","security","username","hasPassword","domains","status","lastTestedAt","lastError","createdAt","updatedAt"],"properties":{"object":{"const":"smtp_provider","type":"string"},"id":{"type":"string"},"name":{"type":"string"},"host":{"type":"string"},"port":{"type":"number"},"security":{"type":"string","enum":["starttls","none"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean"},"domains":{"description":"Sending domains relayed through this provider","type":"array","items":{"type":"object","required":["id","domain"],"properties":{"id":{"type":"string"},"domain":{"type":"string"}}}},"status":{"type":"string","enum":["unverified","ok","failing"]},"lastTestedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiDomainV1Smtp-providersByProvider_id"},"delete":{"tags":["SMTP Providers"],"summary":"Delete SMTP provider","description":"Deletes a relay. Domains created only for it are removed; domains with Reloop DNS go back to sending through Reloop.","security":[{"apiKey":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","deleted"],"properties":{"object":{"const":"smtp_provider","type":"string"},"id":{"type":"string"},"deleted":{"const":true,"type":"boolean"}}}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiDomainV1Smtp-providersByProvider_id"}},"/api/domain/v1/nameservers/{domain_id}":{"get":{"tags":["Domains"],"summary":"Domain Nameservers","description":"Returns nameservers for a domain. Session-only — not available with API keys.","x-codeSamples":[{"id":"curl","lang":"bash","label":"cURL","source":"# Session cookie required (not available with API keys)\ncurl \"https://reloop.sh/api/domain/v1/nameservers/dom_123456789\" \\\n  -H \"Cookie: reloop.session_token=<session>\""}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","domainId","domain","nameservers","dnsProvider","event"],"properties":{"object":{"default":"domain_nameservers","const":"domain_nameservers","type":"string"},"domainId":{"type":"string"},"domain":{"type":"string"},"nameservers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"dnsProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the query","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"User is not a member of an organization","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"DNS records not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiDomainV1NameserversByDomain_id"}},"/api/domain/v1/verify/{domain_id}":{"post":{"tags":["Domains"],"summary":"Verify Domain","description":"Verifies DNS records for a domain to check if they are properly configured","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { domain, domainError } = await reloop.domain.verify(\"dom_123456789\");\n\nif (domainError) throw domainError;\n\nconsole.log(domain.id, domain.status);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/domain/v1/verify/dom_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.domain.verify(\"dom_123456789\")\n\nif result.domain_error:\n    raise result.domain_error\n\nprint(result.domain[\"id\"], result.domain[\"status\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$domain = $reloop->domain->verify('dom_123456789');\necho $domain['id'] . ' ' . $domain['status'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar domain = reloop.domain.verify(\"dom_123456789\");\nSystem.out.println(domain.id + \" \" + domain.status);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar result = await reloop.Domain.VerifyAsync(\"dom_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nresult, _ := client.Domain.Verify(\"dom_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.domain().verify(\"dom_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nresult = reloop.domain.verify(\"dom_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Domain.verify(client, \"dom_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"domain_123456789","status":"verifying"}],"type":"object","required":["id","status"],"properties":{"id":{"description":"Unique domain identifier","type":"string"},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"event":{"description":"Event ID","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Invalid domain format","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Domain not found","type":"string"}}}]}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Invalid domain format","type":"string"}}}]}}}}},"operationId":"postApiDomainV1VerifyByDomain_id"}},"/api/domain/v1/verify/{domain_id}/forward-dns":{"post":{"tags":["Domains"],"summary":"Forward DNS Records","description":"Forwards DNS configuration records of a domain to an email address. Session-only — not available with API keys.","parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"format":"email","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email"],"properties":{"email":{"format":"email","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"format":"email","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiDomainV1VerifyByDomain_idForward-dns"}},"/api/domain/v1/domain-connect/discover/{domain_id}":{"get":{"tags":["Domain Connect"],"summary":"Discover Domain Connect Support","description":"Checks if the domain's DNS provider supports Domain Connect and has onboarded the Reloop template","security":[{"apiKey":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["supported","templateSupported","provider"],"properties":{"supported":{"type":"boolean"},"templateSupported":{"type":"boolean"},"provider":{"anyOf":[{"type":"object","required":["id","name","displayName"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"}}},{"type":"null"}]},"error":{"type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiDomainV1Domain-connectDiscoverByDomain_id"}},"/api/domain/v1/domain-connect/apply-url/{domain_id}":{"get":{"tags":["Domain Connect"],"summary":"Get Domain Connect Apply URL","description":"Builds a signed Domain Connect apply URL that redirects the user to their DNS provider's consent page","security":[{"apiKey":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupIds","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["applyUrl","provider"],"properties":{"applyUrl":{"type":"string"},"provider":{"type":"object","required":["id","name","displayName"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"}}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiDomainV1Domain-connectApply-urlByDomain_id"}},"/api/domain/v1/domain-connect/callback":{"get":{"tags":["Domain Connect"],"summary":"Domain Connect Callback","description":"Handles the redirect from the DNS provider after the user approves or denies DNS record changes","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"error","in":"query","required":false,"schema":{"type":"string"}},{"name":"error_description","in":"query","required":false,"schema":{"type":"string"}}],"operationId":"getApiDomainV1Domain-connectCallback","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/domain/v1/{domain_id}":{"get":{"tags":["Domains"],"summary":"Retrieve Domain","description":"Retrieves a domain by its ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { domain, domainError } = await reloop.domain.get(\"dom_123456789\");\n\nif (domainError) throw domainError;\n\nconsole.log(domain.id, domain.domain, domain.status);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/domain/v1/dom_123456789\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.domain.get(\"dom_123456789\")\n\nif result.domain_error:\n    raise result.domain_error\n\nprint(result.domain[\"id\"], result.domain[\"domain\"], result.domain[\"status\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$domain = $reloop->domain->get('dom_123456789');\necho $domain['id'] . ' ' . $domain['domain'] . ' ' . $domain['status'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar domain = reloop.domain.get(\"dom_123456789\");\nSystem.out.println(domain.id + \" \" + domain.domain + \" \" + domain.status);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar result = await reloop.Domain.GetAsync(\"dom_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nresult, _ := client.Domain.Get(\"dom_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.domain().get(\"dom_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nresult = reloop.domain.get(\"dom_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Domain.get(client, \"dom_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","domain","status","userVerifiedDomain","systemVerified","customReturnPath","trackingSubdomain","isClickTrackingEnabled","isOpenTrackingEnabled","tls","isTrackingDomain","isSendingEmailEnabled","isReceivingEmailEnabled","verificationFailedReason","dnsRecords","lastVerifiedAt","createdAt","updatedAt"],"properties":{"object":{"default":"domain","const":"domain","type":"string"},"id":{"description":"Unique domain identifier","type":"string"},"domain":{"description":"Domain name (e.g., send.reloop.com)","type":"string"},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"userVerifiedDomain":{"description":"Whether user has verified the domain","type":"boolean"},"systemVerified":{"description":"Whether system has verified the domain","type":"boolean"},"customReturnPath":{"description":"Custom return path subdomain for SPF and bounce handling","default":"inbound","type":"string"},"trackingSubdomain":{"description":"Custom tracking subdomain for click/open tracking","default":"tracking","type":"string"},"isClickTrackingEnabled":{"description":"Whether click tracking is enabled for the domain","type":"boolean"},"isOpenTrackingEnabled":{"description":"Whether open tracking is enabled for the domain","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"isTrackingDomain":{"description":"Whether domain is used for tracking","type":"boolean"},"smtpProviderId":{"description":"Bring-your-own SMTP relay used for this domain (null = Reloop delivery)","anyOf":[{"type":"string"},{"type":"null"}]},"isSendingEmailEnabled":{"description":"Whether sending email is enabled for the domain","type":"boolean"},"isReceivingEmailEnabled":{"description":"Whether receiving email is enabled for the domain","type":"boolean"},"verificationFailedReason":{"description":"Reason for verification failure","anyOf":[{"type":"string"},{"type":"null"}]},"sendingBlockedAt":{"description":"When Reloop blocked sending from this domain (null = not blocked)","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"sendingBlockedMessage":{"description":"Why Reloop blocked sending from this domain","anyOf":[{"type":"string"},{"type":"null"}]},"sentCount":{"description":"Number of emails sent using this domain","type":"number"},"registrarCreatedAt":{"description":"Registrar creation date from RDAP","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ageDays":{"description":"Domain age in days from registrar","type":"number"},"dailyCap":{"description":"Effective daily cap (override wins over age band)","anyOf":[{"type":"number"},{"type":"null"}]},"dailyCapOverride":{"description":"Admin override for the daily cap (null = automatic)","anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"description":"Emails sent today for this domain","type":"number"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"Age source: rdap or reloop","type":"string"},"dnsRecords":{"description":"DNS records for the domain","type":"array","items":{"examples":[{"id":"dns_123456789","recordType":"MX","recordTypeName":"MX","domain":"example.com","name":"@","value":"feedback-smtp.us-east-1.amazonses.com","ttl":"Auto","priority":10,"status":"active","createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"type":"object","required":["id","recordType","recordTypeName","domain","name","value","ttl","priority","verificationError","purpose","createdAt","status","updatedAt"],"properties":{"id":{"description":"Unique DNS record identifier","type":"string"},"recordType":{"type":"string","enum":["A","AAAA","CNAME","MX","TXT","SPF","DKIM","DMARC"]},"recordTypeName":{"type":"string","enum":["MX","SPF","DKIM","DMARC","CNAME"]},"domain":{"description":"Domain name","type":"string"},"name":{"description":"DNS record name","type":"string"},"value":{"description":"DNS record value","type":"string"},"ttl":{"description":"Time to live in seconds or Auto","type":"string"},"priority":{"description":"Record priority (for MX records)","anyOf":[{"type":"number"},{"type":"null"}]},"verificationError":{"description":"Verification error message","anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["sending","receiving","tracking"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"lastVerifiedAt":{"description":"Last verification timestamp","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Invalid domain format","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Domain not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiDomainV1ByDomain_id"},"patch":{"tags":["Domains"],"summary":"Update domain","description":"Updates a domain","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { domain, domainError } = await reloop.domain.update(\"dom_123456789\", {\n  click_tracking: false,\n  open_tracking: true,\n  sending_email: true,\n});\n\nif (domainError) throw domainError;\n\nconsole.log(domain.id, domain.isClickTrackingEnabled);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/domain/v1/dom_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"click_tracking\": false}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.domain.update(\"dom_123456789\", {\n  \"click_tracking\": False,\n  \"open_tracking\": True,\n  \"sending_email\": True,\n})\n\nif result.domain_error:\n    raise result.domain_error\n\nprint(result.domain[\"id\"], result.domain[\"isClickTrackingEnabled\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$domain = $reloop->domain->update('dom_123456789', [\n    'click_tracking' => false,\n    'open_tracking' => true,\n    'sending_email' => true,\n]);\necho $domain['id'] . ' ' . $domain['isClickTrackingEnabled'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateDomainParams params = new UpdateDomainParams();\nparams.clickTracking = false;\nparams.openTracking = true;\nparams.sendingEmail = true;\nvar domain = reloop.domain.update(\"dom_123456789\", params);\nSystem.out.println(domain.id + \" \" + domain.isClickTrackingEnabled);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar domain = await reloop.Domain.UpdateAsync(\"dom_123456789\", new UpdateDomainParams\n{\n    ClickTracking = false,\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ndomain, _ := client.Domain.Update(\"dom_123456789\", reloop.UpdateDomainParams{\n    ClickTracking: reloop.Bool(false),\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.domain().update(\"dom_123456789\", UpdateDomainParams {\n        click_tracking: Some(false),\n        ..Default::default()\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ndomain = reloop.domain.update(\"dom_123456789\", click_tracking: false)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, domain} = Reloop.Services.Domain.update(client, \"dom_123456789\", %{click_tracking: false})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"click_tracking":true,"open_tracking":true,"sending_email":true,"receiving_email":false}],"type":"object","properties":{"click_tracking":{"description":"Whether click tracking is enabled","type":"boolean"},"open_tracking":{"description":"Whether open tracking is enabled","type":"boolean"},"sending_email":{"description":"Whether sending email is enabled","type":"boolean"},"receiving_email":{"description":"Whether receiving email is enabled","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"smtp_provider_id":{"description":"Relay mail for this domain through a bring-your-own SMTP provider. null = send through Reloop.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"click_tracking":true,"open_tracking":true,"sending_email":true,"receiving_email":false}],"type":"object","properties":{"click_tracking":{"description":"Whether click tracking is enabled","type":"boolean"},"open_tracking":{"description":"Whether open tracking is enabled","type":"boolean"},"sending_email":{"description":"Whether sending email is enabled","type":"boolean"},"receiving_email":{"description":"Whether receiving email is enabled","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"smtp_provider_id":{"description":"Relay mail for this domain through a bring-your-own SMTP provider. null = send through Reloop.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"examples":[{"click_tracking":true,"open_tracking":true,"sending_email":true,"receiving_email":false}],"type":"object","properties":{"click_tracking":{"description":"Whether click tracking is enabled","type":"boolean"},"open_tracking":{"description":"Whether open tracking is enabled","type":"boolean"},"sending_email":{"description":"Whether sending email is enabled","type":"boolean"},"receiving_email":{"description":"Whether receiving email is enabled","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"smtp_provider_id":{"description":"Relay mail for this domain through a bring-your-own SMTP provider. null = send through Reloop.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","domain","status","userVerifiedDomain","systemVerified","customReturnPath","trackingSubdomain","isClickTrackingEnabled","isOpenTrackingEnabled","tls","isTrackingDomain","isSendingEmailEnabled","isReceivingEmailEnabled","verificationFailedReason","dnsRecords","lastVerifiedAt","createdAt","updatedAt"],"properties":{"object":{"default":"domain","const":"domain","type":"string"},"id":{"description":"Unique domain identifier","type":"string"},"domain":{"description":"Domain name (e.g., send.reloop.com)","type":"string"},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"userVerifiedDomain":{"description":"Whether user has verified the domain","type":"boolean"},"systemVerified":{"description":"Whether system has verified the domain","type":"boolean"},"customReturnPath":{"description":"Custom return path subdomain for SPF and bounce handling","default":"inbound","type":"string"},"trackingSubdomain":{"description":"Custom tracking subdomain for click/open tracking","default":"tracking","type":"string"},"isClickTrackingEnabled":{"description":"Whether click tracking is enabled for the domain","type":"boolean"},"isOpenTrackingEnabled":{"description":"Whether open tracking is enabled for the domain","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"isTrackingDomain":{"description":"Whether domain is used for tracking","type":"boolean"},"smtpProviderId":{"description":"Bring-your-own SMTP relay used for this domain (null = Reloop delivery)","anyOf":[{"type":"string"},{"type":"null"}]},"isSendingEmailEnabled":{"description":"Whether sending email is enabled for the domain","type":"boolean"},"isReceivingEmailEnabled":{"description":"Whether receiving email is enabled for the domain","type":"boolean"},"verificationFailedReason":{"description":"Reason for verification failure","anyOf":[{"type":"string"},{"type":"null"}]},"sendingBlockedAt":{"description":"When Reloop blocked sending from this domain (null = not blocked)","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"sendingBlockedMessage":{"description":"Why Reloop blocked sending from this domain","anyOf":[{"type":"string"},{"type":"null"}]},"sentCount":{"description":"Number of emails sent using this domain","type":"number"},"registrarCreatedAt":{"description":"Registrar creation date from RDAP","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ageDays":{"description":"Domain age in days from registrar","type":"number"},"dailyCap":{"description":"Effective daily cap (override wins over age band)","anyOf":[{"type":"number"},{"type":"null"}]},"dailyCapOverride":{"description":"Admin override for the daily cap (null = automatic)","anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"description":"Emails sent today for this domain","type":"number"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"Age source: rdap or reloop","type":"string"},"dnsRecords":{"description":"DNS records for the domain","type":"array","items":{"examples":[{"id":"dns_123456789","recordType":"MX","recordTypeName":"MX","domain":"example.com","name":"@","value":"feedback-smtp.us-east-1.amazonses.com","ttl":"Auto","priority":10,"status":"active","createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"type":"object","required":["id","recordType","recordTypeName","domain","name","value","ttl","priority","verificationError","purpose","createdAt","status","updatedAt"],"properties":{"id":{"description":"Unique DNS record identifier","type":"string"},"recordType":{"type":"string","enum":["A","AAAA","CNAME","MX","TXT","SPF","DKIM","DMARC"]},"recordTypeName":{"type":"string","enum":["MX","SPF","DKIM","DMARC","CNAME"]},"domain":{"description":"Domain name","type":"string"},"name":{"description":"DNS record name","type":"string"},"value":{"description":"DNS record value","type":"string"},"ttl":{"description":"Time to live in seconds or Auto","type":"string"},"priority":{"description":"Record priority (for MX records)","anyOf":[{"type":"number"},{"type":"null"}]},"verificationError":{"description":"Verification error message","anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["sending","receiving","tracking"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"lastVerifiedAt":{"description":"Last verification timestamp","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Domain not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiDomainV1ByDomain_id"},"delete":{"tags":["Domains"],"summary":"Delete Domain","description":"Deletes a domain and all its associated data","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { domain, domainError } = await reloop.domain.delete(\"dom_123456789\");\n\nif (domainError) throw domainError;\n\nconsole.log(domain.id);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/domain/v1/dom_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.domain.delete(\"dom_123456789\")\n\nif result.domain_error:\n    raise result.domain_error\n\nprint(result.domain[\"id\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$domain = $reloop->domain->delete('dom_123456789');\necho $domain['id'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar domain = reloop.domain.delete(\"dom_123456789\");\nSystem.out.println(domain.id);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar result = await reloop.Domain.DeleteAsync(\"dom_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nresult, _ := client.Domain.Delete(\"dom_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.domain().delete(\"dom_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nresult = reloop.domain.delete(\"dom_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Domain.delete(client, \"dom_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","domain","status","userVerifiedDomain","systemVerified","customReturnPath","trackingSubdomain","isClickTrackingEnabled","isOpenTrackingEnabled","tls","isTrackingDomain","isSendingEmailEnabled","isReceivingEmailEnabled","verificationFailedReason","dnsRecords","lastVerifiedAt","createdAt","updatedAt"],"properties":{"object":{"default":"domain","const":"domain","type":"string"},"id":{"description":"Unique domain identifier","type":"string"},"domain":{"description":"Domain name (e.g., send.reloop.com)","type":"string"},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"userVerifiedDomain":{"description":"Whether user has verified the domain","type":"boolean"},"systemVerified":{"description":"Whether system has verified the domain","type":"boolean"},"customReturnPath":{"description":"Custom return path subdomain for SPF and bounce handling","default":"inbound","type":"string"},"trackingSubdomain":{"description":"Custom tracking subdomain for click/open tracking","default":"tracking","type":"string"},"isClickTrackingEnabled":{"description":"Whether click tracking is enabled for the domain","type":"boolean"},"isOpenTrackingEnabled":{"description":"Whether open tracking is enabled for the domain","type":"boolean"},"tls":{"type":"string","enum":["opportunistic","enforced"]},"isTrackingDomain":{"description":"Whether domain is used for tracking","type":"boolean"},"smtpProviderId":{"description":"Bring-your-own SMTP relay used for this domain (null = Reloop delivery)","anyOf":[{"type":"string"},{"type":"null"}]},"isSendingEmailEnabled":{"description":"Whether sending email is enabled for the domain","type":"boolean"},"isReceivingEmailEnabled":{"description":"Whether receiving email is enabled for the domain","type":"boolean"},"verificationFailedReason":{"description":"Reason for verification failure","anyOf":[{"type":"string"},{"type":"null"}]},"sendingBlockedAt":{"description":"When Reloop blocked sending from this domain (null = not blocked)","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"sendingBlockedMessage":{"description":"Why Reloop blocked sending from this domain","anyOf":[{"type":"string"},{"type":"null"}]},"sentCount":{"description":"Number of emails sent using this domain","type":"number"},"registrarCreatedAt":{"description":"Registrar creation date from RDAP","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ageDays":{"description":"Domain age in days from registrar","type":"number"},"dailyCap":{"description":"Effective daily cap (override wins over age band)","anyOf":[{"type":"number"},{"type":"null"}]},"dailyCapOverride":{"description":"Admin override for the daily cap (null = automatic)","anyOf":[{"type":"number"},{"type":"null"}]},"sentToday":{"description":"Emails sent today for this domain","type":"number"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"description":"Age source: rdap or reloop","type":"string"},"dnsRecords":{"description":"DNS records for the domain","type":"array","items":{"examples":[{"id":"dns_123456789","recordType":"MX","recordTypeName":"MX","domain":"example.com","name":"@","value":"feedback-smtp.us-east-1.amazonses.com","ttl":"Auto","priority":10,"status":"active","createdAt":"2026-03-30T10:00:00.000Z","updatedAt":"2026-03-30T10:00:00.000Z"}],"type":"object","required":["id","recordType","recordTypeName","domain","name","value","ttl","priority","verificationError","purpose","createdAt","status","updatedAt"],"properties":{"id":{"description":"Unique DNS record identifier","type":"string"},"recordType":{"type":"string","enum":["A","AAAA","CNAME","MX","TXT","SPF","DKIM","DMARC"]},"recordTypeName":{"type":"string","enum":["MX","SPF","DKIM","DMARC","CNAME"]},"domain":{"description":"Domain name","type":"string"},"name":{"description":"DNS record name","type":"string"},"value":{"description":"DNS record value","type":"string"},"ttl":{"description":"Time to live in seconds or Auto","type":"string"},"priority":{"description":"Record priority (for MX records)","anyOf":[{"type":"number"},{"type":"null"}]},"verificationError":{"description":"Verification error message","anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["sending","receiving","tracking"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"string","enum":["pending","verifying","active","suspended","failed"]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"lastVerifiedAt":{"description":"Last verification timestamp","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiDomainV1ByDomain_id"}},"/api/api-key/v1/":{"post":{"tags":["API Keys"],"summary":"Create API Key","description":"Creates a new API key","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.create({\n  name: \"Production Key\",\n});\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.key);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/api-key/v1/ \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Production Key\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.create({\n  \"name\": \"Production Key\",\n})\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"key\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->create([\n    'name' => 'Production Key',\n]);\necho $apiKey['id'] . ' ' . $apiKey['key'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateApiKeyParams params = new CreateApiKeyParams();\nparams.name = \"Production Key\";\nvar apiKey = reloop.apiKey.create(params);\nSystem.out.println(apiKey.id + \" \" + apiKey.key);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = await reloop.ApiKeys.CreateAsync(new CreateApiKeyParams(Name: \"Production Key\"));"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\napiKey, _ := client.ApiKeys.Create(reloop.CreateApiKeyParams{\n    Name: \"Production Key\",\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().create(CreateApiKeyParams {\n        name: \"Production Key\".to_string(),\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\napi_key = reloop.api_keys.create(name: \"Production Key\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, api_key} = Reloop.Services.ApiKey.create(client, %{name: \"Production Key\"})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Organization wide key"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Name for the API key","type":"string"},"scope":{"maxItems":100,"description":"Restrict the key to these domains or addresses (sending and IMAP). Empty or omitted means full access.","type":"array","items":{"type":"object","required":["domainId"],"properties":{"domainId":{"description":"Domain the key may send from / open mailboxes on","type":"string"},"email":{"description":"One exact address on that domain; omit or null to allow every address on it","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Organization wide key"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Name for the API key","type":"string"},"scope":{"maxItems":100,"description":"Restrict the key to these domains or addresses (sending and IMAP). Empty or omitted means full access.","type":"array","items":{"type":"object","required":["domainId"],"properties":{"domainId":{"description":"Domain the key may send from / open mailboxes on","type":"string"},"email":{"description":"One exact address on that domain; omit or null to allow every address on it","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Organization wide key"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Name for the API key","type":"string"},"scope":{"maxItems":100,"description":"Restrict the key to these domains or addresses (sending and IMAP). Empty or omitted means full access.","type":"array","items":{"type":"object","required":["domainId"],"properties":{"domainId":{"description":"Domain the key may send from / open mailboxes on","type":"string"},"email":{"description":"One exact address on that domain; omit or null to allow every address on it","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","name":"Production API Key","key":"rl_live_abc123def456ghi789","enabled":true,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write"}],"type":"object","required":["id","name","key","enabled","createdAt","updatedAt","permissions","scope","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"key":{"description":"Full API key (only shown once)","type":"string"},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiApi-keyV1"},"get":{"tags":["API Keys"],"summary":"List API keys","description":"Lists all API keys for the user's organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKeys, apiKeyError } = await reloop.apiKey.list({\n  page: 1,\n  limit: 10,\n  enabled: true,\n});\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKeys.total, apiKeys.apiKeys);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/api-key/v1/?page=1&limit=10\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.list({\n  \"page\": 1,\n  \"limit\": 10,\n  \"enabled\": True,\n})\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_keys[\"total\"], result.api_keys[\"apiKeys\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKeys = $reloop->apiKey->list([\n    'page' => 1,\n    'limit' => 10,\n    'enabled' => true,\n]);\necho $apiKeys['total'] . ' ' . $apiKeys['apiKeys'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nApiKeyListParams params = new ApiKeyListParams();\nparams.page = 1;\nparams.limit = 10;\nparams.enabled = true;\nvar apiKeys = reloop.apiKey.list(params);\nSystem.out.println(apiKeys.total + \" \" + apiKeys.apiKeys);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKeys = await reloop.ApiKeys.ListAsync(new ApiKeyListParams\n{\n    Page = 1,\n    Limit = 10,\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\napiKeys, _ := client.ApiKeys.List(&reloop.ApiKeyListParams{\n    Page: reloop.Int(1),\n    Limit: reloop.Int(10),\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().list(Some(ApiKeyListParams {\n        page: Some(1),\n        limit: Some(10),\n        ..Default::default()\n    })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\napi_keys = reloop.api_keys.list(page: 1, limit: 10)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, api_keys} = Reloop.Services.ApiKey.list(client, %{page: 1, limit: 10})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"description":"Page number for pagination","anyOf":[{"minimum":1,"default":0,"description":"Page number for pagination","format":"numeric","type":"string"},{"minimum":1,"default":1,"description":"Page number for pagination","type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":10,"description":"Number of keys to return per page","anyOf":[{"minimum":1,"maximum":100,"default":0,"description":"Number of keys to return per page","format":"numeric","type":"string"},{"minimum":1,"maximum":100,"default":10,"description":"Number of keys to return per page","type":"number"}]}},{"name":"enabled","in":"query","required":false,"schema":{"description":"Filter keys by their enabled status","anyOf":[{"description":"Filter keys by their enabled status","type":"boolean"},{"description":"Filter keys by their enabled status","format":"boolean","default":false,"type":"string"}]}},{"name":"userId","in":"query","required":false,"schema":{"description":"Filter keys created by a specific user ID","type":"string"}},{"name":"q","in":"query","required":false,"schema":{"description":"Search query to filter keys by name","type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"description":"Comma-separated sort rules as field:order (e.g. createdAt:desc,name:asc). Fields: name, prefix, lastUsed, status, createdAt. Orders: asc, desc.","pattern":"^(name|prefix|lastUsed|status|createdAt):(asc|desc)(,(name|prefix|lastUsed|status|createdAt):(asc|desc))*$","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","apiKeys","total","page","limit","event"],"properties":{"object":{"description":"Object type, always 'api_key'","const":"api_key","type":"string"},"apiKeys":{"description":"List of API keys matching the query","type":"array","items":{"examples":[{"id":"key_123456789","name":"Production API Key","start":"rl_live","prefix":"rl","enabled":true,"requestCount":150,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write","createdBy":{"id":"user_123","name":"John Doe","email":"john@example.com"}}],"type":"object","required":["id","name","start","prefix","refillInterval","refillAmount","lastRefillAt","enabled","rateLimitEnabled","rateLimitTimeWindow","rateLimitMax","requestCount","remaining","lastRequest","expiresAt","createdAt","updatedAt","permissions","scope","metadata","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Start of the API key (for display)","anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"description":"API key prefix","anyOf":[{"type":"string"},{"type":"null"}]},"refillInterval":{"description":"Refill interval in milliseconds","anyOf":[{"type":"number"},{"type":"null"}]},"refillAmount":{"description":"Amount to refill per interval","anyOf":[{"type":"number"},{"type":"null"}]},"lastRefillAt":{"description":"Last refill timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"rateLimitEnabled":{"description":"Whether rate limiting is enabled","type":"boolean"},"rateLimitTimeWindow":{"description":"Rate limit time window in milliseconds","type":"number"},"rateLimitMax":{"description":"Maximum requests per time window","type":"number"},"requestCount":{"description":"Total request count","type":"number"},"remaining":{"description":"Remaining requests","anyOf":[{"type":"number"},{"type":"null"}]},"lastRequest":{"description":"Last request timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"description":"Expiration date","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"metadata":{"description":"JSON metadata string","anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"type":"object","required":["id","name","image","email"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User name","anyOf":[{"type":"string"},{"type":"null"}]},"image":{"description":"User avatar","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"User email","type":"string"}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}},"total":{"description":"Total count of API keys","type":"number"},"page":{"description":"Current page index","type":"number"},"limit":{"description":"Maximum number of keys returned","type":"number"},"event":{"description":"Event ID for the list operation","type":"string"}},"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiApi-keyV1"}},"/api/api-key/v1/{api_key_id}":{"get":{"tags":["API Keys"],"summary":"Retrieve API key","description":"Retrieves an API key by its ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.get(\"key_123456789\");\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.name, apiKey.enabled);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/api-key/v1/key_123456789\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.get(\"key_123456789\")\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"name\"], result.api_key[\"enabled\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->get('key_123456789');\necho $apiKey['id'] . ' ' . $apiKey['name'] . ' ' . $apiKey['enabled'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = reloop.apiKey.get(\"key_123456789\");\nSystem.out.println(apiKey.id + \" \" + apiKey.name + \" \" + apiKey.enabled);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.ApiKeys.GetAsync(\"key_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.ApiKeys.Get(\"key_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().get(\"key_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.api_keys.get(\"key_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ApiKey.get(client, \"key_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"description":"API Key identifier","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","name":"Production API Key","start":"rl_live","prefix":"rl","enabled":true,"requestCount":150,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write","createdBy":{"id":"user_123","name":"John Doe","email":"john@example.com"}}],"type":"object","required":["id","name","start","prefix","refillInterval","refillAmount","lastRefillAt","enabled","rateLimitEnabled","rateLimitTimeWindow","rateLimitMax","requestCount","remaining","lastRequest","expiresAt","createdAt","updatedAt","permissions","scope","metadata","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Start of the API key (for display)","anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"description":"API key prefix","anyOf":[{"type":"string"},{"type":"null"}]},"refillInterval":{"description":"Refill interval in milliseconds","anyOf":[{"type":"number"},{"type":"null"}]},"refillAmount":{"description":"Amount to refill per interval","anyOf":[{"type":"number"},{"type":"null"}]},"lastRefillAt":{"description":"Last refill timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"rateLimitEnabled":{"description":"Whether rate limiting is enabled","type":"boolean"},"rateLimitTimeWindow":{"description":"Rate limit time window in milliseconds","type":"number"},"rateLimitMax":{"description":"Maximum requests per time window","type":"number"},"requestCount":{"description":"Total request count","type":"number"},"remaining":{"description":"Remaining requests","anyOf":[{"type":"number"},{"type":"null"}]},"lastRequest":{"description":"Last request timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"description":"Expiration date","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"metadata":{"description":"JSON metadata string","anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"type":"object","required":["id","name","image","email"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User name","anyOf":[{"type":"string"},{"type":"null"}]},"image":{"description":"User avatar","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"User email","type":"string"}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"API key not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiApi-keyV1ByApi_key_id"},"patch":{"tags":["API Keys"],"summary":"Update API key","description":"Updates an existing API key","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.update(\"key_123456789\", {\n  name: \"Updated Key Name\",\n});\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/api-key/v1/key_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Updated Key Name\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.update(\"key_123456789\", {\n  \"name\": \"Updated Key Name\",\n})\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->update('key_123456789', [\n    'name' => 'Updated Key Name',\n]);\necho $apiKey['id'] . ' ' . $apiKey['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateApiKeyParams params = new UpdateApiKeyParams();\nparams.name = \"Updated Key Name\";\nvar apiKey = reloop.apiKey.update(\"key_123456789\", params);\nSystem.out.println(apiKey.id + \" \" + apiKey.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = await reloop.ApiKeys.UpdateAsync(\"key_123456789\", new UpdateApiKeyParams(Name: \"Updated Key Name\"));"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\napiKey, _ := client.ApiKeys.Update(\"key_123456789\", reloop.UpdateApiKeyParams{\n    Name: \"Updated Key Name\",\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().update(\"key_123456789\", UpdateApiKeyParams {\n        name: \"Updated Key Name\".to_string(),\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\napi_key = reloop.api_keys.update(\"key_123456789\", name: \"Updated Key Name\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, api_key} = Reloop.Services.ApiKey.update(client, \"key_123456789\", %{name: \"Updated Key Name\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"description":"API Key identifier","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Updated API Key Name"}],"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Name for the API key","type":"string"},"scope":{"maxItems":100,"description":"Restrict the key to these domains or addresses (sending and IMAP). Empty or omitted means full access.","type":"array","items":{"type":"object","required":["domainId"],"properties":{"domainId":{"description":"Domain the key may send from / open mailboxes on","type":"string"},"email":{"description":"One exact address on that domain; omit or null to allow every address on it","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Updated API Key Name"}],"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Name for the API key","type":"string"},"scope":{"maxItems":100,"description":"Restrict the key to these domains or addresses (sending and IMAP). Empty or omitted means full access.","type":"array","items":{"type":"object","required":["domainId"],"properties":{"domainId":{"description":"Domain the key may send from / open mailboxes on","type":"string"},"email":{"description":"One exact address on that domain; omit or null to allow every address on it","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Updated API Key Name"}],"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Name for the API key","type":"string"},"scope":{"maxItems":100,"description":"Restrict the key to these domains or addresses (sending and IMAP). Empty or omitted means full access.","type":"array","items":{"type":"object","required":["domainId"],"properties":{"domainId":{"description":"Domain the key may send from / open mailboxes on","type":"string"},"email":{"description":"One exact address on that domain; omit or null to allow every address on it","anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","name":"Production API Key","start":"rl_live","prefix":"rl","enabled":true,"requestCount":150,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write","createdBy":{"id":"user_123","name":"John Doe","email":"john@example.com"}}],"type":"object","required":["id","name","start","prefix","refillInterval","refillAmount","lastRefillAt","enabled","rateLimitEnabled","rateLimitTimeWindow","rateLimitMax","requestCount","remaining","lastRequest","expiresAt","createdAt","updatedAt","permissions","scope","metadata","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Start of the API key (for display)","anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"description":"API key prefix","anyOf":[{"type":"string"},{"type":"null"}]},"refillInterval":{"description":"Refill interval in milliseconds","anyOf":[{"type":"number"},{"type":"null"}]},"refillAmount":{"description":"Amount to refill per interval","anyOf":[{"type":"number"},{"type":"null"}]},"lastRefillAt":{"description":"Last refill timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"rateLimitEnabled":{"description":"Whether rate limiting is enabled","type":"boolean"},"rateLimitTimeWindow":{"description":"Rate limit time window in milliseconds","type":"number"},"rateLimitMax":{"description":"Maximum requests per time window","type":"number"},"requestCount":{"description":"Total request count","type":"number"},"remaining":{"description":"Remaining requests","anyOf":[{"type":"number"},{"type":"null"}]},"lastRequest":{"description":"Last request timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"description":"Expiration date","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"metadata":{"description":"JSON metadata string","anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"type":"object","required":["id","name","image","email"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User name","anyOf":[{"type":"string"},{"type":"null"}]},"image":{"description":"User avatar","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"User email","type":"string"}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"API key not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiApi-keyV1ByApi_key_id"},"delete":{"tags":["API Keys"],"summary":"Delete API key","description":"Deletes an API key","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.delete(\"key_123456789\");\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.message);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/api-key/v1/key_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.delete(\"key_123456789\")\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"message\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->delete('key_123456789');\necho $apiKey['id'] . ' ' . $apiKey['message'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = reloop.apiKey.delete(\"key_123456789\");\nSystem.out.println(apiKey.id + \" \" + apiKey.message);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.ApiKeys.DeleteAsync(\"key_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.ApiKeys.Delete(\"key_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().delete(\"key_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.api_keys.delete(\"key_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ApiKey.delete(client, \"key_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"description":"API Key identifier","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","message":"API key deleted successfully"}],"type":"object","required":["id","message","object","event"],"properties":{"id":{"description":"Deleted API key identifier","type":"string"},"message":{"description":"Success message","type":"string"},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"API key not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiApi-keyV1ByApi_key_id"}},"/api/api-key/v1/rotate/{api_key_id}":{"post":{"tags":["API Keys"],"summary":"Rotate API key","description":"Generates a new secret for the API key while keeping the same ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.rotate(\"key_123456789\");\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.key);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/api-key/v1/rotate/key_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.rotate(\"key_123456789\")\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"key\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->rotate('key_123456789');\necho $apiKey['id'] . ' ' . $apiKey['key'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = reloop.apiKey.rotate(\"key_123456789\");\nSystem.out.println(apiKey.id + \" \" + apiKey.key);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.ApiKeys.RotateAsync(\"key_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.ApiKeys.Rotate(\"key_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().rotate(\"key_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.api_keys.rotate(\"key_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ApiKey.rotate(client, \"key_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"description":"API Key identifier","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","name":"Production API Key","key":"rl_live_abc123def456ghi789","enabled":true,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write"}],"type":"object","required":["id","name","key","enabled","createdAt","updatedAt","permissions","scope","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"key":{"description":"Full API key (only shown once)","type":"string"},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"API key not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiApi-keyV1RotateByApi_key_id"}},"/api/api-key/v1/enable/{api_key_id}":{"post":{"tags":["API Keys"],"summary":"Enable API key","description":"Enables a previously disabled API key","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.enable(\"key_123456789\");\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.enabled);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/api-key/v1/enable/key_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.enable(\"key_123456789\")\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"enabled\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->enable('key_123456789');\necho $apiKey['id'] . ' ' . $apiKey['enabled'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = reloop.apiKey.enable(\"key_123456789\");\nSystem.out.println(apiKey.id + \" \" + apiKey.enabled);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.ApiKeys.EnableAsync(\"key_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.ApiKeys.Enable(\"key_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().enable(\"key_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.api_keys.enable(\"key_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ApiKey.enable(client, \"key_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"description":"API Key identifier","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","name":"Production API Key","start":"rl_live","prefix":"rl","enabled":true,"requestCount":150,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write","createdBy":{"id":"user_123","name":"John Doe","email":"john@example.com"}}],"type":"object","required":["id","name","start","prefix","refillInterval","refillAmount","lastRefillAt","enabled","rateLimitEnabled","rateLimitTimeWindow","rateLimitMax","requestCount","remaining","lastRequest","expiresAt","createdAt","updatedAt","permissions","scope","metadata","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Start of the API key (for display)","anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"description":"API key prefix","anyOf":[{"type":"string"},{"type":"null"}]},"refillInterval":{"description":"Refill interval in milliseconds","anyOf":[{"type":"number"},{"type":"null"}]},"refillAmount":{"description":"Amount to refill per interval","anyOf":[{"type":"number"},{"type":"null"}]},"lastRefillAt":{"description":"Last refill timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"rateLimitEnabled":{"description":"Whether rate limiting is enabled","type":"boolean"},"rateLimitTimeWindow":{"description":"Rate limit time window in milliseconds","type":"number"},"rateLimitMax":{"description":"Maximum requests per time window","type":"number"},"requestCount":{"description":"Total request count","type":"number"},"remaining":{"description":"Remaining requests","anyOf":[{"type":"number"},{"type":"null"}]},"lastRequest":{"description":"Last request timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"description":"Expiration date","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"metadata":{"description":"JSON metadata string","anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"type":"object","required":["id","name","image","email"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User name","anyOf":[{"type":"string"},{"type":"null"}]},"image":{"description":"User avatar","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"User email","type":"string"}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"API key not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiApi-keyV1EnableByApi_key_id"}},"/api/api-key/v1/disable/{api_key_id}":{"post":{"tags":["API Keys"],"summary":"Disable API key","description":"Disables an API key without deleting it (soft revoke)","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { apiKey, apiKeyError } = await reloop.apiKey.disable(\"key_123456789\");\n\nif (apiKeyError) throw apiKeyError;\n\nconsole.log(apiKey.id, apiKey.enabled);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/api-key/v1/disable/key_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.api_key.disable(\"key_123456789\")\n\nif result.api_key_error:\n    raise result.api_key_error\n\nprint(result.api_key[\"id\"], result.api_key[\"enabled\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$apiKey = $reloop->apiKey->disable('key_123456789');\necho $apiKey['id'] . ' ' . $apiKey['enabled'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar apiKey = reloop.apiKey.disable(\"key_123456789\");\nSystem.out.println(apiKey.id + \" \" + apiKey.enabled);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.ApiKeys.DisableAsync(\"key_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.ApiKeys.Disable(\"key_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.api_keys().disable(\"key_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.api_keys.disable(\"key_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ApiKey.disable(client, \"key_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"description":"API Key identifier","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"key_123456789","name":"Production API Key","start":"rl_live","prefix":"rl","enabled":true,"requestCount":150,"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z","permissions":"read,write","createdBy":{"id":"user_123","name":"John Doe","email":"john@example.com"}}],"type":"object","required":["id","name","start","prefix","refillInterval","refillAmount","lastRefillAt","enabled","rateLimitEnabled","rateLimitTimeWindow","rateLimitMax","requestCount","remaining","lastRequest","expiresAt","createdAt","updatedAt","permissions","scope","metadata","object","event"],"properties":{"id":{"description":"Unique API key identifier","type":"string"},"name":{"description":"Name for the API key","anyOf":[{"type":"string"},{"type":"null"}]},"start":{"description":"Start of the API key (for display)","anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"description":"API key prefix","anyOf":[{"type":"string"},{"type":"null"}]},"refillInterval":{"description":"Refill interval in milliseconds","anyOf":[{"type":"number"},{"type":"null"}]},"refillAmount":{"description":"Amount to refill per interval","anyOf":[{"type":"number"},{"type":"null"}]},"lastRefillAt":{"description":"Last refill timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"description":"Whether the API key is enabled","type":"boolean"},"rateLimitEnabled":{"description":"Whether rate limiting is enabled","type":"boolean"},"rateLimitTimeWindow":{"description":"Rate limit time window in milliseconds","type":"number"},"rateLimitMax":{"description":"Maximum requests per time window","type":"number"},"requestCount":{"description":"Total request count","type":"number"},"remaining":{"description":"Remaining requests","anyOf":[{"type":"number"},{"type":"null"}]},"lastRequest":{"description":"Last request timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"description":"Expiration date","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"},"permissions":{"description":"Comma-separated permissions","anyOf":[{"type":"string"},{"type":"null"}]},"scope":{"description":"Access restrictions; empty means full access","type":"array","items":{"type":"object","required":["domainId","domain","email"],"properties":{"domainId":{"type":"string"},"domain":{"description":"Domain name","type":"string"},"email":{"description":"Exact address, or null for every address on the domain","anyOf":[{"type":"string"},{"type":"null"}]}}}},"metadata":{"description":"JSON metadata string","anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"type":"object","required":["id","name","image","email"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User name","anyOf":[{"type":"string"},{"type":"null"}]},"image":{"description":"User avatar","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"User email","type":"string"}}},"object":{"const":"api_key","type":"string"},"event":{"description":"Event ID for the operation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"API key not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiApi-keyV1DisableByApi_key_id"}},"/api/webhook/v1/":{"post":{"tags":["Webhooks"],"summary":"Create webhook","description":"Creates a new webhook for the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhook, webhookError } = await reloop.webhook.create({\n  description: \"Production webhook\",\n  url: \"https://example.com/webhooks/reloop\",\n  events: [\"domain.create\", \"domain.delete\", \"email.delivered\"],\n});\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/webhook/v1/ \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"description\":\"Production webhook\",\"url\":\"https://example.com/webhooks/reloop\",\"events\":[\"domain.create\",\"domain.delete\"]}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.create({\n  \"description\": \"Production webhook\",\n  \"url\": \"https://example.com/webhooks/reloop\",\n  \"events\": [\"domain.create\", \"domain.delete\"],\n})\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhook = $reloop->webhook->create([\n    'description' => 'Production webhook',\n    'url' => 'https://example.com/webhooks/reloop',\n    'events' => ['domain.create', 'domain.delete'],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateWebhookParams params = new CreateWebhookParams();\nparams.description = \"Production webhook\";\nparams.url = \"https://example.com/webhooks/reloop\";\nparams.events = List.of(\"domain.create\", \"domain.delete\");\nvar webhook = reloop.webhook.create(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon; use the REST API"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon; use the REST API"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon; use the REST API"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon; use the REST API"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon; use the REST API"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"description":"My Webhook","url":"https://example.com/webhooks/reloop","events":["email.sent","email.delivered","domain.create"]}],"type":"object","required":["description","url","events"],"properties":{"description":{"minLength":1,"maxLength":255,"description":"Webhook description","error":"Please provide a valid webhook description","type":"string"},"url":{"pattern":"^https?:\\/\\/.+","description":"Webhook URL","error":"Please provide a valid webhook URL","type":"string"},"events":{"minItems":1,"description":"Array of active event IDs to subscribe to","error":"Please provide at least one valid event ID to subscribe to","type":"array","items":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete)$","error":"Invalid or inactive event ID provided","type":"string"}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"description":"My Webhook","url":"https://example.com/webhooks/reloop","events":["email.sent","email.delivered","domain.create"]}],"type":"object","required":["description","url","events"],"properties":{"description":{"minLength":1,"maxLength":255,"description":"Webhook description","error":"Please provide a valid webhook description","type":"string"},"url":{"pattern":"^https?:\\/\\/.+","description":"Webhook URL","error":"Please provide a valid webhook URL","type":"string"},"events":{"minItems":1,"description":"Array of active event IDs to subscribe to","error":"Please provide at least one valid event ID to subscribe to","type":"array","items":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete)$","error":"Invalid or inactive event ID provided","type":"string"}}}}},"multipart/form-data":{"schema":{"examples":[{"description":"My Webhook","url":"https://example.com/webhooks/reloop","events":["email.sent","email.delivered","domain.create"]}],"type":"object","required":["description","url","events"],"properties":{"description":{"minLength":1,"maxLength":255,"description":"Webhook description","error":"Please provide a valid webhook description","type":"string"},"url":{"pattern":"^https?:\\/\\/.+","description":"Webhook URL","error":"Please provide a valid webhook URL","type":"string"},"events":{"minItems":1,"description":"Array of active event IDs to subscribe to","error":"Please provide at least one valid event ID to subscribe to","type":"array","items":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete)$","error":"Invalid or inactive event ID provided","type":"string"}}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"examples":[{"id":"wh_123456789","name":"Payments Webhook","url":"https://example.com/webhooks/reloop","secret":"***masked***","status":"active","customHeaders":{"x-source":"reloop"},"rateLimitEnabled":true,"maxRequestsPerMinute":60,"maxRetries":7,"retryBackoffMultiplier":2,"filteringOptions":null,"lastTriggeredAt":"2026-03-29T10:00:00Z","successCount":10,"failureCount":1,"consecutiveFailures":0,"healthSeries":[2,1,4,3,5,2,6],"healthFailureSeries":[0,1,0,0,2,0,1],"healthSuccessCount7d":23,"healthFailureCount7d":4,"events":["email.sent","domain.create"],"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z"}],"type":"object","required":["id","name","url","secret","status","customHeaders","rateLimitEnabled","maxRequestsPerMinute","maxRetries","retryBackoffMultiplier","filteringOptions","lastTriggeredAt","successCount","failureCount","consecutiveFailures","events","createdAt","updatedAt"],"properties":{"id":{"description":"Unique webhook identifier","type":"string"},"name":{"description":"Webhook name","type":"string"},"url":{"description":"Webhook URL","type":"string"},"secret":{"description":"Masked webhook secret","type":"string"},"status":{"type":"string","enum":["active","paused","disabled","failed"]},"customHeaders":{"description":"Custom headers","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"rateLimitEnabled":{"description":"Rate limiting enabled","type":"boolean"},"maxRequestsPerMinute":{"description":"Max requests per minute","type":"number"},"maxRetries":{"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"lastTriggeredAt":{"description":"Last triggered timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"successCount":{"description":"Successful delivery count","type":"number"},"failureCount":{"description":"Failed delivery count","type":"number"},"consecutiveFailures":{"description":"Consecutive failure count","type":"number"},"healthSeries":{"description":"Daily successful delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthFailureSeries":{"description":"Daily failed delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthSuccessCount7d":{"description":"Successful deliveries in the last 7 days","type":"number"},"healthFailureCount7d":{"description":"Failed deliveries in the last 7 days","type":"number"},"events":{"description":"Subscribed event IDs (includes inactive/legacy if already stored)","type":"array","items":{"minLength":1,"type":"string"}},"createdBy":{"description":"User who created this webhook","type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiWebhookV1"},"get":{"tags":["Webhooks"],"summary":"List webhooks","description":"Lists webhooks for the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhooks, webhookError } = await reloop.webhook.list({\n  page: 1,\n  limit: 10,\n  status: \"active\",\n});\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/webhook/v1/?page=1&limit=10&status=active\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.list({\n  \"page\": 1,\n  \"limit\": 10,\n  \"status\": \"active\",\n})\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhooks = $reloop->webhook->list([\n    'page' => 1,\n    'limit' => 10,\n    'status' => 'active',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListWebhooksParams params = new ListWebhooksParams();\nparams.page = 1;\nparams.limit = 10;\nparams.status = \"active\";\nvar webhooks = reloop.webhook.list(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"type":"number","anyOf":[{"minimum":1,"default":0,"type":"string","format":"numeric"},{"minimum":1,"default":1,"type":"number"}]}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":10,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":10,"type":"number","anyOf":[{"minimum":1,"maximum":100,"default":0,"type":"string","format":"numeric"},{"minimum":1,"maximum":100,"default":10,"type":"number"}]}]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","disabled","failed"]}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string"}},{"name":"userId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["webhooks","total","page","limit","hasMore","nextCursor"],"properties":{"webhooks":{"type":"array","items":{"examples":[{"id":"wh_123456789","name":"Payments Webhook","url":"https://example.com/webhooks/reloop","secret":"***masked***","status":"active","customHeaders":{"x-source":"reloop"},"rateLimitEnabled":true,"maxRequestsPerMinute":60,"maxRetries":7,"retryBackoffMultiplier":2,"filteringOptions":null,"lastTriggeredAt":"2026-03-29T10:00:00Z","successCount":10,"failureCount":1,"consecutiveFailures":0,"healthSeries":[2,1,4,3,5,2,6],"healthFailureSeries":[0,1,0,0,2,0,1],"healthSuccessCount7d":23,"healthFailureCount7d":4,"events":["email.sent","domain.create"],"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z"}],"type":"object","required":["id","name","url","secret","status","customHeaders","rateLimitEnabled","maxRequestsPerMinute","maxRetries","retryBackoffMultiplier","filteringOptions","lastTriggeredAt","successCount","failureCount","consecutiveFailures","events","createdAt","updatedAt"],"properties":{"id":{"description":"Unique webhook identifier","type":"string"},"name":{"description":"Webhook name","type":"string"},"url":{"description":"Webhook URL","type":"string"},"secret":{"description":"Masked webhook secret","type":"string"},"status":{"type":"string","enum":["active","paused","disabled","failed"]},"customHeaders":{"description":"Custom headers","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"rateLimitEnabled":{"description":"Rate limiting enabled","type":"boolean"},"maxRequestsPerMinute":{"description":"Max requests per minute","type":"number"},"maxRetries":{"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"lastTriggeredAt":{"description":"Last triggered timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"successCount":{"description":"Successful delivery count","type":"number"},"failureCount":{"description":"Failed delivery count","type":"number"},"consecutiveFailures":{"description":"Consecutive failure count","type":"number"},"healthSeries":{"description":"Daily successful delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthFailureSeries":{"description":"Daily failed delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthSuccessCount7d":{"description":"Successful deliveries in the last 7 days","type":"number"},"healthFailureCount7d":{"description":"Failed deliveries in the last 7 days","type":"number"},"events":{"description":"Subscribed event IDs (includes inactive/legacy if already stored)","type":"array","items":{"minLength":1,"type":"string"}},"createdBy":{"description":"User who created this webhook","type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWebhookV1"}},"/api/webhook/v1/{webhook_id}":{"get":{"tags":["Webhooks"],"summary":"Retrieves webhook","description":"Retrieves a webhook by its ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhook, webhookError } = await reloop.webhook.get(\"wh_123456789\");\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/webhook/v1/wh_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.get(\"wh_123456789\")\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhook = $reloop->webhook->get('wh_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar webhook = reloop.webhook.get(\"wh_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"wh_123456789","name":"Payments Webhook","url":"https://example.com/webhooks/reloop","secret":"***masked***","status":"active","customHeaders":{"x-source":"reloop"},"rateLimitEnabled":true,"maxRequestsPerMinute":60,"maxRetries":7,"retryBackoffMultiplier":2,"filteringOptions":null,"lastTriggeredAt":"2026-03-29T10:00:00Z","successCount":10,"failureCount":1,"consecutiveFailures":0,"healthSeries":[2,1,4,3,5,2,6],"healthFailureSeries":[0,1,0,0,2,0,1],"healthSuccessCount7d":23,"healthFailureCount7d":4,"events":["email.sent","domain.create"],"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z"}],"type":"object","required":["id","name","url","secret","status","customHeaders","rateLimitEnabled","maxRequestsPerMinute","maxRetries","retryBackoffMultiplier","filteringOptions","lastTriggeredAt","successCount","failureCount","consecutiveFailures","events","createdAt","updatedAt"],"properties":{"id":{"description":"Unique webhook identifier","type":"string"},"name":{"description":"Webhook name","type":"string"},"url":{"description":"Webhook URL","type":"string"},"secret":{"description":"Masked webhook secret","type":"string"},"status":{"type":"string","enum":["active","paused","disabled","failed"]},"customHeaders":{"description":"Custom headers","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"rateLimitEnabled":{"description":"Rate limiting enabled","type":"boolean"},"maxRequestsPerMinute":{"description":"Max requests per minute","type":"number"},"maxRetries":{"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"lastTriggeredAt":{"description":"Last triggered timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"successCount":{"description":"Successful delivery count","type":"number"},"failureCount":{"description":"Failed delivery count","type":"number"},"consecutiveFailures":{"description":"Consecutive failure count","type":"number"},"healthSeries":{"description":"Daily successful delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthFailureSeries":{"description":"Daily failed delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthSuccessCount7d":{"description":"Successful deliveries in the last 7 days","type":"number"},"healthFailureCount7d":{"description":"Failed deliveries in the last 7 days","type":"number"},"events":{"description":"Subscribed event IDs (includes inactive/legacy if already stored)","type":"array","items":{"minLength":1,"type":"string"}},"createdBy":{"description":"User who created this webhook","type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWebhookV1ByWebhook_id"},"patch":{"tags":["Webhooks"],"summary":"Update webhook","description":"Updates a webhook by its ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhook, webhookError } = await reloop.webhook.update(\"wh_123456789\", {\n  status: \"paused\",\n});\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/webhook/v1/wh_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"status\":\"paused\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.update(\"wh_123456789\", {\n  \"status\": \"paused\",\n})\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhook = $reloop->webhook->update('wh_123456789', [\n    'status' => 'paused',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateWebhookParams params = new UpdateWebhookParams();\nparams.status = \"paused\";\nvar webhook = reloop.webhook.update(\"wh_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Payments Webhook","status":"paused","events":["email.sent","email.delivered"],"maxRetries":5}],"type":"object","properties":{"description":{"minLength":1,"maxLength":255,"description":"Webhook description","type":"string"},"name":{"minLength":1,"maxLength":255,"description":"Webhook name","type":"string"},"url":{"pattern":"^https?:\\/\\/.+","description":"Webhook URL","type":"string"},"events":{"minItems":1,"description":"Array of active event IDs to subscribe to","error":"Please provide at least one valid event ID to subscribe to","type":"array","items":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete)$","error":"Invalid or inactive event ID provided","type":"string"}},"secret":{"minLength":8,"maxLength":255,"description":"Webhook secret for HMAC signature verification","type":"string"},"status":{"type":"string","enum":["active","paused","disabled"]},"customHeaders":{"description":"Custom headers to include in webhook requests","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"rateLimitEnabled":{"description":"Enable rate limiting","type":"boolean"},"maxRequestsPerMinute":{"minimum":1,"maximum":1000,"description":"Maximum requests per minute","type":"number"},"maxRetries":{"minimum":0,"maximum":10,"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"minimum":1,"maximum":10,"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Payments Webhook","status":"paused","events":["email.sent","email.delivered"],"maxRetries":5}],"type":"object","properties":{"description":{"minLength":1,"maxLength":255,"description":"Webhook description","type":"string"},"name":{"minLength":1,"maxLength":255,"description":"Webhook name","type":"string"},"url":{"pattern":"^https?:\\/\\/.+","description":"Webhook URL","type":"string"},"events":{"minItems":1,"description":"Array of active event IDs to subscribe to","error":"Please provide at least one valid event ID to subscribe to","type":"array","items":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete)$","error":"Invalid or inactive event ID provided","type":"string"}},"secret":{"minLength":8,"maxLength":255,"description":"Webhook secret for HMAC signature verification","type":"string"},"status":{"type":"string","enum":["active","paused","disabled"]},"customHeaders":{"description":"Custom headers to include in webhook requests","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"rateLimitEnabled":{"description":"Enable rate limiting","type":"boolean"},"maxRequestsPerMinute":{"minimum":1,"maximum":1000,"description":"Maximum requests per minute","type":"number"},"maxRetries":{"minimum":0,"maximum":10,"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"minimum":1,"maximum":10,"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Payments Webhook","status":"paused","events":["email.sent","email.delivered"],"maxRetries":5}],"type":"object","properties":{"description":{"minLength":1,"maxLength":255,"description":"Webhook description","type":"string"},"name":{"minLength":1,"maxLength":255,"description":"Webhook name","type":"string"},"url":{"pattern":"^https?:\\/\\/.+","description":"Webhook URL","type":"string"},"events":{"minItems":1,"description":"Array of active event IDs to subscribe to","error":"Please provide at least one valid event ID to subscribe to","type":"array","items":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete)$","error":"Invalid or inactive event ID provided","type":"string"}},"secret":{"minLength":8,"maxLength":255,"description":"Webhook secret for HMAC signature verification","type":"string"},"status":{"type":"string","enum":["active","paused","disabled"]},"customHeaders":{"description":"Custom headers to include in webhook requests","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"rateLimitEnabled":{"description":"Enable rate limiting","type":"boolean"},"maxRequestsPerMinute":{"minimum":1,"maximum":1000,"description":"Maximum requests per minute","type":"number"},"maxRetries":{"minimum":0,"maximum":10,"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"minimum":1,"maximum":10,"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"wh_123456789","name":"Payments Webhook","url":"https://example.com/webhooks/reloop","secret":"***masked***","status":"active","customHeaders":{"x-source":"reloop"},"rateLimitEnabled":true,"maxRequestsPerMinute":60,"maxRetries":7,"retryBackoffMultiplier":2,"filteringOptions":null,"lastTriggeredAt":"2026-03-29T10:00:00Z","successCount":10,"failureCount":1,"consecutiveFailures":0,"healthSeries":[2,1,4,3,5,2,6],"healthFailureSeries":[0,1,0,0,2,0,1],"healthSuccessCount7d":23,"healthFailureCount7d":4,"events":["email.sent","domain.create"],"createdAt":"2026-03-29T10:00:00Z","updatedAt":"2026-03-29T10:00:00Z"}],"type":"object","required":["id","name","url","secret","status","customHeaders","rateLimitEnabled","maxRequestsPerMinute","maxRetries","retryBackoffMultiplier","filteringOptions","lastTriggeredAt","successCount","failureCount","consecutiveFailures","events","createdAt","updatedAt"],"properties":{"id":{"description":"Unique webhook identifier","type":"string"},"name":{"description":"Webhook name","type":"string"},"url":{"description":"Webhook URL","type":"string"},"secret":{"description":"Masked webhook secret","type":"string"},"status":{"type":"string","enum":["active","paused","disabled","failed"]},"customHeaders":{"description":"Custom headers","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"rateLimitEnabled":{"description":"Rate limiting enabled","type":"boolean"},"maxRequestsPerMinute":{"description":"Max requests per minute","type":"number"},"maxRetries":{"description":"Maximum retry attempts","type":"number"},"retryBackoffMultiplier":{"description":"Retry backoff multiplier","type":"number"},"filteringOptions":{"description":"Event filtering options","anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"lastTriggeredAt":{"description":"Last triggered timestamp","anyOf":[{"type":"string"},{"type":"null"}]},"successCount":{"description":"Successful delivery count","type":"number"},"failureCount":{"description":"Failed delivery count","type":"number"},"consecutiveFailures":{"description":"Consecutive failure count","type":"number"},"healthSeries":{"description":"Daily successful delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthFailureSeries":{"description":"Daily failed delivery counts for the last 7 days (oldest first)","type":"array","items":{"type":"number"}},"healthSuccessCount7d":{"description":"Successful deliveries in the last 7 days","type":"number"},"healthFailureCount7d":{"description":"Failed deliveries in the last 7 days","type":"number"},"events":{"description":"Subscribed event IDs (includes inactive/legacy if already stored)","type":"array","items":{"minLength":1,"type":"string"}},"createdBy":{"description":"User who created this webhook","type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiWebhookV1ByWebhook_id"}},"/api/webhook/v1/{id}":{"delete":{"tags":["Webhooks"],"summary":"Delete webhook","description":"Soft deletes a webhook by its ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhook, webhookError } = await reloop.webhook.delete(\"wh_123456789\");\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/webhook/v1/wh_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.delete(\"wh_123456789\")\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhook = $reloop->webhook->delete('wh_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar webhook = reloop.webhook.delete(\"wh_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"wh_123456789","message":"Webhook deleted successfully"}],"type":"object","required":["id","message"],"properties":{"id":{"description":"Deleted webhook identifier","type":"string"},"message":{"description":"Success message","type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiWebhookV1ById"}},"/api/webhook/v1/trigger":{"post":{"tags":["Webhooks"],"summary":"Trigger webhooks","description":"Triggers webhooks subscribed to a specific event","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhook, webhookError } = await reloop.webhook.trigger({\n  event: \"domain.create\",\n  payload: { domainId: \"dom_123456789\" },\n});\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/webhook/v1/trigger \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"event\":\"domain.create\",\"payload\":{\"domainId\":\"dom_123456789\"}}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.trigger({\n  \"event\": \"domain.create\",\n  \"payload\": {\n    \"domainId\": \"dom_123456789\",\n  },\n})\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhook = $reloop->webhook->trigger([\n    'event' => 'domain.create',\n    'payload' => [\n        'domainId' => 'dom_123456789',\n    ],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nTriggerWebhookParams params = new TriggerWebhookParams();\nparams.event = \"domain.create\";\nparams.payload = Map.of(\"domainId\", \"dom_123456789\");\nvar webhook = reloop.webhook.trigger(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"event":"domain.create","payload":{"domainId":"dom_123456789","domain":"example.com"}}],"type":"object","required":["event","payload"],"properties":{"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"event":"domain.create","payload":{"domainId":"dom_123456789","domain":"example.com"}}],"type":"object","required":["event","payload"],"properties":{"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"examples":[{"event":"domain.create","payload":{"domainId":"dom_123456789","domain":"example.com"}}],"type":"object","required":["event","payload"],"properties":{"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"},"jobId":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiWebhookV1Trigger","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/webhook/v1/sign-test-event":{"post":{"tags":["Webhooks"],"summary":"Sign test webhook event","description":"Generates signed headers and body for sending a test webhook directly from the client without storing event actions or delivery records","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["webhookId","event","payload"],"properties":{"webhookId":{"description":"Webhook ID to sign test payload for","type":"string"},"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["webhookId","event","payload"],"properties":{"webhookId":{"description":"Webhook ID to sign test payload for","type":"string"},"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["webhookId","event","payload"],"properties":{"webhookId":{"description":"Webhook ID to sign test payload for","type":"string"},"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["url","headers","body","rawBody"],"properties":{"url":{"description":"Target webhook URL","type":"string"},"headers":{"description":"Signed headers to include in client fetch","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"body":{"description":"Webhook envelope payload","type":"object","patternProperties":{"^(.*)$":{}}},"rawBody":{"description":"Exact serialized JSON string for HMAC signature","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiWebhookV1Sign-test-event","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/webhook/v1/send-test-event":{"post":{"tags":["Webhooks"],"summary":"Send test webhook event","description":"Signs a test event and delivers it from Reloop's servers to the webhook URL, or to a `reloop webhooks listen` session. Returns the endpoint's response. No event actions or delivery records are stored.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["webhookId","event","payload"],"properties":{"webhookId":{"description":"Webhook ID to send the test event for","type":"string"},"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}},"listenerSessionId":{"description":"Send to a `reloop webhooks listen` session instead of the webhook URL","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["webhookId","event","payload"],"properties":{"webhookId":{"description":"Webhook ID to send the test event for","type":"string"},"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}},"listenerSessionId":{"description":"Send to a `reloop webhooks listen` session instead of the webhook URL","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["webhookId","event","payload"],"properties":{"webhookId":{"description":"Webhook ID to send the test event for","type":"string"},"event":{"pattern":"^(email\\.sent|email\\.delivered|email\\.delivery_delayed|email\\.complained|email\\.bounced|email\\.failed|email\\.opened|email\\.clicked|email\\.received|email\\.scheduled|email\\.suppressed|domain\\.create|domain\\.update|domain\\.delete|domain\\.undelete|domain\\.verify|domain\\.list|domain\\.get|domain\\.dns\\.get|api-key\\.create|api-key\\.update|api-key\\.delete|api-key\\.revoke|api-key\\.rate_limited|api-key\\.list|api-key\\.get|contact\\.create|contact\\.update|contact\\.delete|contact\\.subscribed|contact\\.unsubscribed|contact\\.blocked|contact\\.group\\.create|contact\\.group\\.update|contact\\.group\\.delete|contact\\.channel\\.create|contact\\.channel\\.update|contact\\.channel\\.delete|contact\\.property\\.create|contact\\.property\\.update|contact\\.property\\.delete|contact\\.list|contact\\.group\\.list|contact\\.channel\\.list|contact\\.property\\.list|contact\\.get|contact\\.group\\.get|contact\\.channel\\.get)$","error":"Invalid event ID provided","type":"string"},"payload":{"description":"Event payload (becomes envelope.data)","type":"object","patternProperties":{"^(.*)$":{}}},"listenerSessionId":{"description":"Send to a `reloop webhooks listen` session instead of the webhook URL","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["target","url","ok","responseStatus","responseBody","durationMs","error","headers","body"],"properties":{"target":{"type":"string","enum":["endpoint","listener"]},"url":{"description":"Where the request was delivered","type":"string"},"ok":{"type":"boolean"},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"headers":{"description":"Signed headers that were sent","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"body":{"description":"Webhook envelope that was sent","type":"object","patternProperties":{"^(.*)$":{}}}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiWebhookV1Send-test-event","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/webhook/v1/{webhook_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","description":"Fetches a paginated list of delivery attempts for a specific webhook","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { deliveries, webhookError } = await reloop.webhook.listDeliveries(\"wh_123456789\", {\n  page: 1,\n  limit: 10,\n  status: \"failed\",\n});\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/webhook/v1/wh_123456789/deliveries?page=1&limit=10&status=failed\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.listDeliveries(\"wh_123456789\", {\n  \"page\": 1,\n  \"limit\": 10,\n  \"status\": \"failed\",\n})\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$deliveries = $reloop->webhook->listDeliveries('wh_123456789', [\n    'page' => 1,\n    'limit' => 10,\n    'status' => 'failed',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListWebhookDeliveriesParams params = new ListWebhookDeliveriesParams();\nparams.page = 1;\nparams.limit = 10;\nparams.status = \"failed\";\nvar deliveries = reloop.webhook.listDeliveries(\"wh_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook ID","type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":10,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":10,"type":"number"}]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","success","failed","retrying",""]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["deliveries","total","page","limit","hasMore","nextCursor"],"properties":{"deliveries":{"type":"array","items":{"type":"object","required":["id","webhookId","webhookEventId","replayOfDeliveryId","eventType","eventData","status","requestUrl","requestHeaders","requestBody","responseStatus","responseBody","responseHeaders","attemptNumber","maxAttempts","nextRetryAt","lastAttemptAt","errorMessage","errorDetails","completedAt","durationMs","createdAt","attempts"],"properties":{"id":{"description":"Unique delivery identifier","type":"string"},"webhookId":{"description":"Webhook identifier","type":"string"},"webhookEventId":{"description":"Event identifier","anyOf":[{"type":"string"},{"type":"null"}]},"replayOfDeliveryId":{"description":"Original delivery this row replays, if any","anyOf":[{"type":"string"},{"type":"null"}]},"eventType":{"description":"Event type","type":"string"},"eventData":{"description":"Event payload","type":"object","patternProperties":{"^(.*)$":{}}},"status":{"type":"string","enum":["pending","success","failed","retrying"]},"requestUrl":{"description":"Request URL","type":"string"},"requestHeaders":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"requestBody":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"responseHeaders":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"attemptNumber":{"type":"number"},"maxAttempts":{"type":"number"},"nextRetryAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastAttemptAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorDetails":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string"},"attempts":{"type":"array","items":{"type":"object","required":["id","attemptNumber","status","responseStatus","responseBody","responseHeaders","durationMs","errorMessage","createdAt","source","retriedAutomatically"],"properties":{"id":{"description":"Attempt identifier","type":"string"},"attemptNumber":{"type":"number"},"status":{"type":"string","enum":["pending","success","failed","retrying"]},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"responseHeaders":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"source":{"type":"string","enum":["automatic","manual"]},"retriedAutomatically":{"type":"boolean"}}}}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWebhookV1ByWebhook_idDeliveries"}},"/api/webhook/deliveries/{delivery_id}/retry":{"post":{"tags":["Webhooks"],"summary":"Retry webhook delivery","description":"Manually re-enqueues a specific webhook delivery attempt","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { webhook, webhookError } = await reloop.webhook.retryDelivery(\"del_123456789\");\nif (webhookError) throw webhookError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/webhook/deliveries/del_123456789/retry \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.webhook.retryDelivery(\"del_123456789\")\nif result.webhook_error:\n    raise result.webhook_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$webhook = $reloop->webhook->retryDelivery('del_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar webhook = reloop.webhook.retryDelivery(\"del_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"// Webhook SDK support coming soon"},{"id":"go","lang":"go","label":"Go","source":"// Webhook SDK support coming soon"},{"id":"rust","lang":"rust","label":"Rust","source":"// Webhook SDK support coming soon"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"# Webhook SDK support coming soon"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"# Webhook SDK support coming soon"}],"security":[{"apiKey":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"minLength":1,"description":"Webhook Delivery ID","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success","message","newDeliveryId"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"},"newDeliveryId":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiWebhookDeliveriesByDelivery_idRetry"}},"/api/contacts/v1/create":{"post":{"tags":["Contact"],"summary":"Create Contact","description":"Creates contact","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { contact, contactError } = await reloop.contacts.create({\n  email: \"john.doe@example.com\",\n  firstName: \"John\",\n  lastName: \"Doe\",\n  status: \"subscribed\",\n  properties: { company: \"Reloop\", role: \"Developer\" },\n  groupIds: [\"grp_123456789\"],\n  channels: [{ channelId: \"chn_123456789\", subscription: \"opt_in\" }],\n});\nif (contactError) throw contactError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/contacts/v1/create \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"john.doe@example.com\",\"firstName\": \"John\",\"lastName\": \"Doe\",\"status\": \"subscribed\",\"properties\": {\"company\": \"Reloop\",\"role\": \"Developer\"},\"groupIds\": [\"grp_123456789\"],\"channels\": [{\"channelId\": \"chn_123456789\",\"subscription\": \"opt_in\"}]}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.create({\n  \"email\": \"john.doe@example.com\",\n  \"firstName\": \"John\",\n  \"lastName\": \"Doe\",\n  \"status\": \"subscribed\",\n  \"properties\": {\n    \"company\": \"Reloop\",\n    \"role\": \"Developer\",\n  },\n  \"groupIds\": [\"grp_123456789\"],\n  \"channels\": [\n    {\n      \"channelId\": \"chn_123456789\",\n      \"subscription\": \"opt_in\",\n    },\n  ],\n})\nif result.contact_error:\n    raise result.contact_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$contact = $reloop->contacts->create([\n    'email' => 'john.doe@example.com',\n    'firstName' => 'John',\n    'lastName' => 'Doe',\n    'status' => 'subscribed',\n    'properties' => [\n        'company' => 'Reloop',\n        'role' => 'Developer',\n    ],\n    'groupIds' => ['grp_123456789'],\n    'channels' => [\n        [\n            'channelId' => 'chn_123456789',\n            'subscription' => 'opt_in',\n        ],\n    ],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateContactParams params = new CreateContactParams();\nparams.email = \"john.doe@example.com\";\nparams.firstName = \"John\";\nparams.lastName = \"Doe\";\nparams.status = \"subscribed\";\nparams.properties = Map.of(\"company\", \"Reloop\", \"role\", \"Developer\");\nparams.groupIds = List.of(\"grp_123456789\");\nparams.channels = List.of(Map.of(\"channelId\", \"chn_123456789\", \"subscription\", \"opt_in\"));\nvar contact = reloop.contacts.create(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar contact = await reloop.Contacts.CreateAsync(new Dictionary<string, object?>\n{\n    [\"email\"] = \"john.doe@example.com\",\n    [\"firstName\"] = \"John\",\n    [\"lastName\"] = \"Doe\",\n    [\"status\"] = \"subscribed\",\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ncontact, _ := client.Contacts.Create(map[string]interface{}{\n    \"email\": \"john.doe@example.com\",\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"status\": \"subscribed\",\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().create(CreateContactParams {\n        email: \"john.doe@example.com\".to_string(),\n        first_name: Some(\"John\".to_string()),\n        last_name: Some(\"Doe\".to_string()),\n        status: Some(ContactStatus::Subscribed),\n        ..Default::default()\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ncontact = reloop.contacts.create(\n  email: \"john.doe@example.com\",\n  first_name: \"John\",\n  last_name: \"Doe\",\n  status: \"subscribed\",\n  properties: { company: \"Reloop\", role: \"Developer\" },\n  group_ids: [\"grp_123456789\"],\n  channels: [{ channel_id: \"chn_123456789\", subscription: \"opt_in\" }],\n)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, contact} = Reloop.Services.Contacts.create(client, %{\n  email: \"john.doe@example.com\",\n  first_name: \"John\",\n  last_name: \"Doe\",\n  status: \"subscribed\",\n  properties: %{company: \"Reloop\", role: \"Developer\"},\n  group_ids: [\"grp_123456789\"],\n  channels: [%{channel_id: \"chn_123456789\", subscription: \"opt_in\"}]\n})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"}}],"type":"object","required":["email"],"properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","type":"string"},"lastName":{"description":"Contact last name","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","type":"object","patternProperties":{"^[a-z0-9_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groupIds":{"description":"Array of group IDs to add the contact to","type":"array","items":{"type":"string"}},"channels":{"description":"Array of channels to enroll the contact in","type":"array","items":{"type":"object","required":["channelId","subscription"],"properties":{"channelId":{"description":"Channel identifier","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"}}],"type":"object","required":["email"],"properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","type":"string"},"lastName":{"description":"Contact last name","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","type":"object","patternProperties":{"^[a-z0-9_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groupIds":{"description":"Array of group IDs to add the contact to","type":"array","items":{"type":"string"}},"channels":{"description":"Array of channels to enroll the contact in","type":"array","items":{"type":"object","required":["channelId","subscription"],"properties":{"channelId":{"description":"Channel identifier","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}}}}},"multipart/form-data":{"schema":{"examples":[{"email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"}}],"type":"object","required":["email"],"properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","type":"string"},"lastName":{"description":"Contact last name","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","type":"object","patternProperties":{"^[a-z0-9_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groupIds":{"description":"Array of group IDs to add the contact to","type":"array","items":{"type":"string"}},"channels":{"description":"Array of channels to enroll the contact in","type":"array","items":{"type":"object","required":["channelId","subscription"],"properties":{"channelId":{"description":"Channel identifier","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"type":"object","required":["object","id","email","firstName","lastName","status","properties","groups","channels","suppressionReason","suppressedAt","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"Unique contact identifier","type":"string"},"email":{"description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Contact last name","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","default":{},"type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groups":{"description":"Groups this contact belongs to","default":[],"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group name","type":"string"}}}},"channels":{"description":"Channels this contact is enrolled in","default":[],"type":"array","items":{"type":"object","required":["id","name","subscription"],"properties":{"id":{"description":"Channel ID","type":"string"},"name":{"description":"Channel name","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"suppressionReason":{"description":"Suppression reason, or null if not suppressed","default":null,"anyOf":[{"const":"hard_bounce","type":"string"},{"const":"spam_complaint","type":"string"},{"const":"mailbox_full","type":"string"},{"type":"null"}]},"suppressedAt":{"description":"When the contact was suppressed, or null","default":null,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"suppressionSource":{"description":"Who suppressed the contact: `system` (bounce, full mailbox or spam complaint) or `manual` (added by a person). Null if not suppressed.","anyOf":[{"const":"system","type":"string"},{"const":"manual","type":"string"},{"type":"null"}]},"suppressionNote":{"description":"Reason given when the contact was suppressed manually","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Invalid email format","Invalid email"]}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Contact already exists","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1Create","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/contacts/v1/retrieve/{contact_id}":{"get":{"tags":["Contact"],"summary":"Retrieve Contact","description":"Retrieves a contact by ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { contact, contactError } = await reloop.contacts.get(\"con_123456789\");\nif (contactError) throw contactError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/retrieve/con_123456789\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.get(\"con_123456789\")\nif result.contact_error:\n    raise result.contact_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$contact = $reloop->contacts->get('con_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar contact = reloop.contacts.get(\"con_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.GetAsync(\"con_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Get(\"con_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().get(\"con_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.get(\"con_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Contacts.get(client, \"con_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"description":"Unique contact identifier","examples":["cont_123456789"],"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"object":"contact","id":"con_123456789","email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"},"groups":[{"id":"grp_123","name":"Beta Testers"}],"channels":[{"id":"tpc_123","name":"Newsletter","subscription":"opt_in"}],"suppressionReason":null,"suppressedAt":null,"createdAt":"2026-03-23T10:00:00Z","updatedAt":"2026-03-23T10:00:00Z"}],"type":"object","required":["object","id","email","firstName","lastName","status","properties","groups","channels","suppressionReason","suppressedAt","createdAt","updatedAt"],"properties":{"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"Unique contact identifier","type":"string"},"email":{"description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Contact last name","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","default":{},"type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groups":{"description":"Groups this contact belongs to","default":[],"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group name","type":"string"}}}},"channels":{"description":"Channels this contact is enrolled in","default":[],"type":"array","items":{"type":"object","required":["id","name","subscription"],"properties":{"id":{"description":"Channel ID","type":"string"},"name":{"description":"Channel name","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"suppressionReason":{"description":"Suppression reason, or null if not suppressed","default":null,"anyOf":[{"const":"hard_bounce","type":"string"},{"const":"spam_complaint","type":"string"},{"const":"mailbox_full","type":"string"},{"type":"null"}]},"suppressedAt":{"description":"When the contact was suppressed, or null","default":null,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"suppressionSource":{"description":"Who suppressed the contact: `system` (bounce, full mailbox or spam complaint) or `manual` (added by a person). Null if not suppressed.","anyOf":[{"const":"system","type":"string"},{"const":"manual","type":"string"},{"type":"null"}]},"suppressionNote":{"description":"Reason given when the contact was suppressed manually","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Contact not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1RetrieveByContact_id"}},"/api/contacts/v1/list":{"get":{"tags":["Contact"],"summary":"List Contacts","description":"Retrieves a paginated list of contacts with optional filtering and search. Pass channelId to return only contacts enrolled in that channel.","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { contacts, contactError } = await reloop.contacts.list({\n  page: 1,\n  limit: 10,\n  status: \"subscribed\",\n});\nif (contactError) throw contactError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/list?page=1&limit=10&status=subscribed\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.list({\n  \"page\": 1,\n  \"limit\": 10,\n  \"status\": \"subscribed\",\n})\nif result.contact_error:\n    raise result.contact_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$contacts = $reloop->contacts->list([\n    'page' => 1,\n    'limit' => 10,\n    'status' => 'subscribed',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListContactsParams params = new ListContactsParams();\nparams.page = 1;\nparams.limit = 10;\nparams.status = \"subscribed\";\nvar contacts = reloop.contacts.list(params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nvar contacts = await reloop.Contacts.ListAsync(new Dictionary<string, object?>\n{\n    [\"page\"] = 1,\n    [\"limit\"] = 10,\n    [\"status\"] = \"subscribed\",\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ncontacts, _ := client.Contacts.List(map[string]interface{}{\n    \"page\": 1,\n    \"limit\": 10,\n    \"status\": \"subscribed\",\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().list(Some(ListContactsParams {\n        page: Some(1),\n        limit: Some(10),\n        status: Some(ContactStatus::Subscribed),\n        ..Default::default()\n    })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ncontacts = reloop.contacts.list(page: 1, limit: 10, status: \"subscribed\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, contacts} = Reloop.Services.Contacts.list(client, %{page: 1, limit: 10, status: \"subscribed\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":100,"type":"number"}},{"name":"search","in":"query","required":false,"schema":{"description":"Search by email","type":"string"}},{"name":"status","in":"query","required":false,"schema":{"pattern":"^(subscribed|unsubscribed|blocked)(,(subscribed|unsubscribed|blocked))*$","description":"Filter by status. Pass one status, or several comma-separated (e.g. subscribed,blocked) to match any of them.","type":"string"}},{"name":"channelId","in":"query","required":false,"schema":{"description":"Filter to contacts enrolled in this channel (status = enrolled)","type":"string"}},{"name":"suppressed","in":"query","required":false,"schema":{"description":"Only contacts on the suppression list (blocked, or suppressed after a hard bounce, full mailbox or spam complaint). Sorted by most recently suppressed.","type":"boolean"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","contacts","total","page","limit","hasMore","nextCursor","totalContacts","subscribedContacts","unsubscribedContacts","event"],"properties":{"object":{"default":"contact","const":"contact","type":"string"},"contacts":{"type":"array","items":{"examples":[{"object":"contact","id":"con_123456789","email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"},"groups":[{"id":"grp_123","name":"Beta Testers"}],"channels":[{"id":"tpc_123","name":"Newsletter","subscription":"opt_in"}],"suppressionReason":null,"suppressedAt":null,"createdAt":"2026-03-23T10:00:00Z","updatedAt":"2026-03-23T10:00:00Z"}],"type":"object","required":["object","id","email","firstName","lastName","status","properties","groups","channels","suppressionReason","suppressedAt","createdAt","updatedAt"],"properties":{"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"Unique contact identifier","type":"string"},"email":{"description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Contact last name","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","default":{},"type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groups":{"description":"Groups this contact belongs to","default":[],"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group name","type":"string"}}}},"channels":{"description":"Channels this contact is enrolled in","default":[],"type":"array","items":{"type":"object","required":["id","name","subscription"],"properties":{"id":{"description":"Channel ID","type":"string"},"name":{"description":"Channel name","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"suppressionReason":{"description":"Suppression reason, or null if not suppressed","default":null,"anyOf":[{"const":"hard_bounce","type":"string"},{"const":"spam_complaint","type":"string"},{"const":"mailbox_full","type":"string"},{"type":"null"}]},"suppressedAt":{"description":"When the contact was suppressed, or null","default":null,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"suppressionSource":{"description":"Who suppressed the contact: `system` (bounce, full mailbox or spam complaint) or `manual` (added by a person). Null if not suppressed.","anyOf":[{"const":"system","type":"string"},{"const":"manual","type":"string"},{"type":"null"}]},"suppressionNote":{"description":"Reason given when the contact was suppressed manually","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"totalContacts":{"description":"Total number of contacts in organization","type":"number"},"subscribedContacts":{"description":"Total number of subscribed contacts","type":"number"},"unsubscribedContacts":{"description":"Total number of unsubscribed contacts","type":"number"},"event":{"description":"Event ID for the list request","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1List"}},"/api/contacts/v1/export":{"get":{"tags":["Contact"],"summary":"Export Contacts CSV","description":"Streams matching contacts as CSV with the active filters (search, status, channelId, groupId). Rate-limited to 5 exports per 10 minutes per organization with single-flight guard — use this instead of paging /list for exports.","security":[{"apiKey":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"description":"Search by email","type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["subscribed","unsubscribed","blocked"]}},{"name":"channelId","in":"query","required":false,"schema":{"description":"Filter to contacts enrolled in this channel (status = enrolled)","type":"string"}},{"name":"groupId","in":"query","required":false,"schema":{"description":"Filter to contacts in this group","type":"string"}}],"operationId":"getApiContactsV1Export","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/contacts/v1/export/email":{"post":{"tags":["Contact"],"summary":"Email Contacts Export","description":"Queues a CSV export of the filtered contacts and emails a 7-day signed download link to the requesting user's account email. Returns 202 immediately; generation, S3 upload, and delivery happen in the background. Rate-limited to 3 per hour per organization.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"description":"Search by email","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"channelId":{"description":"Filter to contacts enrolled in this channel (status = enrolled)","type":"string"},"groupId":{"description":"Filter to contacts in this group","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"search":{"description":"Search by email","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"channelId":{"description":"Filter to contacts enrolled in this channel (status = enrolled)","type":"string"},"groupId":{"description":"Filter to contacts in this group","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"search":{"description":"Search by email","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"channelId":{"description":"Filter to contacts enrolled in this channel (status = enrolled)","type":"string"},"groupId":{"description":"Filter to contacts in this group","type":"string"}}}}}},"responses":{"202":{"description":"Response for status 202","content":{"application/json":{"schema":{"type":"object","required":["exportId","totalRows","recipient"],"properties":{"exportId":{"description":"Background export job identifier","type":"string"},"totalRows":{"description":"Contacts matched for the export","type":"number"},"recipient":{"description":"Account email the download link will be sent to","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"},"Location":{"$ref":"#/components/headers/JobLocation"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1ExportEmail","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/contacts/v1/export/download":{"get":{"tags":["Contact"],"summary":"Download Emailed Export","description":"Downloads a previously emailed contacts CSV via its signed 7-day token. No session required.","parameters":[{"name":"token","in":"query","required":false,"schema":{"description":"Signed download token","type":"string"}}],"operationId":"getApiContactsV1ExportDownload","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/contacts/v1/stats/subscription-activity":{"get":{"tags":["Contact"],"summary":"Subscription activity","description":"Daily new subscribed contacts and unsubscribed updates over a recent window (UTC).","security":[{"apiKey":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"minimum":1,"maximum":365,"default":7,"description":"Number of UTC days to include (1–365)","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":365,"default":7,"description":"Number of UTC days to include (1–365)","type":"number"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","days","dates","subscribed","unsubscribed","event"],"properties":{"object":{"default":"contact_subscription_activity","const":"contact_subscription_activity","type":"string"},"days":{"description":"Number of days included","type":"number"},"dates":{"type":"array","items":{"description":"ISO date YYYY-MM-DD (UTC)","type":"string"}},"subscribed":{"type":"array","items":{"description":"New subscribed contacts created that day","type":"number"}},"unsubscribed":{"type":"array","items":{"description":"Contacts currently unsubscribed whose status was last updated that day","type":"number"}},"event":{"description":"Event ID for the stats request","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1StatsSubscription-activity"}},"/api/contacts/v1/{contact_id}":{"patch":{"tags":["Contact"],"summary":"Update Contact","description":"Updates an existing contact's information","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { contact, contactError } = await reloop.contacts.update(\"con_123456789\", { firstName: \"Jane\" });\nif (contactError) throw contactError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/contacts/v1/con_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"firstName\": \"Jane\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.update(\"con_123456789\", {\n  \"firstName\": \"Jane\",\n})\nif result.contact_error:\n    raise result.contact_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$contact = $reloop->contacts->update('con_123456789', [\n    'firstName' => 'Jane',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateContactParams params = new UpdateContactParams();\nparams.firstName = \"Jane\";\nvar contact = reloop.contacts.update(\"con_123456789\", params);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.UpdateAsync(\"con_123456789\", new Dictionary<string, object?> { [\"firstName\"] = \"Jane\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ncontact, _ := client.Contacts.Update(\"con_123456789\", map[string]interface{\"firstName\": \"Jane\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().update(\"con_123456789\", UpdateContactParams { first_name: Some(\"Jane\".to_string()), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ncontact = reloop.contacts.update(\"con_123456789\", first_name: \"Jane\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, contact} = Reloop.Services.Contacts.update(client, \"con_123456789\", %{first_name: \"Jane\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"description":"Unique contact identifier","examples":["cont_123456789"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"}}],"type":"object","properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","type":"string"},"lastName":{"description":"Contact last name","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs to update","type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"}}],"type":"object","properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","type":"string"},"lastName":{"description":"Contact last name","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs to update","type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}}}}},"multipart/form-data":{"schema":{"examples":[{"email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"}}],"type":"object","properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","type":"string"},"lastName":{"description":"Contact last name","type":"string"},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs to update","type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","email","firstName","lastName","status","properties","groups","channels","suppressionReason","suppressedAt","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"Unique contact identifier","type":"string"},"email":{"description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Contact last name","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","default":{},"type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groups":{"description":"Groups this contact belongs to","default":[],"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group name","type":"string"}}}},"channels":{"description":"Channels this contact is enrolled in","default":[],"type":"array","items":{"type":"object","required":["id","name","subscription"],"properties":{"id":{"description":"Channel ID","type":"string"},"name":{"description":"Channel name","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"suppressionReason":{"description":"Suppression reason, or null if not suppressed","default":null,"anyOf":[{"const":"hard_bounce","type":"string"},{"const":"spam_complaint","type":"string"},{"const":"mailbox_full","type":"string"},{"type":"null"}]},"suppressedAt":{"description":"When the contact was suppressed, or null","default":null,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"suppressionSource":{"description":"Who suppressed the contact: `system` (bounce, full mailbox or spam complaint) or `manual` (added by a person). Null if not suppressed.","anyOf":[{"const":"system","type":"string"},{"const":"manual","type":"string"},{"type":"null"}]},"suppressionNote":{"description":"Reason given when the contact was suppressed manually","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Contact not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiContactsV1ByContact_id"},"delete":{"tags":["Contact"],"summary":"Delete Contact","description":"Removes a contact from the organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { contact, contactError } = await reloop.contacts.delete(\"con_123456789\");\nif (contactError) throw contactError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/contacts/v1/con_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.delete(\"con_123456789\")\nif result.contact_error:\n    raise result.contact_error"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$contact = $reloop->contacts->delete('con_123456789');"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar contact = reloop.contacts.delete(\"con_123456789\");"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.DeleteAsync(\"con_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Delete(\"con_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().delete(\"con_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.delete(\"con_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Contacts.delete(client, \"con_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"description":"Unique contact identifier","examples":["cont_123456789"],"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"object":"contact","id":"cont_123456789","event":"contact.delete"}],"type":"object","required":["success","object","id","event"],"properties":{"success":{"default":true,"type":"boolean"},"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"ID of the deleted contact","type":"string"},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Contact not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiContactsV1ByContact_id"}},"/api/contacts/v1/suppressions":{"post":{"tags":["Contact"],"summary":"Add Suppression","description":"Adds an email address to the organization's suppression list with a reason. Creates the contact if it does not exist. Sends to the address are rejected until it is removed.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","reason"],"properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","maxLength":255,"description":"Email address to stop sending to","examples":["john.doe@example.com"],"type":"string"},"reason":{"maxLength":500,"pattern":"\\S","description":"Why this address is being suppressed","examples":["Asked to never be contacted again"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email","reason"],"properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","maxLength":255,"description":"Email address to stop sending to","examples":["john.doe@example.com"],"type":"string"},"reason":{"maxLength":500,"pattern":"\\S","description":"Why this address is being suppressed","examples":["Asked to never be contacted again"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email","reason"],"properties":{"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","maxLength":255,"description":"Email address to stop sending to","examples":["john.doe@example.com"],"type":"string"},"reason":{"maxLength":500,"pattern":"\\S","description":"Why this address is being suppressed","examples":["Asked to never be contacted again"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","contactId","email","suppressionSource","suppressionNote","suppressedAt"],"properties":{"object":{"const":"suppression","type":"string"},"contactId":{"description":"Contact that holds the suppression","type":"string"},"email":{"type":"string"},"suppressionSource":{"const":"manual","type":"string"},"suppressionNote":{"type":"string"},"suppressedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Invalid email format","Invalid email"]}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Already suppressed","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1Suppressions","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/contacts/v1/channel/{channel_id}":{"post":{"tags":["Contact"],"summary":"Add Contact Channel","description":"Creates a contact (if not exists) and enrolls them in a channel in one operation","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channel, channelError } = await reloop.contacts.channels.addContact(\n  \"chn_123456789\",\n  { email: \"john.doe@example.com\", subscription: \"opt_in\" },\n);\n\nif (channelError) throw channelError;\n\nconsole.log(channel.subscriptionId, channel.contact.id);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/contacts/v1/channel/chn_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"john.doe@example.com\",\"subscription\": \"opt_in\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.addContact(\"chn_123456789\", {\n  \"email\": \"john.doe@example.com\",\n  \"subscription\": \"opt_in\",\n})\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channel[\"subscriptionId\"], result.channel[\"contact\"].id)"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channel = $reloop->contacts->channels->addContact('chn_123456789', [\n    'email' => 'john.doe@example.com',\n    'subscription' => 'opt_in',\n]);\necho $channel['subscriptionId'] . ' ' . $channel['contact'].id . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nAddChannelContactParams params = new AddChannelContactParams();\nparams.email = \"john.doe@example.com\";\nparams.subscription = \"opt_in\";\nvar channel = reloop.contacts.channels.addContact(\"chn_123456789\", params);\nSystem.out.println(channel.subscriptionId + \" \" + channel.contact.id);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.AddContactAsync(\"chn_123456789\", new Dictionary<string, object?> { [\"email\"] = \"john.doe@example.com\", [\"subscription\"] = \"opt_in\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Channels.AddContact(\"chn_123456789\", map[string]interface{\"email\": \"john.doe@example.com\", \"subscription\": \"opt_in\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().add_contact(\"chn_123456789\", AddContactToChannelParams { email: Some(\"john.doe@example.com\".to_string()), subscription: Some(\"opt_in\".to_string()), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.channels.add_contact(\"chn_123456789\", email: \"john.doe@example.com\", subscription: \"opt_in\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ContactChannels.add_contact(client, \"chn_123456789\", %{email: \"john.doe@example.com\", subscription: \"opt_in\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"description":"Channel ID","examples":["channel_123456789"],"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"type":"object","required":["contact","subscriptionId","event"],"properties":{"contact":{"type":"object","required":["object","id","email","firstName","lastName","status","properties","groups","channels","suppressionReason","suppressedAt","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"Unique contact identifier","type":"string"},"email":{"description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Contact last name","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","default":{},"type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"groups":{"description":"Groups this contact belongs to","default":[],"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group name","type":"string"}}}},"channels":{"description":"Channels this contact is enrolled in","default":[],"type":"array","items":{"type":"object","required":["id","name","subscription"],"properties":{"id":{"description":"Channel ID","type":"string"},"name":{"description":"Channel name","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"suppressionReason":{"description":"Suppression reason, or null if not suppressed","default":null,"anyOf":[{"const":"hard_bounce","type":"string"},{"const":"spam_complaint","type":"string"},{"const":"mailbox_full","type":"string"},{"type":"null"}]},"suppressedAt":{"description":"When the contact was suppressed, or null","default":null,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"suppressionSource":{"description":"Who suppressed the contact: `system` (bounce, full mailbox or spam complaint) or `manual` (added by a person). Null if not suppressed.","anyOf":[{"const":"system","type":"string"},{"const":"manual","type":"string"},{"type":"null"}]},"suppressionNote":{"description":"Reason given when the contact was suppressed manually","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}},"subscriptionId":{"description":"Created subscription ID","type":"string"},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Invalid email format","Invalid email"]}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Channel subscription not found","Subscription not found","Preference not found"]}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Contact is already subscribed to this channel","Subscription already exists","Preference already exists"]}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1ChannelByChannel_id"},"patch":{"tags":["Contact"],"summary":"Update Contact Channel","description":"Updates a contact's enrollment status in a channel","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channel, channelError } = await reloop.contacts.channels.updateSubscription(\n  \"chn_123456789\",\n  { email: \"john.doe@example.com\", subscription: \"opt_out\" },\n);\n\nif (channelError) throw channelError;\n\nconsole.log(channel.status, channel.success);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/contacts/v1/channel/chn_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"john.doe@example.com\",\"subscription\": \"opt_out\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.updateSubscription(\"chn_123456789\", {\n  \"email\": \"john.doe@example.com\",\n  \"subscription\": \"opt_out\",\n})\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channel[\"status\"], result.channel[\"success\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channel = $reloop->contacts->channels->updateSubscription('chn_123456789', [\n    'email' => 'john.doe@example.com',\n    'subscription' => 'opt_out',\n]);\necho $channel['status'] . ' ' . $channel['success'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateChannelSubscriptionParams params = new UpdateChannelSubscriptionParams();\nparams.email = \"john.doe@example.com\";\nparams.subscription = \"opt_out\";\nvar channel = reloop.contacts.channels.updateSubscription(\"chn_123456789\", params);\nSystem.out.println(channel.status + \" \" + channel.success);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.UpdateSubscriptionAsync(\"chn_123456789\", new Dictionary<string, object?> { [\"email\"] = \"john.doe@example.com\", [\"subscription\"] = \"opt_out\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Channels.UpdateSubscription(\"chn_123456789\", map[string]interface{\"email\": \"john.doe@example.com\", \"subscription\": \"opt_out\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().update_subscription(\"chn_123456789\", UpdateContactChannelParams { email: Some(\"john.doe@example.com\".to_string()), subscription: \"opt_out\".to_string(), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.channels.update_subscription(\"chn_123456789\", email: \"john.doe@example.com\", subscription: \"opt_out\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ContactChannels.update_subscription(client, \"chn_123456789\", %{email: \"john.doe@example.com\", subscription: \"opt_out\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"description":"Channel ID","examples":["channel_123456789"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subscription"],"properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["subscription"],"properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"multipart/form-data":{"schema":{"type":"object","required":["subscription"],"properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"},"subscription":{"type":"string","enum":["opt_in","opt_out"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"id":"con_123456789","status":"enrolled","event":"contact.update"}],"type":"object","required":["success","status","event"],"properties":{"success":{"default":true,"type":"boolean"},"id":{"description":"Contact ID (for audit / history)","type":"string"},"status":{"type":"string","enum":["enrolled","unenrolled"]},"channelId":{"type":"string"},"channelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"subscription":{"type":"string","enum":["opt_in","opt_out"]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiContactsV1ChannelByChannel_id"}},"/api/contacts/v1/group/{group_id}":{"post":{"tags":["Contact"],"summary":"Add Contact Group","description":"Adds a contact to a group by ID or email","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { group, groupError } = await reloop.contacts.groups.addContact(\n  \"grp_123456789\",\n  { email: \"john.doe@example.com\" },\n);\n\nif (groupError) throw groupError;\n\nconsole.log(group.id, group.success);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/contacts/v1/group/grp_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"john.doe@example.com\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.addContact(\"grp_123456789\", {\n  \"email\": \"john.doe@example.com\",\n})\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.group[\"id\"], result.group[\"success\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$group = $reloop->contacts->groups->addContact('grp_123456789', [\n    'email' => 'john.doe@example.com',\n]);\necho $group['id'] . ' ' . $group['success'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nAddGroupContactParams params = new AddGroupContactParams();\nparams.email = \"john.doe@example.com\";\nvar group = reloop.contacts.groups.addContact(\"grp_123456789\", params);\nSystem.out.println(group.id + \" \" + group.success);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Groups.AddContactAsync(\"grp_123456789\", new Dictionary<string, object?> { [\"email\"] = \"john.doe@example.com\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Groups.AddContact(\"grp_123456789\", map[string]interface{\"email\": \"john.doe@example.com\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().groups().add_contact(\"grp_123456789\", AddContactToGroupParams { email: Some(\"john.doe@example.com\".to_string()), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.groups.add_contact(\"grp_123456789\", email: \"john.doe@example.com\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ContactGroups.add_contact(client, \"grp_123456789\", %{email: \"john.doe@example.com\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"description":"Group ID","examples":["grp_123456789"],"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"object":"contact","id":"con_123456789","event":"contact.update"}],"type":"object","required":["success","object","id","event"],"properties":{"success":{"default":true,"type":"boolean"},"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"ID of the contact added to the group","type":"string"},"groupId":{"type":"string"},"groupName":{"anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1GroupByGroup_id"},"delete":{"tags":["Contact"],"summary":"Delete Contact Group","description":"Deletes a contact from a group by ID or email","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { group, groupError } = await reloop.contacts.groups.removeContact(\n  \"grp_123456789\",\n  { email: \"john.doe@example.com\" },\n);\n\nif (groupError) throw groupError;\n\nconsole.log(group.id, group.success);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/contacts/v1/group/grp_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"john.doe@example.com\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.removeContact(\"grp_123456789\", {\n  \"email\": \"john.doe@example.com\",\n})\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.group[\"id\"], result.group[\"success\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$group = $reloop->contacts->groups->removeContact('grp_123456789', [\n    'email' => 'john.doe@example.com',\n]);\necho $group['id'] . ' ' . $group['success'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nRemoveGroupContactParams params = new RemoveGroupContactParams();\nparams.email = \"john.doe@example.com\";\nvar group = reloop.contacts.groups.removeContact(\"grp_123456789\", params);\nSystem.out.println(group.id + \" \" + group.success);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Groups.RemoveContactAsync(\"grp_123456789\", new Dictionary<string, object?> { [\"email\"] = \"john.doe@example.com\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Groups.RemoveContact(\"grp_123456789\", map[string]interface{\"email\": \"john.doe@example.com\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().groups().remove_contact(\"grp_123456789\", RemoveContactFromGroupParams { email: Some(\"john.doe@example.com\".to_string()), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.groups.remove_contact(\"grp_123456789\", email: \"john.doe@example.com\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ContactGroups.remove_contact(client, \"grp_123456789\", %{email: \"john.doe@example.com\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"description":"Group ID","examples":["grp_123456789"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"contact_id":{"description":"Contact ID","type":"string"},"email":{"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","description":"Contact email address","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"object":"contact","id":"con_123456789","event":"contact.update"}],"type":"object","required":["success","object","id","event"],"properties":{"success":{"default":true,"type":"boolean"},"object":{"default":"contact","const":"contact","type":"string"},"id":{"description":"ID of the contact removed from the group","type":"string"},"groupId":{"type":"string"},"groupName":{"anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiContactsV1GroupByGroup_id"}},"/api/contacts/v1/properties/create":{"post":{"tags":["Contact Properties"],"summary":"Create Contact Property","description":"Create a new custom property for contacts in the organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { property, propertyError } = await reloop.contacts.properties.create({\n  name: \"company_name\",\n  type: \"string\",\n  fallbackValue: \"Unknown\",\n});\n\nif (propertyError) throw propertyError;\n\nconsole.log(property.id, property.propertyName);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/contacts/v1/properties/create \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"company_name\",\"type\": \"string\",\"fallbackValue\": \"Unknown\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.properties.create({\n  \"name\": \"company_name\",\n  \"type\": \"string\",\n  \"fallbackValue\": \"Unknown\",\n})\n\nif result.property_error:\n    raise result.property_error\n\nprint(result.property[\"id\"], result.property[\"propertyName\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$property = $reloop->contacts->properties->create([\n    'name' => 'company_name',\n    'type' => 'string',\n    'fallbackValue' => 'Unknown',\n]);\necho $property['id'] . ' ' . $property['propertyName'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreatePropertyParams params = new CreatePropertyParams();\nparams.name = \"company_name\";\nparams.type = \"string\";\nparams.fallbackValue = \"Unknown\";\nvar property = reloop.contacts.properties.create(params);\nSystem.out.println(property.id + \" \" + property.propertyName);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.CreatePropertyAsync(new Dictionary<string, object?>\n{\n    [\"name\"] = \"company_name\",\n    [\"type\"] = \"string\",\n    [\"fallbackValue\"] = \"Unknown\",\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nproperty, _ := client.Contacts.CreateProperty(map[string]interface{}{\n    \"name\": \"company_name\",\n    \"type\": \"string\",\n    \"fallbackValue\": \"Unknown\",\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().create_property(CreatePropertyParams {\n        name: \"company_name\".to_string(),\n        property_type: PropertyType::String,\n        fallback_value: Some(\"Unknown\".to_string()),\n        ..Default::default()\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nproperty = reloop.contacts.create_property(\n  name: \"company_name\",\n  type: \"string\",\n  fallback_value: \"Unknown\",\n)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, property} = Reloop.Services.Contacts.create_property(client, %{\n  name: \"company_name\",\n  type: \"string\",\n  fallback_value: \"Unknown\"\n})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"company_name","type":"string","fallbackValue":"Unknown"},{"name":"years_of_experience","type":"number","fallbackValue":"0"}],"type":"object","required":["name","type"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Property name (e.g., company_name, first_name)","type":"string"},"type":{"type":"string","enum":["string","number"]},"fallbackValue":{"description":"Default value to use when property is empty","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"company_name","type":"string","fallbackValue":"Unknown"},{"name":"years_of_experience","type":"number","fallbackValue":"0"}],"type":"object","required":["name","type"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Property name (e.g., company_name, first_name)","type":"string"},"type":{"type":"string","enum":["string","number"]},"fallbackValue":{"description":"Default value to use when property is empty","type":"string"}}}},"multipart/form-data":{"schema":{"examples":[{"name":"company_name","type":"string","fallbackValue":"Unknown"},{"name":"years_of_experience","type":"number","fallbackValue":"0"}],"type":"object","required":["name","type"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Property name (e.g., company_name, first_name)","type":"string"},"type":{"type":"string","enum":["string","number"]},"fallbackValue":{"description":"Default value to use when property is empty","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","propertyName","propertyType","defaultValue","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact_property","const":"contact_property","type":"string"},"id":{"description":"Unique property identifier","type":"string"},"propertyName":{"description":"Property name","type":"string"},"propertyType":{"description":"Property type (string or number)","type":"string"},"defaultValue":{"description":"Fallback value","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Property already exists","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1PropertiesCreate","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/contacts/v1/properties/list":{"get":{"tags":["Contact Properties"],"summary":"List Contact Properties","description":"List all properties for the organization with pagination and filtering","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { properties, propertyError } = await reloop.contacts.properties.list({\n  page: 1,\n  limit: 10,\n});\n\nif (propertyError) throw propertyError;\n\nconsole.log(properties.total, properties.properties);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/properties/list?page=1&limit=10\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.properties.list({\n  \"page\": 1,\n  \"limit\": 10,\n})\n\nif result.property_error:\n    raise result.property_error\n\nprint(result.properties[\"total\"], result.properties[\"properties\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$properties = $reloop->contacts->properties->list([\n    'page' => 1,\n    'limit' => 10,\n]);\necho $properties['total'] . ' ' . $properties['properties'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListPropertiesParams params = new ListPropertiesParams();\nparams.page = 1;\nparams.limit = 10;\nvar properties = reloop.contacts.properties.list(params);\nSystem.out.println(properties.total + \" \" + properties.properties);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.ListPropertiesAsync(new Dictionary<string, object?> { [\"page\"] = 1, [\"limit\"] = 10 });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nproperties, _ := client.Contacts.ListProperties(map[string]interface{}{\"page\": 1, \"limit\": 10})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().list_properties(Some(ListPropertiesParams { page: Some(1), limit: Some(10), ..Default::default() })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nproperties = reloop.contacts.list_properties(page: 1, limit: 10)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, properties} = Reloop.Services.Contacts.list_properties(client, %{page: 1, limit: 10})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":10,"type":"number"}},{"name":"search","in":"query","required":false,"schema":{"description":"Search by name","type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["string","number"]}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","properties","total","page","limit","hasMore","nextCursor","event"],"properties":{"object":{"default":"contact_property","const":"contact_property","type":"string"},"properties":{"type":"array","items":{"examples":[{"object":"contact_property","id":"prop_123456789","propertyName":"company_name","propertyType":"string","defaultValue":"Unknown","createdAt":"2026-03-27T10:00:00Z","updatedAt":"2026-03-27T10:00:00Z"}],"type":"object","required":["id","propertyName","propertyType","defaultValue","createdAt","updatedAt"],"properties":{"id":{"description":"Unique property identifier","type":"string"},"propertyName":{"description":"Property name","type":"string"},"propertyType":{"description":"Property type (string or number)","type":"string"},"defaultValue":{"description":"Fallback value","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the list request","type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1PropertiesList"}},"/api/contacts/v1/properties/{contact_property_id}":{"patch":{"tags":["Contact Properties"],"summary":"Update Contact Property","description":"Update the fallback value of a property","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { property, propertyError } = await reloop.contacts.properties.update(\n  \"prop_123456789\",\n  { fallbackValue: \"N/A\" },\n);\n\nif (propertyError) throw propertyError;\n\nconsole.log(property.id, property.defaultValue);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/contacts/v1/properties/prop_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"fallbackValue\": \"N/A\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.properties.update(\"prop_123456789\", {\n  \"fallbackValue\": \"N/A\",\n})\n\nif result.property_error:\n    raise result.property_error\n\nprint(result.property[\"id\"], result.property[\"defaultValue\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$property = $reloop->contacts->properties->update('prop_123456789', [\n    'fallbackValue' => 'N/A',\n]);\necho $property['id'] . ' ' . $property['defaultValue'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdatePropertyParams params = new UpdatePropertyParams();\nparams.fallbackValue = \"N/A\";\nvar property = reloop.contacts.properties.update(\"prop_123456789\", params);\nSystem.out.println(property.id + \" \" + property.defaultValue);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.UpdatePropertyAsync(\"prop_123456789\", new Dictionary<string, object?> { [\"fallbackValue\"] = \"N/A\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nproperty, _ := client.Contacts.UpdateProperty(\"prop_123456789\", map[string]interface{\"fallbackValue\": \"N/A\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().update_property(\"prop_123456789\", UpdatePropertyParams { fallback_value: Some(\"N/A\".to_string()), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nproperty = reloop.contacts.update_property(\"prop_123456789\", fallback_value: \"N/A\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, property} = Reloop.Services.Contacts.update_property(client, \"prop_123456789\", %{fallback_value: \"N/A\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"contact_property_id","in":"path","required":true,"schema":{"description":"Property ID to update","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fallbackValue"],"properties":{"fallbackValue":{"nullable":true,"anyOf":[{"description":"New fallback value","type":"string"},{"type":"null"}]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["fallbackValue"],"properties":{"fallbackValue":{"nullable":true,"anyOf":[{"description":"New fallback value","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["fallbackValue"],"properties":{"fallbackValue":{"nullable":true,"anyOf":[{"description":"New fallback value","type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","propertyName","propertyType","defaultValue","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact_property","const":"contact_property","type":"string"},"id":{"description":"Unique property identifier","type":"string"},"propertyName":{"description":"Property name","type":"string"},"propertyType":{"description":"Property type (string or number)","type":"string"},"defaultValue":{"description":"Fallback value","anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Property not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiContactsV1PropertiesByContact_property_id"},"delete":{"tags":["Contact Properties"],"summary":"Delete Contact Property","description":"Soft delete a property by ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { property, propertyError } = await reloop.contacts.properties.delete(\n  \"prop_123456789\",\n);\n\nif (propertyError) throw propertyError;\n\nconsole.log(property.id, property.success);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/contacts/v1/properties/prop_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.properties.delete(\"prop_123456789\")\n\nif result.property_error:\n    raise result.property_error\n\nprint(result.property[\"id\"], result.property[\"success\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$property = $reloop->contacts->properties->delete('prop_123456789');\necho $property['id'] . ' ' . $property['success'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar property = reloop.contacts.properties.delete(\"prop_123456789\");\nSystem.out.println(property.id + \" \" + property.success);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.DeletePropertyAsync(\"prop_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.DeleteProperty(\"prop_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().delete_property(\"prop_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.delete_property(\"prop_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Contacts.delete_property(client, \"prop_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"contact_property_id","in":"path","required":true,"schema":{"description":"Property ID to delete","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","success","id","name","event"],"properties":{"object":{"default":"contact_property","const":"contact_property","type":"string"},"success":{"type":"boolean"},"id":{"description":"ID of the deleted property","type":"string"},"name":{"description":"Name of the deleted property","type":"string"},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Property not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiContactsV1PropertiesByContact_property_id"}},"/api/contacts/v1/channels/create":{"post":{"tags":["Channels"],"summary":"Create Channel","description":"Creates a new channel for the organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channel, channelError } = await reloop.contacts.channels.create({\n  name: \"Product Updates\",\n  description: \"Get the latest news about our products\",\n  defaultSubscription: \"opt_in\",\n  visibility: \"public\",\n});\n\nif (channelError) throw channelError;\n\nconsole.log(channel.id, channel.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/contacts/v1/channels/create \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Product Updates\",\"description\": \"Get the latest news about our products\",\"defaultSubscription\": \"opt_in\",\"visibility\": \"public\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.create({\n  \"name\": \"Product Updates\",\n  \"description\": \"Get the latest news about our products\",\n  \"defaultSubscription\": \"opt_in\",\n  \"visibility\": \"public\",\n})\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channel[\"id\"], result.channel[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channel = $reloop->contacts->channels->create([\n    'name' => 'Product Updates',\n    'description' => 'Get the latest news about our products',\n    'defaultSubscription' => 'opt_in',\n    'visibility' => 'public',\n]);\necho $channel['id'] . ' ' . $channel['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateChannelParams params = new CreateChannelParams();\nparams.name = \"Product Updates\";\nparams.description = \"Get the latest news about our products\";\nparams.defaultSubscription = \"opt_in\";\nparams.visibility = \"public\";\nvar channel = reloop.contacts.channels.create(params);\nSystem.out.println(channel.id + \" \" + channel.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.CreateAsync(new Dictionary<string, object?>\n{\n    [\"name\"] = \"Product Updates\",\n    [\"description\"] = \"Get the latest news about our products\",\n    [\"defaultSubscription\"] = \"opt_in\",\n    [\"visibility\"] = \"public\",\n});"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nchannel, _ := client.Contacts.Channels.Create(map[string]interface{}{\n    \"name\": \"Product Updates\",\n    \"description\": \"Get the latest news about our products\",\n    \"defaultSubscription\": \"opt_in\",\n    \"visibility\": \"public\",\n})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().create(CreateChannelParams {\n        name: \"Product Updates\".to_string(),\n        description: Some(\"Get the latest news about our products\".to_string()),\n        default_subscription: Some(\"opt_in\".to_string()),\n        visibility: Some(ChannelVisibility::Public),\n        ..Default::default()\n    }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nchannel = reloop.contacts.channels.create(\n  name: \"Product Updates\",\n  description: \"Get the latest news about our products\",\n  default_subscription: \"opt_in\",\n  visibility: \"public\",\n)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, channel} = Reloop.Services.ContactChannels.create(client, %{\n  name: \"Product Updates\",\n  description: \"Get the latest news about our products\",\n  default_subscription: \"opt_in\",\n  visibility: \"public\"\n})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Product Updates","description":"Get the latest news about our products","defaultSubscription":"opt_in","visibility":"public"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Channel name","type":"string"},"description":{"maxLength":1000,"description":"Channel description","type":"string"},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Product Updates","description":"Get the latest news about our products","defaultSubscription":"opt_in","visibility":"public"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Channel name","type":"string"},"description":{"maxLength":1000,"description":"Channel description","type":"string"},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Product Updates","description":"Get the latest news about our products","defaultSubscription":"opt_in","visibility":"public"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Channel name","type":"string"},"description":{"maxLength":1000,"description":"Channel description","type":"string"},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"type":"object","required":["object","id","name","description","defaultSubscription","visibility","createdAt","updatedAt","event"],"properties":{"object":{"default":"channel","const":"channel","type":"string"},"id":{"description":"Unique channel identifier","type":"string"},"name":{"description":"Channel name","type":"string"},"description":{"description":"Channel description","anyOf":[{"type":"string"},{"type":"null"}]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Channel already exists","Channel with this name already exists"]}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1ChannelsCreate","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/contacts/v1/channels/{channel_id}":{"get":{"tags":["Channels"],"summary":"Retrieve Channel","description":"Retrieves a specific channel by ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channel, channelError } = await reloop.contacts.channels.get(\n  \"chn_123456789\",\n);\n\nif (channelError) throw channelError;\n\nconsole.log(channel.id, channel.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/channels/chn_123456789\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.get(\"chn_123456789\")\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channel[\"id\"], result.channel[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channel = $reloop->contacts->channels->get('chn_123456789');\necho $channel['id'] . ' ' . $channel['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar channel = reloop.contacts.channels.get(\"chn_123456789\");\nSystem.out.println(channel.id + \" \" + channel.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.GetAsync(\"chn_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nchannel, _ := client.Contacts.Channels.Get(\"chn_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().get(\"chn_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nchannel = reloop.contacts.channels.get(\"chn_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, channel} = Reloop.Services.ContactChannels.get(client, \"chn_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"description":"Channel ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"object":"channel","id":"chn_123456789","name":"Product Updates","description":"Get the latest news about our products","defaultSubscription":"opt_in","visibility":"public","createdAt":"2026-03-27T10:00:00Z","updatedAt":"2026-03-27T10:00:00Z"}],"type":"object","required":["object","id","name","description","defaultSubscription","visibility","createdAt","updatedAt"],"properties":{"object":{"default":"channel","const":"channel","type":"string"},"id":{"description":"Unique channel identifier","type":"string"},"name":{"description":"Channel name","type":"string"},"description":{"description":"Channel description","anyOf":[{"type":"string"},{"type":"null"}]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Channel not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1ChannelsByChannel_id"},"patch":{"tags":["Channels"],"summary":"Update Channel","description":"Updates an existing channel","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channel, channelError } = await reloop.contacts.channels.update(\n  \"chn_123456789\",\n  { name: \"Marketing News\" },\n);\n\nif (channelError) throw channelError;\n\nconsole.log(channel.id, channel.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/contacts/v1/channels/chn_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Marketing News\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.update(\"chn_123456789\", {\n  \"name\": \"Marketing News\",\n})\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channel[\"id\"], result.channel[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channel = $reloop->contacts->channels->update('chn_123456789', [\n    'name' => 'Marketing News',\n]);\necho $channel['id'] . ' ' . $channel['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateChannelParams params = new UpdateChannelParams();\nparams.name = \"Marketing News\";\nvar channel = reloop.contacts.channels.update(\"chn_123456789\", params);\nSystem.out.println(channel.id + \" \" + channel.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.UpdateAsync(\"chn_123456789\", new Dictionary<string, object?> { [\"name\"] = \"Marketing News\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nchannel, _ := client.Contacts.Channels.Update(\"chn_123456789\", map[string]interface{\"name\": \"Marketing News\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().update(\"chn_123456789\", UpdateChannelParams { name: Some(\"Marketing News\".to_string()), ..Default::default() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nchannel = reloop.contacts.channels.update(\"chn_123456789\", name: \"Marketing News\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, channel} = Reloop.Services.ContactChannels.update(client, \"chn_123456789\", %{name: \"Marketing News\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"description":"Channel ID","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Marketing News","description":"Internal marketing updates","visibility":"private","defaultSubscription":"opt_in"}],"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Channel name","type":"string"},"description":{"anyOf":[{"maxLength":1000,"description":"Channel description","type":"string"},{"type":"null"}]},"visibility":{"type":"string","enum":["private","public"]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Marketing News","description":"Internal marketing updates","visibility":"private","defaultSubscription":"opt_in"}],"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Channel name","type":"string"},"description":{"anyOf":[{"maxLength":1000,"description":"Channel description","type":"string"},{"type":"null"}]},"visibility":{"type":"string","enum":["private","public"]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Marketing News","description":"Internal marketing updates","visibility":"private","defaultSubscription":"opt_in"}],"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Channel name","type":"string"},"description":{"anyOf":[{"maxLength":1000,"description":"Channel description","type":"string"},{"type":"null"}]},"visibility":{"type":"string","enum":["private","public"]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","name","description","defaultSubscription","visibility","createdAt","updatedAt","event"],"properties":{"object":{"default":"channel","const":"channel","type":"string"},"id":{"description":"Unique channel identifier","type":"string"},"name":{"description":"Channel name","type":"string"},"description":{"description":"Channel description","anyOf":[{"type":"string"},{"type":"null"}]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Channel not found","type":"string"}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Channel already exists","Channel with this name already exists"]}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiContactsV1ChannelsByChannel_id"},"delete":{"tags":["Channels"],"summary":"Delete Channel","description":"Soft deletes a channel","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channel, channelError } = await reloop.contacts.channels.delete(\n  \"chn_123456789\",\n);\n\nif (channelError) throw channelError;\n\nconsole.log(channel.id, channel.success);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/contacts/v1/channels/chn_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.delete(\"chn_123456789\")\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channel[\"id\"], result.channel[\"success\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channel = $reloop->contacts->channels->delete('chn_123456789');\necho $channel['id'] . ' ' . $channel['success'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar channel = reloop.contacts.channels.delete(\"chn_123456789\");\nSystem.out.println(channel.id + \" \" + channel.success);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.DeleteAsync(\"chn_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Channels.Delete(\"chn_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().delete(\"chn_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.channels.delete(\"chn_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ContactChannels.delete(client, \"chn_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"description":"Channel ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","success","id","name","event"],"properties":{"object":{"default":"channel","const":"channel","type":"string"},"success":{"type":"boolean"},"id":{"description":"ID of the deleted channel","type":"string"},"name":{"description":"Name of the deleted channel","type":"string"},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Channel not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiContactsV1ChannelsByChannel_id"}},"/api/contacts/v1/channels/list":{"get":{"tags":["Channels"],"summary":"List Channels","description":"Retrieves a paginated list of channels","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { channels, channelError } = await reloop.contacts.channels.list({\n  page: 1,\n  limit: 10,\n});\n\nif (channelError) throw channelError;\n\nconsole.log(channels.total, channels.channels);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/channels/list?page=1&limit=10\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.channels.list({\n  \"page\": 1,\n  \"limit\": 10,\n})\n\nif result.channel_error:\n    raise result.channel_error\n\nprint(result.channels[\"total\"], result.channels[\"channels\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$channels = $reloop->contacts->channels->list([\n    'page' => 1,\n    'limit' => 10,\n]);\necho $channels['total'] . ' ' . $channels['channels'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListChannelsParams params = new ListChannelsParams();\nparams.page = 1;\nparams.limit = 10;\nvar channels = reloop.contacts.channels.list(params);\nSystem.out.println(channels.total + \" \" + channels.channels);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Channels.ListAsync(new Dictionary<string, object?> { [\"page\"] = 1, [\"limit\"] = 10 });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\nchannels, _ := client.Contacts.Channels.List(map[string]interface{}{\"page\": 1, \"limit\": 10})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().channels().list(Some(ListChannelsParams { page: Some(1), limit: Some(10), ..Default::default() })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nchannels = reloop.contacts.channels.list(page: 1, limit: 10)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, channels} = Reloop.Services.ContactChannels.list(client, %{page: 1, limit: 10})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":100,"type":"number"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","channels","total","page","limit","hasMore","nextCursor","event"],"properties":{"object":{"default":"channel","const":"channel","type":"string"},"channels":{"type":"array","items":{"type":"object","required":["id","name","description","defaultSubscription","visibility","createdAt","updatedAt"],"properties":{"id":{"description":"Unique channel identifier","type":"string"},"name":{"description":"Channel name","type":"string"},"description":{"description":"Channel description","anyOf":[{"type":"string"},{"type":"null"}]},"defaultSubscription":{"type":"string","enum":["opt_in","opt_out"]},"visibility":{"type":"string","enum":["private","public"]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"subscriberCount":{"description":"Number of subscribers","type":"number"}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the list request","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1ChannelsList"}},"/api/contacts/v1/groups/create":{"post":{"tags":["Groups"],"summary":"Create Group","description":"Creates a new group for the organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { group, groupError } = await reloop.contacts.groups.create({\n  name: \"Beta Testers\",\n});\n\nif (groupError) throw groupError;\n\nconsole.log(group.id, group.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/contacts/v1/groups/create \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Beta Testers\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.create({\n  \"name\": \"Beta Testers\",\n})\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.group[\"id\"], result.group[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$group = $reloop->contacts->groups->create([\n    'name' => 'Beta Testers',\n]);\necho $group['id'] . ' ' . $group['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nCreateGroupParams params = new CreateGroupParams();\nparams.name = \"Beta Testers\";\nvar group = reloop.contacts.groups.create(params);\nSystem.out.println(group.id + \" \" + group.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.CreateGroupAsync(new Dictionary<string, object?> { [\"name\"] = \"Beta Testers\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ngroup, _ := client.Contacts.CreateGroup(map[string]interface{}{\"name\": \"Beta Testers\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().create_group(CreateGroupParams { name: \"Beta Testers\".to_string() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ngroup = reloop.contacts.create_group(name: \"Beta Testers\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, group} = Reloop.Services.Contacts.create_group(client, %{name: \"Beta Testers\"})"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Beta Testers"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":50,"description":"Group name","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Beta Testers"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":50,"description":"Group name","type":"string"}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Beta Testers"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":50,"description":"Group name","type":"string"}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"type":"object","required":["object","id","name","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact_group","const":"contact_group","type":"string"},"id":{"description":"Unique group identifier","type":"string"},"name":{"description":"Group name","type":"string"},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User display name","type":"string"},"email":{"description":"User email","type":"string"},"image":{"nullable":true,"anyOf":[{"description":"User avatar URL","type":"string"},{"type":"null"}]}}},"event":{"description":"Event ID for the mutation","type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Group already exists","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiContactsV1GroupsCreate","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/contacts/v1/groups/{group_id}":{"get":{"tags":["Groups"],"summary":"Retrieve Group","description":"Returns group details based on group id","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { group, groupError } = await reloop.contacts.groups.get(\"grp_123456789\");\n\nif (groupError) throw groupError;\n\nconsole.log(group.id, group.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/groups/grp_123456789\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.get(\"grp_123456789\")\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.group[\"id\"], result.group[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$group = $reloop->contacts->groups->get('grp_123456789');\necho $group['id'] . ' ' . $group['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar group = reloop.contacts.groups.get(\"grp_123456789\");\nSystem.out.println(group.id + \" \" + group.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.GetGroupAsync(\"grp_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ngroup, _ := client.Contacts.GetGroup(\"grp_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().get_group(\"grp_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ngroup = reloop.contacts.get_group(\"grp_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, group} = Reloop.Services.Contacts.get_group(client, \"grp_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"object":"contact_group","id":"grp_123456789","name":"Beta Testers","createdAt":"2026-03-27T10:00:00Z","updatedAt":"2026-03-27T10:00:00Z","createdBy":{"id":"usr_123","name":"Jane Doe","email":"jane@example.com","image":null}}],"type":"object","required":["object","id","name","createdAt","updatedAt"],"properties":{"object":{"default":"contact_group","const":"contact_group","type":"string"},"id":{"description":"Unique group identifier","type":"string"},"name":{"description":"Group name","type":"string"},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User display name","type":"string"},"email":{"description":"User email","type":"string"},"image":{"nullable":true,"anyOf":[{"description":"User avatar URL","type":"string"},{"type":"null"}]}}}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Group not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1GroupsByGroup_id"},"patch":{"tags":["Groups"],"summary":"Update Group","description":"Updates group name based on group id","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { group, groupError } = await reloop.contacts.groups.update(\n  \"grp_123456789\",\n  { name: \"Loyal Customers\" },\n);\n\nif (groupError) throw groupError;\n\nconsole.log(group.id, group.name);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/contacts/v1/groups/grp_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Loyal Customers\"}'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.update(\"grp_123456789\", {\n  \"name\": \"Loyal Customers\",\n})\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.group[\"id\"], result.group[\"name\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$group = $reloop->contacts->groups->update('grp_123456789', [\n    'name' => 'Loyal Customers',\n]);\necho $group['id'] . ' ' . $group['name'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nUpdateGroupParams params = new UpdateGroupParams();\nparams.name = \"Loyal Customers\";\nvar group = reloop.contacts.groups.update(\"grp_123456789\", params);\nSystem.out.println(group.id + \" \" + group.name);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.UpdateGroupAsync(\"grp_123456789\", new Dictionary<string, object?> { [\"name\"] = \"Loyal Customers\" });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ngroup, _ := client.Contacts.UpdateGroup(\"grp_123456789\", map[string]interface{\"name\": \"Loyal Customers\"})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().update_group(\"grp_123456789\", UpdateGroupParams { name: \"Loyal Customers\".to_string() }).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ngroup = reloop.contacts.update_group(\"grp_123456789\", name: \"Loyal Customers\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, group} = Reloop.Services.Contacts.update_group(client, \"grp_123456789\", %{name: \"Loyal Customers\"})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"examples":[{"name":"Loyal Customers"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Group name","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"examples":[{"name":"Loyal Customers"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Group name","type":"string"}}}},"multipart/form-data":{"schema":{"examples":[{"name":"Loyal Customers"}],"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Group name","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","id","name","createdAt","updatedAt","event"],"properties":{"object":{"default":"contact_group","const":"contact_group","type":"string"},"id":{"description":"Unique group identifier","type":"string"},"name":{"description":"Group name","type":"string"},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User display name","type":"string"},"email":{"description":"User email","type":"string"},"image":{"nullable":true,"anyOf":[{"description":"User avatar URL","type":"string"},{"type":"null"}]}}},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Group not found","type":"string"}}}]}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Group already exists","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"patchApiContactsV1GroupsByGroup_id"},"delete":{"tags":["Groups"],"summary":"Delete Group","description":"Delete group based on group id","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { group, groupError } = await reloop.contacts.groups.delete(\"grp_123456789\");\n\nif (groupError) throw groupError;\n\nconsole.log(group.id, group.success);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/contacts/v1/groups/grp_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.delete(\"grp_123456789\")\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.group[\"id\"], result.group[\"success\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$group = $reloop->contacts->groups->delete('grp_123456789');\necho $group['id'] . ' ' . $group['success'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\n\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nvar group = reloop.contacts.groups.delete(\"grp_123456789\");\nSystem.out.println(group.id + \" \" + group.success);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.DeleteGroupAsync(\"grp_123456789\");"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.DeleteGroup(\"grp_123456789\")"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().delete_group(\"grp_123456789\").await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.delete_group(\"grp_123456789\")"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.Contacts.delete_group(client, \"grp_123456789\")"}],"security":[{"apiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","success","id","name","event"],"properties":{"object":{"default":"contact_group","const":"contact_group","type":"string"},"success":{"type":"boolean"},"id":{"description":"ID of the deleted group","type":"string"},"name":{"description":"Name of the deleted group","type":"string"},"event":{"description":"Event ID for the mutation","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Group not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiContactsV1GroupsByGroup_id"}},"/api/contacts/v1/groups/list":{"get":{"tags":["Groups"],"summary":"List Groups","description":"List all groups for the organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { groups, groupError } = await reloop.contacts.groups.list({\n  page: 1,\n  limit: 10,\n});\n\nif (groupError) throw groupError;\n\nconsole.log(groups.total, groups.groups);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/groups/list?page=1&limit=10\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.list({\n  \"page\": 1,\n  \"limit\": 10,\n})\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.groups[\"total\"], result.groups[\"groups\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$groups = $reloop->contacts->groups->list([\n    'page' => 1,\n    'limit' => 10,\n]);\necho $groups['total'] . ' ' . $groups['groups'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListGroupsParams params = new ListGroupsParams();\nparams.page = 1;\nparams.limit = 10;\nvar groups = reloop.contacts.groups.list(params);\nSystem.out.println(groups.total + \" \" + groups.groups);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.ListGroupsAsync(new Dictionary<string, object?> { [\"page\"] = 1, [\"limit\"] = 10 });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\ngroups, _ := client.Contacts.ListGroups(map[string]interface{}{\"page\": 1, \"limit\": 10})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().list_groups(Some(ListGroupsParams { page: Some(1), limit: Some(10), ..Default::default() })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\ngroups = reloop.contacts.list_groups(page: 1, limit: 10)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, groups} = Reloop.Services.Contacts.list_groups(client, %{page: 1, limit: 10})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":100,"type":"number"}},{"name":"search","in":"query","required":false,"schema":{"description":"Search by name","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","groups","total","page","limit","hasMore","nextCursor","event"],"properties":{"object":{"default":"contact_group","const":"contact_group","type":"string"},"groups":{"type":"array","items":{"examples":[{"object":"contact_group","id":"grp_123456789","name":"Beta Testers","createdAt":"2026-03-27T10:00:00Z","updatedAt":"2026-03-27T10:00:00Z","createdBy":{"id":"usr_123","name":"Jane Doe","email":"jane@example.com","image":null}}],"type":"object","required":["id","name","createdAt","updatedAt"],"properties":{"id":{"description":"Unique group identifier","type":"string"},"name":{"description":"Group name","type":"string"},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"User display name","type":"string"},"email":{"description":"User email","type":"string"},"image":{"nullable":true,"anyOf":[{"description":"User avatar URL","type":"string"},{"type":"null"}]}}}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the list request","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1GroupsList"}},"/api/contacts/v1/groups/{group_id}/contacts":{"get":{"tags":["Groups"],"summary":"List Contacts in Group","description":"List all contacts belonging to a specific group","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { contacts, groupError } = await reloop.contacts.groups.listContacts(\n  \"grp_123456789\",\n  { page: 1, limit: 10 },\n);\n\nif (groupError) throw groupError;\n\nconsole.log(contacts.total, contacts.contacts);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/api/contacts/v1/groups/grp_123456789/contacts?page=1&limit=10\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nresult = reloop.contacts.groups.listContacts(\"grp_123456789\", {\n  \"page\": 1,\n  \"limit\": 10,\n})\n\nif result.group_error:\n    raise result.group_error\n\nprint(result.contacts[\"total\"], result.contacts[\"contacts\"])"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\nrequire 'vendor/autoload.php';\n\nuse Reloop\\Reloop;\n\n$reloop = Reloop::client('rl_123456789');\n\n$contacts = $reloop->contacts->groups->listContacts('grp_123456789', [\n    'page' => 1,\n    'limit' => 10,\n]);\necho $contacts['total'] . ' ' . $contacts['contacts'] . PHP_EOL;"},{"id":"java","lang":"java","label":"Java","source":"import sh.reloop.ReloopClient;\nReloopClient reloop = new ReloopClient(\"rl_123456789\");\n\nListGroupContactsParams params = new ListGroupContactsParams();\nparams.page = 1;\nparams.limit = 10;\nvar contacts = reloop.contacts.groups.listContacts(\"grp_123456789\", params);\nSystem.out.println(contacts.total + \" \" + contacts.contacts);"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using Reloop;\nusing Reloop.Models;\n\nvar reloop = new ReloopClient(\"rl_123456789\");\n\nawait reloop.Contacts.Groups.ListContactsAsync(\"grp_123456789\", new Dictionary<string, object?> { [\"page\"] = 1, [\"limit\"] = 10 });"},{"id":"go","lang":"go","label":"Go","source":"import reloop \"github.com/reloop-labs/reloop-go\"\n\nclient, _ := reloop.NewClient(reloop.ClientOptions{\n    APIKey: \"rl_123456789\",\n})\n\n_, _ = client.Contacts.Groups.ListContacts(\"grp_123456789\", map[string]interface{\"page\": 1, \"limit\": 10})"},{"id":"rust","lang":"rust","label":"Rust","source":"use reloop::ReloopClient;\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let reloop = ReloopClient::new(\"rl_123456789\".to_string(), None);\n\n    reloop.contacts().groups().list_contacts(\"grp_123456789\", Some(ListContactsParams { page: Some(1), limit: Some(10), ..Default::default() })).await?;\n\n    Ok(())\n}"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"reloop\"\n\nreloop = Reloop::Client.new(api_key: \"rl_123456789\")\n\nreloop.contacts.groups.list_contacts(\"grp_123456789\", page: 1, limit: 10)"},{"id":"elixir","lang":"elixir","label":"Elixir","source":"client = Reloop.client(\"rl_123456789\")\n\n{:ok, result} = Reloop.Services.ContactGroups.list_contacts(client, \"grp_123456789\", %{page: 1, limit: 10})"}],"security":[{"apiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"description":"ID of the group","type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":100,"type":"number"}},{"name":"search","in":"query","required":false,"schema":{"description":"Search by email","type":"string"}},{"name":"status","in":"query","required":false,"schema":{"pattern":"^(subscribed|unsubscribed|blocked)(,(subscribed|unsubscribed|blocked))*$","description":"Filter by status. Pass one status, or several comma-separated (e.g. subscribed,blocked) to match any of them.","type":"string"}},{"name":"channelId","in":"query","required":false,"schema":{"description":"Filter to contacts enrolled in this channel (status = enrolled)","type":"string"}},{"name":"suppressed","in":"query","required":false,"schema":{"description":"Only contacts on the suppression list (blocked, or suppressed after a hard bounce, full mailbox or spam complaint). Sorted by most recently suppressed.","type":"boolean"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","group","total","subscribedContacts","unsubscribedContacts","page","limit","hasMore","nextCursor","event"],"properties":{"object":{"default":"contact_group","const":"contact_group","type":"string"},"group":{"type":"object","required":["id","name","createdAt","updatedAt","contacts"],"properties":{"id":{"description":"Group ID","type":"string"},"name":{"description":"Group name","type":"string"},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"contacts":{"type":"array","items":{"examples":[{"id":"con_123456789","email":"john.doe@example.com","firstName":"John","lastName":"Doe","status":"subscribed","properties":{"company":"Reloop","role":"Developer"},"createdAt":"2026-03-23T10:00:00Z","updatedAt":"2026-03-23T10:00:00Z"}],"type":"object","required":["id","email","firstName","lastName","status","properties","createdAt","updatedAt"],"properties":{"id":{"description":"Unique contact identifier","type":"string"},"email":{"description":"Contact email address","type":"string"},"firstName":{"description":"Contact first name","anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"description":"Contact last name","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["subscribed","unsubscribed","blocked"]},"properties":{"description":"Contact properties as key-value pairs","default":{},"type":"object","patternProperties":{"^[a-z_]+$":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"total":{"type":"number"},"subscribedContacts":{"description":"Members with subscribed status","type":"number"},"unsubscribedContacts":{"description":"Members with unsubscribed status","type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"event":{"description":"Event ID for the list request","type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"type":"string","enum":["Unauthorized access","Unauthorized"]}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Group not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiContactsV1GroupsByGroup_idContacts"}},"/api/workflow/v1/automations/":{"post":{"tags":["Automations"],"summary":"Create automation","description":"Creates an automation from `steps` and the `connections` between them. It starts as a draft unless `status` is \"active\", which validates it and starts it right away.","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.create({\n  name: \"Welcome\",\n  status: \"active\",\n  steps: [\n    { key: \"start\", type: \"trigger\", config: { eventName: \"user.signed_up\" } },\n    { key: \"is_pro\", type: \"condition\", config: { type: \"rule\", field: \"trigger.plan\", operator: \"eq\", value: \"pro\" } },\n    { key: \"welcome_pro\", type: \"send_email\", config: { template: { id: \"tmpl_123456789\" } } },\n    { key: \"wait\", type: \"delay\", config: { amount: 1, unit: \"days\" } },\n    { key: \"welcome_free\", type: \"send_email\", config: { template: { id: \"tmpl_987654321\" } } },\n  ],\n  connections: [\n    { from: \"start\", to: \"is_pro\" },\n    { from: \"is_pro\", to: \"welcome_pro\", type: \"condition_met\" },\n    { from: \"is_pro\", to: \"wait\", type: \"condition_not_met\" },\n    { from: \"wait\", to: \"welcome_free\" },\n  ],\n});\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/workflow/v1/automations \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Welcome\",\"status\":\"active\",\"steps\":[{\"key\":\"start\",\"type\":\"trigger\",\"config\":{\"eventName\":\"user.signed_up\"}},{\"key\":\"is_pro\",\"type\":\"condition\",\"config\":{\"type\":\"rule\",\"field\":\"trigger.plan\",\"operator\":\"eq\",\"value\":\"pro\"}},{\"key\":\"welcome_pro\",\"type\":\"send_email\",\"config\":{\"template\":{\"id\":\"tmpl_123456789\"}}},{\"key\":\"wait\",\"type\":\"delay\",\"config\":{\"amount\":1,\"unit\":\"days\"}},{\"key\":\"welcome_free\",\"type\":\"send_email\",\"config\":{\"template\":{\"id\":\"tmpl_987654321\"}}}],\"connections\":[{\"from\":\"start\",\"to\":\"is_pro\"},{\"from\":\"is_pro\",\"to\":\"welcome_pro\",\"type\":\"condition_met\"},{\"from\":\"is_pro\",\"to\":\"wait\",\"type\":\"condition_not_met\"},{\"from\":\"wait\",\"to\":\"welcome_free\"}]}'"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.post(\n    \"https://reloop.sh/api/workflow/v1/automations\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n    json={\n        \"name\": \"Welcome\",\n        \"status\": \"active\",\n        \"steps\": [\n            {\n                \"key\": \"start\",\n                \"type\": \"trigger\",\n                \"config\": {\n                    \"eventName\": \"user.signed_up\"\n                }\n            },\n            {\n                \"key\": \"is_pro\",\n                \"type\": \"condition\",\n                \"config\": {\n                    \"type\": \"rule\",\n                    \"field\": \"trigger.plan\",\n                    \"operator\": \"eq\",\n                    \"value\": \"pro\"\n                }\n            },\n            {\n                \"key\": \"welcome_pro\",\n                \"type\": \"send_email\",\n                \"config\": {\n                    \"template\": {\n                        \"id\": \"tmpl_123456789\"\n                    }\n                }\n            },\n            {\n                \"key\": \"wait\",\n                \"type\": \"delay\",\n                \"config\": {\n                    \"amount\": 1,\n                    \"unit\": \"days\"\n                }\n            },\n            {\n                \"key\": \"welcome_free\",\n                \"type\": \"send_email\",\n                \"config\": {\n                    \"template\": {\n                        \"id\": \"tmpl_987654321\"\n                    }\n                }\n            }\n        ],\n        \"connections\": [\n            {\n                \"from\": \"start\",\n                \"to\": \"is_pro\"\n            },\n            {\n                \"from\": \"is_pro\",\n                \"to\": \"welcome_pro\",\n                \"type\": \"condition_met\"\n            },\n            {\n                \"from\": \"is_pro\",\n                \"to\": \"wait\",\n                \"type\": \"condition_not_met\"\n            },\n            {\n                \"from\": \"wait\",\n                \"to\": \"welcome_free\"\n            }\n        ]\n    },\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Automation name","type":"string"},"description":{"maxLength":2000,"description":"Optional description","type":"string"},"status":{"type":"string","enum":["draft","active"]},"steps":{"maxItems":200,"description":"The steps, with exactly one trigger. Can be left out to create an empty draft.","type":"array","items":{"type":"object","required":["key","type"],"properties":{"key":{"description":"Unique key for this step, used by connections (1-64 letters, numbers, _ or -).","type":"string"},"type":{"description":"\"trigger\", \"send_email\", \"delay\" or \"condition\".","type":"string"},"config":{"description":"trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: \"rule\", field, operator, value } or { type: \"and\" | \"or\", rules }.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"maxItems":400,"description":"How the steps link together, by step key.","type":"array","items":{"type":"object","required":["from","to"],"properties":{"from":{"description":"Key of the step this connection leaves.","type":"string"},"to":{"description":"Key of the step it leads to.","type":"string"},"type":{"description":"\"default\" (the default), or \"condition_met\" / \"condition_not_met\" from a condition step.","type":"string"}}}},"reentry":{"type":"string","enum":["once","restart","parallel"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Automation name","type":"string"},"description":{"maxLength":2000,"description":"Optional description","type":"string"},"status":{"type":"string","enum":["draft","active"]},"steps":{"maxItems":200,"description":"The steps, with exactly one trigger. Can be left out to create an empty draft.","type":"array","items":{"type":"object","required":["key","type"],"properties":{"key":{"description":"Unique key for this step, used by connections (1-64 letters, numbers, _ or -).","type":"string"},"type":{"description":"\"trigger\", \"send_email\", \"delay\" or \"condition\".","type":"string"},"config":{"description":"trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: \"rule\", field, operator, value } or { type: \"and\" | \"or\", rules }.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"maxItems":400,"description":"How the steps link together, by step key.","type":"array","items":{"type":"object","required":["from","to"],"properties":{"from":{"description":"Key of the step this connection leaves.","type":"string"},"to":{"description":"Key of the step it leads to.","type":"string"},"type":{"description":"\"default\" (the default), or \"condition_met\" / \"condition_not_met\" from a condition step.","type":"string"}}}},"reentry":{"type":"string","enum":["once","restart","parallel"]}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Automation name","type":"string"},"description":{"maxLength":2000,"description":"Optional description","type":"string"},"status":{"type":"string","enum":["draft","active"]},"steps":{"maxItems":200,"description":"The steps, with exactly one trigger. Can be left out to create an empty draft.","type":"array","items":{"type":"object","required":["key","type"],"properties":{"key":{"description":"Unique key for this step, used by connections (1-64 letters, numbers, _ or -).","type":"string"},"type":{"description":"\"trigger\", \"send_email\", \"delay\" or \"condition\".","type":"string"},"config":{"description":"trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: \"rule\", field, operator, value } or { type: \"and\" | \"or\", rules }.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"maxItems":400,"description":"How the steps link together, by step key.","type":"array","items":{"type":"object","required":["from","to"],"properties":{"from":{"description":"Key of the step this connection leaves.","type":"string"},"to":{"description":"Key of the step it leads to.","type":"string"},"type":{"description":"\"default\" (the default), or \"condition_met\" / \"condition_not_met\" from a condition step.","type":"string"}}}},"reentry":{"type":"string","enum":["once","restart","parallel"]}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"examples":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","description","status","triggerEvent","steps","connections","graph","activeVersionId","reentry","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused"]},"triggerEvent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","type","config"],"properties":{"key":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"type":"array","items":{"type":"object","required":["from","to","type"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["default","condition_met","condition_not_met"]}}}},"graph":{"type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"activeVersionId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reentry":{"type":"string","enum":["once","restart","parallel"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiWorkflowV1Automations","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]},"get":{"tags":["Automations"],"summary":"List automations","description":"Lists automation workflows for the active organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automations, automationError } = await reloop.automations.list({ page: 1, limit: 20 });\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/workflow/v1/automations?page=1&limit=20\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.get(\n    \"https://reloop.sh/api/workflow/v1/automations?page=1&limit=20\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"description":"Page number","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"description":"Page number","type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":50,"description":"Automations per page","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":50,"description":"Automations per page","type":"number"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"automations":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"total":1,"page":1,"limit":50}],"type":"object","required":["automations","total","page","limit"],"properties":{"automations":{"type":"array","items":{"examples":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","description","status","triggerEvent","steps","connections","graph","activeVersionId","reentry","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused"]},"triggerEvent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","type","config"],"properties":{"key":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"type":"array","items":{"type":"object","required":["from","to","type"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["default","condition_met","condition_not_met"]}}}},"graph":{"type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"activeVersionId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reentry":{"type":"string","enum":["once","restart","parallel"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1Automations"}},"/api/workflow/v1/automations/{automation_id}/activate":{"post":{"tags":["Automations"],"summary":"Activate automation","description":"Publishes an immutable version snapshot and starts enrolling contacts on the trigger","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.activate(\"auto_123456789\");\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/workflow/v1/automations/auto_123456789/activate \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.post(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789/activate\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","description","status","triggerEvent","steps","connections","graph","activeVersionId","reentry","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused"]},"triggerEvent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","type","config"],"properties":{"key":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"type":"array","items":{"type":"object","required":["from","to","type"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["default","condition_met","condition_not_met"]}}}},"graph":{"type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"activeVersionId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reentry":{"type":"string","enum":["once","restart","parallel"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiWorkflowV1AutomationsByAutomation_idActivate"}},"/api/workflow/v1/automations/{automation_id}/pause":{"post":{"tags":["Automations"],"summary":"Pause automation","description":"Stops new enrollments for this automation","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.pause(\"auto_123456789\");\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/workflow/v1/automations/auto_123456789/pause \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.post(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789/pause\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","description","status","triggerEvent","steps","connections","graph","activeVersionId","reentry","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused"]},"triggerEvent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","type","config"],"properties":{"key":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"type":"array","items":{"type":"object","required":["from","to","type"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["default","condition_met","condition_not_met"]}}}},"graph":{"type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"activeVersionId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reentry":{"type":"string","enum":["once","restart","parallel"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiWorkflowV1AutomationsByAutomation_idPause"}},"/api/workflow/v1/automations/{automation_id}/enroll":{"post":{"tags":["Automations"],"summary":"Enroll a contact","description":"Starts this active automation for a contact. Pass contactId or email (email creates the contact if needed).","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { enrollment, enrollmentError } = await reloop.automations.enroll(\"auto_123456789\", {\n  email: \"john.doe@example.com\",\n  firstName: \"John\",\n});\nif (enrollmentError) throw enrollmentError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/workflow/v1/automations/auto_123456789/enroll \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"john.doe@example.com\",\"firstName\":\"John\"}'"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.post(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789/enroll\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n    json={\n        \"email\": \"john.doe@example.com\",\n        \"firstName\": \"John\"\n    },\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"description":"Contact to enroll. Pass this or email.","type":"string"},"email":{"format":"email","description":"Contact email. Creates the contact if it does not exist yet.","type":"string"},"firstName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"lastName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"contactId":{"description":"Contact to enroll. Pass this or email.","type":"string"},"email":{"format":"email","description":"Contact email. Creates the contact if it does not exist yet.","type":"string"},"firstName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"lastName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"contactId":{"description":"Contact to enroll. Pass this or email.","type":"string"},"email":{"format":"email","description":"Contact email. Creates the contact if it does not exist yet.","type":"string"},"firstName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"lastName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"enrollment":{"id":"enr_123456789","automationId":"auto_123456789","contactId":"con_123456789","contactEmail":"john.doe@example.com","contactFirstName":"John","contactLastName":"Doe","status":"active","currentNodeId":"start","enrolledAt":"2026-03-23T10:00:00.000Z","completedAt":null,"cancelledAt":null,"replacedByEnrollmentId":null,"endedAt":null},"contactCreated":false,"delayMs":0}],"type":"object","required":["enrollment","contactCreated","delayMs"],"properties":{"enrollment":{"type":"object","required":["id","automationId","contactId","contactEmail","contactFirstName","contactLastName","status","currentNodeId","enrolledAt","completedAt","cancelledAt","replacedByEnrollmentId","endedAt"],"properties":{"id":{"type":"string"},"automationId":{"type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","completed","cancelled","failed"]},"currentNodeId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"enrolledAt":{"type":"string"},"completedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replacedByEnrollmentId":{"nullable":true,"anyOf":[{"description":"The newer run that cancelled this one (re-entry \"restart\"), or null.","type":"string"},{"type":"null"}]},"endedAt":{"nullable":true,"anyOf":[{"description":"When it completed, was cancelled or failed","type":"string"},{"type":"null"}]}}},"contactCreated":{"type":"boolean"},"delayMs":{"type":"number"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiWorkflowV1AutomationsByAutomation_idEnroll"}},"/api/workflow/v1/automations/{automation_id}/enrollments":{"get":{"tags":["Automations"],"summary":"List enrollments","description":"Lists contacts enrolled in this automation","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { enrollments, enrollmentError } = await reloop.automations.enrollments.list(\"auto_123456789\", {\n  status: \"active\",\n});\nif (enrollmentError) throw enrollmentError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/workflow/v1/automations/auto_123456789/enrollments?status=active\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.get(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789/enrollments?status=active\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"description":"Page number","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"description":"Page number","type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":50,"description":"Enrollments per page","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":50,"description":"Enrollments per page","type":"number"}]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","completed","cancelled","failed"]}},{"name":"since","in":"query","required":false,"schema":{"format":"date-time","description":"Only enrollments that started at or after this time","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"enrollments":[{"id":"enr_123456789","automationId":"auto_123456789","contactId":"con_123456789","contactEmail":"john.doe@example.com","contactFirstName":"John","contactLastName":"Doe","status":"active","currentNodeId":"wait","enrolledAt":"2026-03-23T10:00:00.000Z","completedAt":null,"cancelledAt":null,"replacedByEnrollmentId":null,"endedAt":null}],"total":1,"page":1,"limit":50}],"type":"object","required":["enrollments","total","page","limit"],"properties":{"enrollments":{"type":"array","items":{"type":"object","required":["id","automationId","contactId","contactEmail","contactFirstName","contactLastName","status","currentNodeId","enrolledAt","completedAt","cancelledAt","replacedByEnrollmentId","endedAt"],"properties":{"id":{"type":"string"},"automationId":{"type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","completed","cancelled","failed"]},"currentNodeId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"enrolledAt":{"type":"string"},"completedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replacedByEnrollmentId":{"nullable":true,"anyOf":[{"description":"The newer run that cancelled this one (re-entry \"restart\"), or null.","type":"string"},{"type":"null"}]},"endedAt":{"nullable":true,"anyOf":[{"description":"When it completed, was cancelled or failed","type":"string"},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1AutomationsByAutomation_idEnrollments"}},"/api/workflow/v1/automations/{automation_id}/enrollments/{enrollment_id}":{"get":{"tags":["Automations"],"summary":"Get enrollment","description":"Retrieves an enrollment and its step runs","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { enrollment, enrollmentError } = await reloop.automations.enrollments.get(\n  \"auto_123456789\",\n  \"enr_123456789\",\n);\nif (enrollmentError) throw enrollmentError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/workflow/v1/automations/auto_123456789/enrollments/enr_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.get(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789/enrollments/enr_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}},{"name":"enrollment_id","in":"path","required":true,"schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"enrollment":{"id":"enr_123456789","automationId":"auto_123456789","contactId":"con_123456789","contactEmail":"john.doe@example.com","contactFirstName":"John","contactLastName":"Doe","status":"active","currentNodeId":"wait","enrolledAt":"2026-03-23T10:00:00.000Z","completedAt":null,"cancelledAt":null,"replacedByEnrollmentId":null,"endedAt":null},"trigger":{"eventKey":"trigger.user.signed_up","properties":{"plan":"pro"}},"graph":{"nodes":[],"edges":[]},"emails":{},"steps":[{"id":"astep_123456789","nodeId":"is_pro","nodeType":"condition","status":"completed","scheduledFor":"2026-03-23T10:00:00.000Z","startedAt":"2026-03-23T10:00:00.000Z","finishedAt":"2026-03-23T10:00:00.000Z","emailLogId":null,"error":null,"createdAt":"2026-03-23T10:00:00.000Z"},{"id":"astep_987654321","nodeId":"wait","nodeType":"delay","status":"pending","scheduledFor":"2026-03-24T10:00:00.000Z","startedAt":null,"finishedAt":null,"emailLogId":null,"error":null,"createdAt":"2026-03-23T10:00:00.000Z"}]}],"type":"object","required":["enrollment","trigger","graph","emails","steps"],"properties":{"enrollment":{"type":"object","required":["id","automationId","contactId","contactEmail","contactFirstName","contactLastName","status","currentNodeId","enrolledAt","completedAt","cancelledAt","replacedByEnrollmentId","endedAt"],"properties":{"id":{"type":"string"},"automationId":{"type":"string"},"contactId":{"type":"string"},"contactEmail":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactFirstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactLastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","completed","cancelled","failed"]},"currentNodeId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"enrolledAt":{"type":"string"},"completedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replacedByEnrollmentId":{"nullable":true,"anyOf":[{"description":"The newer run that cancelled this one (re-entry \"restart\"), or null.","type":"string"},{"type":"null"}]},"endedAt":{"nullable":true,"anyOf":[{"description":"When it completed, was cancelled or failed","type":"string"},{"type":"null"}]}}},"trigger":{"description":"The event that started it; eventKey is null when the contact was enrolled directly","type":"object","required":["eventKey","properties"],"properties":{"eventKey":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"graph":{"description":"The published version of the steps this run follows","type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"emails":{"description":"For each send_email step (by step ID): the email it sends this contact, or sent","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["from","to","subject","templateId","templateName","html","sent","emailId","deliveryStatus","problem"],"properties":{"from":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"type":"string"},"subject":{"type":"string"},"templateId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"templateName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"html":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sent":{"description":"True once it went out; the fields are then what was sent","type":"boolean"},"emailId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"deliveryStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"problem":{"nullable":true,"anyOf":[{"description":"Why it can't be sent as configured","type":"string"},{"type":"null"}]}}}}},"steps":{"type":"array","items":{"type":"object","required":["id","nodeId","nodeType","status","scheduledFor","startedAt","finishedAt","emailLogId","error","createdAt"],"properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"nodeType":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","skipped","failed"]},"scheduledFor":{"type":"string"},"startedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"finishedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"emailLogId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"description":"When the step was scheduled (a delay starts waiting here)","type":"string"}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1AutomationsByAutomation_idEnrollmentsByEnrollment_id"}},"/api/workflow/v1/automations/{automation_id}/metrics":{"get":{"tags":["Automations"],"summary":"Get automation metrics","description":"Runs by status, emails sent and opened, what happened at each step, and runs started per day","security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}},{"name":"days","in":"query","required":false,"schema":{"minimum":1,"maximum":90,"default":30,"description":"How many days the daily breakdown covers","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":90,"default":30,"description":"How many days the daily breakdown covers","type":"number"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"runs":{"total":120,"active":14,"completed":98,"cancelled":5,"failed":3,"averageDurationMs":86400000},"emails":{"sent":196,"delivered":190,"opened":121,"clicked":37,"bounced":2},"steps":[{"nodeId":"welcome_pro","nodeType":"send_email","pending":0,"running":0,"completed":40,"skipped":1,"failed":0,"emails":{"sent":40,"delivered":39,"opened":28,"clicked":11,"bounced":0}}],"daily":[{"date":"2026-03-23","total":6,"active":1,"completed":5,"cancelled":0,"failed":0,"emails":{"sent":5,"delivered":5,"opened":3,"clicked":1,"bounced":0}}]}],"type":"object","required":["runs","emails","steps","daily"],"properties":{"runs":{"type":"object","required":["total","active","completed","cancelled","failed","averageDurationMs"],"properties":{"total":{"type":"number"},"active":{"type":"number"},"completed":{"type":"number"},"cancelled":{"type":"number"},"failed":{"type":"number"},"averageDurationMs":{"nullable":true,"anyOf":[{"description":"Average time to complete a run","type":"number"},{"type":"null"}]}}},"emails":{"type":"object","required":["sent","delivered","opened","clicked","bounced"],"properties":{"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"}}},"steps":{"description":"What happened at each step, across every run","type":"array","items":{"type":"object","required":["nodeId","nodeType","pending","running","completed","skipped","failed","emails"],"properties":{"nodeId":{"type":"string"},"nodeType":{"type":"string"},"pending":{"type":"number"},"running":{"type":"number"},"completed":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"},"emails":{"type":"object","required":["sent","delivered","opened","clicked","bounced"],"properties":{"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"}}}}}},"daily":{"description":"Per day: runs started (by their current status) and what happened to this automation's emails","type":"array","items":{"type":"object","required":["date","total","active","completed","cancelled","failed","emails"],"properties":{"date":{"type":"string"},"total":{"type":"number"},"active":{"type":"number"},"completed":{"type":"number"},"cancelled":{"type":"number"},"failed":{"type":"number"},"emails":{"type":"object","required":["sent","delivered","opened","clicked","bounced"],"properties":{"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"}}}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1AutomationsByAutomation_idMetrics"}},"/api/workflow/v1/automations/{automation_id}":{"get":{"tags":["Automations"],"summary":"Get automation","description":"Retrieves an automation workflow by ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.get(\"auto_123456789\");\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/workflow/v1/automations/auto_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.get(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","description","status","triggerEvent","steps","connections","graph","activeVersionId","reentry","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused"]},"triggerEvent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","type","config"],"properties":{"key":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"type":"array","items":{"type":"object","required":["from","to","type"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["default","condition_met","condition_not_met"]}}}},"graph":{"type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"activeVersionId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reentry":{"type":"string","enum":["once","restart","parallel"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1AutomationsByAutomation_id"},"patch":{"tags":["Automations"],"summary":"Update automation","description":"Updates automation name, description, re-entry, or draft graph","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.update(\"auto_123456789\", {\n  name: \"Welcome series\",\n  description: \"Greets new sign-ups\",\n});\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/workflow/v1/automations/auto_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Welcome series\",\"description\":\"Greets new sign-ups\"}'"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.patch(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n    json={\n        \"name\": \"Welcome series\",\n        \"description\": \"Greets new sign-ups\"\n    },\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Automation name","type":"string"},"description":{"description":"Description, or null to clear it","anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"graph":{"description":"Used by the dashboard editor. Send steps and connections instead.","type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"steps":{"maxItems":200,"description":"Replaces all steps (send `connections` with it).","type":"array","items":{"type":"object","required":["key","type"],"properties":{"key":{"description":"Unique key for this step, used by connections (1-64 letters, numbers, _ or -).","type":"string"},"type":{"description":"\"trigger\", \"send_email\", \"delay\" or \"condition\".","type":"string"},"config":{"description":"trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: \"rule\", field, operator, value } or { type: \"and\" | \"or\", rules }.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"maxItems":400,"description":"Replaces all connections (send `steps` with it).","type":"array","items":{"type":"object","required":["from","to"],"properties":{"from":{"description":"Key of the step this connection leaves.","type":"string"},"to":{"description":"Key of the step it leads to.","type":"string"},"type":{"description":"\"default\" (the default), or \"condition_met\" / \"condition_not_met\" from a condition step.","type":"string"}}}},"status":{"type":"string","enum":["active","paused"]},"reentry":{"type":"string","enum":["once","restart","parallel"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Automation name","type":"string"},"description":{"description":"Description, or null to clear it","anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"graph":{"description":"Used by the dashboard editor. Send steps and connections instead.","type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"steps":{"maxItems":200,"description":"Replaces all steps (send `connections` with it).","type":"array","items":{"type":"object","required":["key","type"],"properties":{"key":{"description":"Unique key for this step, used by connections (1-64 letters, numbers, _ or -).","type":"string"},"type":{"description":"\"trigger\", \"send_email\", \"delay\" or \"condition\".","type":"string"},"config":{"description":"trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: \"rule\", field, operator, value } or { type: \"and\" | \"or\", rules }.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"maxItems":400,"description":"Replaces all connections (send `steps` with it).","type":"array","items":{"type":"object","required":["from","to"],"properties":{"from":{"description":"Key of the step this connection leaves.","type":"string"},"to":{"description":"Key of the step it leads to.","type":"string"},"type":{"description":"\"default\" (the default), or \"condition_met\" / \"condition_not_met\" from a condition step.","type":"string"}}}},"status":{"type":"string","enum":["active","paused"]},"reentry":{"type":"string","enum":["once","restart","parallel"]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Automation name","type":"string"},"description":{"description":"Description, or null to clear it","anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"graph":{"description":"Used by the dashboard editor. Send steps and connections instead.","type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"steps":{"maxItems":200,"description":"Replaces all steps (send `connections` with it).","type":"array","items":{"type":"object","required":["key","type"],"properties":{"key":{"description":"Unique key for this step, used by connections (1-64 letters, numbers, _ or -).","type":"string"},"type":{"description":"\"trigger\", \"send_email\", \"delay\" or \"condition\".","type":"string"},"config":{"description":"trigger: { eventName }. send_email: { template: { id }, from?, subject? }. delay: { amount, unit }. condition: { type: \"rule\", field, operator, value } or { type: \"and\" | \"or\", rules }.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"maxItems":400,"description":"Replaces all connections (send `steps` with it).","type":"array","items":{"type":"object","required":["from","to"],"properties":{"from":{"description":"Key of the step this connection leaves.","type":"string"},"to":{"description":"Key of the step it leads to.","type":"string"},"type":{"description":"\"default\" (the default), or \"condition_met\" / \"condition_not_met\" from a condition step.","type":"string"}}}},"status":{"type":"string","enum":["active","paused"]},"reentry":{"type":"string","enum":["once","restart","parallel"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"auto_123456789","organizationId":"org_123456789","name":"Welcome","description":"Greets new sign-ups","status":"active","triggerEvent":"trigger.user.signed_up","steps":[{"key":"start","type":"trigger","config":{"eventName":"trigger.user.signed_up"}},{"key":"is_pro","type":"condition","config":{"type":"rule","field":"trigger.plan","operator":"eq","value":"pro"}},{"key":"welcome_pro","type":"send_email","config":{"template":{"id":"tmpl_123456789"}}},{"key":"wait","type":"delay","config":{"amount":1,"unit":"days"}},{"key":"welcome_free","type":"send_email","config":{"template":{"id":"tmpl_987654321"}}}],"connections":[{"from":"start","to":"is_pro","type":"default"},{"from":"is_pro","to":"welcome_pro","type":"condition_met"},{"from":"is_pro","to":"wait","type":"condition_not_met"},{"from":"wait","to":"welcome_free","type":"default"}],"graph":{"nodes":[],"edges":[]},"activeVersionId":"autov_123456789","reentry":"once","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","description","status","triggerEvent","steps","connections","graph","activeVersionId","reentry","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused"]},"triggerEvent":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","type","config"],"properties":{"key":{"type":"string"},"type":{"type":"string"},"config":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"connections":{"type":"array","items":{"type":"object","required":["from","to","type"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["default","condition_met","condition_not_met"]}}}},"graph":{"type":"object","required":["nodes","edges"],"properties":{"nodes":{"type":"array","items":{"type":"object","required":["id","type","position","data"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"position":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number"},"y":{"type":"number"}}},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"edges":{"type":"array","items":{"type":"object","required":["id","source","target"],"properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"activeVersionId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reentry":{"type":"string","enum":["once","restart","parallel"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiWorkflowV1AutomationsByAutomation_id"},"delete":{"tags":["Automations"],"summary":"Delete automation","description":"Soft-deletes an automation workflow","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.delete(\"auto_123456789\");\nif (automationError) throw automationError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/workflow/v1/automations/auto_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.delete(\n    \"https://reloop.sh/api/workflow/v1/automations/auto_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"automation_id","in":"path","required":true,"schema":{"minLength":1,"description":"Automation ID (auto_...)","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"id":"auto_123456789"}],"type":"object","required":["success","id"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiWorkflowV1AutomationsByAutomation_id"}},"/api/workflow/v1/events/":{"post":{"tags":["Events"],"summary":"Create event","description":"Creates an org-defined workflow event with optional property schema. Used only as automation triggers — not webhooks.","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { trigger, triggerError } = await reloop.automations.triggers.create({\n  name: \"User signed up\",\n  key: \"user.signed_up\",\n  properties: [{ name: \"plan\", propertyType: \"string\", required: true }],\n});\nif (triggerError) throw triggerError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/workflow/v1/events \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"User signed up\",\"key\":\"user.signed_up\",\"properties\":[{\"name\":\"plan\",\"propertyType\":\"string\",\"required\":true}]}'"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.post(\n    \"https://reloop.sh/api/workflow/v1/events\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n    json={\n        \"name\": \"User signed up\",\n        \"key\": \"user.signed_up\",\n        \"properties\": [\n            {\n                \"name\": \"plan\",\n                \"propertyType\": \"string\",\n                \"required\": True\n            }\n        ]\n    },\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Display name, e.g. User signed up","type":"string"},"key":{"minLength":1,"maxLength":128,"description":"What you pass when tracking. Made from the name if left out; \"trigger.\" is added in front if missing.","type":"string"},"description":{"maxLength":2000,"type":"string"},"properties":{"maxItems":50,"description":"Properties the event can carry","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$","description":"Property key in the track payload","type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"description":"Tracking without it fails. Defaults to false.","type":"boolean"},"defaultValue":{"description":"Used when tracking leaves the property out","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Display name, e.g. User signed up","type":"string"},"key":{"minLength":1,"maxLength":128,"description":"What you pass when tracking. Made from the name if left out; \"trigger.\" is added in front if missing.","type":"string"},"description":{"maxLength":2000,"type":"string"},"properties":{"maxItems":50,"description":"Properties the event can carry","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$","description":"Property key in the track payload","type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"description":"Tracking without it fails. Defaults to false.","type":"boolean"},"defaultValue":{"description":"Used when tracking leaves the property out","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Display name, e.g. User signed up","type":"string"},"key":{"minLength":1,"maxLength":128,"description":"What you pass when tracking. Made from the name if left out; \"trigger.\" is added in front if missing.","type":"string"},"description":{"maxLength":2000,"type":"string"},"properties":{"maxItems":50,"description":"Properties the event can carry","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$","description":"Property key in the track payload","type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"description":"Tracking without it fails. Defaults to false.","type":"boolean"},"defaultValue":{"description":"Used when tracking leaves the property out","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"responses":{"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"examples":[{"id":"evt_123456789","organizationId":"org_123456789","name":"User signed up","key":"trigger.user.signed_up","description":"Fired when an account is created","properties":[{"id":"evtp_123456789","name":"plan","propertyType":"string","required":true,"defaultValue":null,"description":"The plan they picked","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","key","description","properties","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"key":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"array","items":{"type":"object","required":["id","name","propertyType","required","defaultValue","description","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"type":"boolean"},"defaultValue":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiWorkflowV1Events","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]},"get":{"tags":["Events"],"summary":"List events","description":"Lists org-defined events and their property schemas","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { triggers, triggerError } = await reloop.automations.triggers.list({ page: 1, limit: 20 });\nif (triggerError) throw triggerError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://reloop.sh/api/workflow/v1/events?page=1&limit=20\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.get(\n    \"https://reloop.sh/api/workflow/v1/events?page=1&limit=20\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"minimum":1,"default":1,"description":"Page number","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"description":"Page number","type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"default":50,"description":"Events per page","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":50,"description":"Events per page","type":"number"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"events":[{"id":"evt_123456789","organizationId":"org_123456789","name":"User signed up","key":"trigger.user.signed_up","description":"Fired when an account is created","properties":[{"id":"evtp_123456789","name":"plan","propertyType":"string","required":true,"defaultValue":null,"description":"The plan they picked","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"total":1,"page":1,"limit":50}],"type":"object","required":["events","total","page","limit"],"properties":{"events":{"type":"array","items":{"examples":[{"id":"evt_123456789","organizationId":"org_123456789","name":"User signed up","key":"trigger.user.signed_up","description":"Fired when an account is created","properties":[{"id":"evtp_123456789","name":"plan","propertyType":"string","required":true,"defaultValue":null,"description":"The plan they picked","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","key","description","properties","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"key":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"array","items":{"type":"object","required":["id","name","propertyType","required","defaultValue","description","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"type":"boolean"},"defaultValue":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1Events"}},"/api/workflow/v1/events/track":{"post":{"tags":["Events"],"summary":"Track event","description":"Fires a workflow-only custom event: validates properties and enrolls matching automations. Pass email to create the contact if it does not exist. Not related to outbound webhooks.","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { automation, automationError } = await reloop.automations.start({\n  event: \"user.signed_up\",\n  email: \"john.doe@example.com\",\n  properties: { plan: \"pro\" },\n});\nif (automationError) throw automationError;"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.post(\n    \"https://reloop.sh/api/workflow/v1/events/track\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n    json={\n        \"event\": \"user.signed_up\",\n        \"email\": \"john.doe@example.com\",\n        \"properties\": {\"plan\": \"pro\"},\n    },\n)\nres.raise_for_status()"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n\n$ch = curl_init('https://reloop.sh/api/workflow/v1/events/track');\ncurl_setopt_array($ch, [\n    CURLOPT_POST => true,\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'x-api-key: rl_123456789',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'event' => 'user.signed_up',\n        'email' => 'john.doe@example.com',\n        'properties' => ['plan' => 'pro'],\n    ]),\n]);\n$response = curl_exec($ch);"},{"id":"go","lang":"go","label":"Go","source":"body := strings.NewReader(`{\n  \"event\": \"user.signed_up\",\n  \"email\": \"john.doe@example.com\",\n  \"properties\": {\"plan\": \"pro\"}\n}`)\n\nreq, _ := http.NewRequest(\"POST\", \"https://reloop.sh/api/workflow/v1/events/track\", body)\nreq.Header.Set(\"x-api-key\", \"rl_123456789\")\nreq.Header.Set(\"Content-Type\", \"application/json\")\n\nres, err := http.DefaultClient.Do(req)"},{"id":"ruby","lang":"ruby","label":"Ruby","source":"require \"net/http\"\nrequire \"json\"\n\nuri = URI(\"https://reloop.sh/api/workflow/v1/events/track\")\nres = Net::HTTP.post(\n  uri,\n  {\n    event: \"user.signed_up\",\n    email: \"john.doe@example.com\",\n    properties: { plan: \"pro\" },\n  }.to_json,\n  \"x-api-key\" => \"rl_123456789\",\n  \"Content-Type\" => \"application/json\",\n)"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/workflow/v1/events/track \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"event\": \"user.signed_up\",\"email\": \"john.doe@example.com\",\"properties\": {\"plan\": \"pro\"}}'"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event"],"properties":{"event":{"minLength":1,"maxLength":128,"description":"The event key, e.g. user.signed_up. The \"trigger.\" prefix is optional.","type":"string"},"contactId":{"description":"Contact the event happened to. Pass this or email.","type":"string"},"email":{"format":"email","description":"Contact email. Creates the contact if it does not exist yet.","type":"string"},"firstName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"lastName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"properties":{"description":"Values for the event's properties. Conditions read them as trigger.<name>.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["event"],"properties":{"event":{"minLength":1,"maxLength":128,"description":"The event key, e.g. user.signed_up. The \"trigger.\" prefix is optional.","type":"string"},"contactId":{"description":"Contact the event happened to. Pass this or email.","type":"string"},"email":{"format":"email","description":"Contact email. Creates the contact if it does not exist yet.","type":"string"},"firstName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"lastName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"properties":{"description":"Values for the event's properties. Conditions read them as trigger.<name>.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["event"],"properties":{"event":{"minLength":1,"maxLength":128,"description":"The event key, e.g. user.signed_up. The \"trigger.\" prefix is optional.","type":"string"},"contactId":{"description":"Contact the event happened to. Pass this or email.","type":"string"},"email":{"format":"email","description":"Contact email. Creates the contact if it does not exist yet.","type":"string"},"firstName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"lastName":{"maxLength":255,"description":"Used when the contact is created from email","type":"string"},"properties":{"description":"Values for the event's properties. Conditions read them as trigger.<name>.","type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"eventId":"evt_123456789","eventKey":"trigger.user.signed_up","contactId":"con_123456789","contactCreated":false,"enrollments":1,"properties":{"plan":"pro"}}],"type":"object","required":["success","eventId","eventKey","contactId","contactCreated","enrollments","properties"],"properties":{"success":{"type":"boolean"},"eventId":{"type":"string"},"eventKey":{"type":"string"},"contactId":{"type":"string"},"contactCreated":{"type":"boolean"},"enrollments":{"description":"How many automations this started","type":"number"},"properties":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiWorkflowV1EventsTrack","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/workflow/v1/events/{event_id}":{"get":{"tags":["Events"],"summary":"Get event","description":"Retrieves an event by ID or key, including properties","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { trigger, triggerError } = await reloop.automations.triggers.get(\"evt_123456789\");\nif (triggerError) throw triggerError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://reloop.sh/api/workflow/v1/events/evt_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.get(\n    \"https://reloop.sh/api/workflow/v1/events/evt_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"evt_123456789","organizationId":"org_123456789","name":"User signed up","key":"trigger.user.signed_up","description":"Fired when an account is created","properties":[{"id":"evtp_123456789","name":"plan","propertyType":"string","required":true,"defaultValue":null,"description":"The plan they picked","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","key","description","properties","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"key":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"array","items":{"type":"object","required":["id","name","propertyType","required","defaultValue","description","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"type":"boolean"},"defaultValue":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiWorkflowV1EventsByEvent_id"},"patch":{"tags":["Events"],"summary":"Update event","description":"Updates name/description and optionally replaces the property schema","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { trigger, triggerError } = await reloop.automations.triggers.update(\"evt_123456789\", {\n  description: \"Fired when an account is created\",\n  properties: [{ name: \"plan\", propertyType: \"string\", required: true }],\n});\nif (triggerError) throw triggerError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PATCH https://reloop.sh/api/workflow/v1/events/evt_123456789 \\\n  -H \"x-api-key: rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"description\":\"Fired when an account is created\",\"properties\":[{\"name\":\"plan\",\"propertyType\":\"string\",\"required\":true}]}'"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.patch(\n    \"https://reloop.sh/api/workflow/v1/events/evt_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n    json={\n        \"description\": \"Fired when an account is created\",\n        \"properties\": [\n            {\n                \"name\": \"plan\",\n                \"propertyType\": \"string\",\n                \"required\": True\n            }\n        ]\n    },\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"minLength":1,"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Display name","type":"string"},"description":{"description":"Description, or null to clear it","anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"properties":{"maxItems":50,"description":"Replaces every property","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$","description":"Property key in the track payload","type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"description":"Tracking without it fails. Defaults to false.","type":"boolean"},"defaultValue":{"description":"Used when tracking leaves the property out","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Display name","type":"string"},"description":{"description":"Description, or null to clear it","anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"properties":{"maxItems":50,"description":"Replaces every property","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$","description":"Property key in the track payload","type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"description":"Tracking without it fails. Defaults to false.","type":"boolean"},"defaultValue":{"description":"Used when tracking leaves the property out","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Display name","type":"string"},"description":{"description":"Description, or null to clear it","anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"properties":{"maxItems":50,"description":"Replaces every property","type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$","description":"Property key in the track payload","type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"description":"Tracking without it fails. Defaults to false.","type":"boolean"},"defaultValue":{"description":"Used when tracking leaves the property out","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"id":"evt_123456789","organizationId":"org_123456789","name":"User signed up","key":"trigger.user.signed_up","description":"Fired when an account is created","properties":[{"id":"evtp_123456789","name":"plan","propertyType":"string","required":true,"defaultValue":null,"description":"The plan they picked","createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"createdAt":"2026-03-23T10:00:00.000Z","updatedAt":"2026-03-23T10:00:00.000Z"}],"type":"object","required":["id","organizationId","name","key","description","properties","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"key":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"properties":{"type":"array","items":{"type":"object","required":["id","name","propertyType","required","defaultValue","description","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"propertyType":{"type":"string","enum":["string","number","boolean"]},"required":{"type":"boolean"},"defaultValue":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiWorkflowV1EventsByEvent_id"},"delete":{"tags":["Events"],"summary":"Delete event","description":"Soft-deletes a custom event definition","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst { trigger, triggerError } = await reloop.automations.triggers.delete(\"evt_123456789\");\nif (triggerError) throw triggerError;"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/api/workflow/v1/events/evt_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nres = requests.delete(\n    \"https://reloop.sh/api/workflow/v1/events/evt_123456789\",\n    headers={\"x-api-key\": \"rl_123456789\"},\n)\nres.raise_for_status()\nprint(res.json())"}],"security":[{"apiKey":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"examples":[{"success":true,"id":"evt_123456789"}],"type":"object","required":["success","id"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiWorkflowV1EventsByEvent_id"}},"/api/logs/v1/list":{"get":{"tags":["Logs"],"summary":"List Logs","description":"Returns log entries with optional filtering.","x-codeSamples":[{"id":"node","lang":"js","label":"Node.js","source":"const response = await fetch(\"https://api.reloop.sh/api/logs/v1/?page=1&limit=10\", {\n  method: \"GET\",\n  headers: {\n    \"x-api-key\": \"rl_123456789\"\n  }\n});\n\nconst logs = await response.json();"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET \"https://api.reloop.sh/api/logs/v1/?page=1&limit=10\" \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://api.reloop.sh/api/logs/v1/\",\n    headers={\n        \"x-api-key\": \"rl_123456789\"\n    },\n    params={\n        \"page\": 1,\n        \"limit\": 10\n    }\n)\n\nlogs = response.json()"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->get('https://api.reloop.sh/api/logs/v1/', [\n    'headers' => [\n        'x-api-key' => 'rl_123456789'\n    ],\n    'query' => [\n        'page' => 1,\n        'limit' => 10\n    ]\n]);\n\n$logs = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.reloop.sh/api/logs/v1/?page=1&limit=10\"))\n    .header(\"x-api-key\", \"rl_123456789\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-api-key\", \"rl_123456789\");\n\nvar response = await client.GetAsync(\n    \"https://api.reloop.sh/api/logs/v1/?page=1&limit=10\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string","enum":["debug","info","warn","error","fatal"]}},{"name":"event","in":"query","required":false,"schema":{"description":"Filter by event name (partial match)","type":"string"}},{"name":"status_code","in":"query","required":false,"schema":{"description":"Filter by status code (number or 'success', 'error')","type":"string"}},{"name":"search","in":"query","required":false,"schema":{"description":"Search across event name and metadata","type":"string"}},{"name":"organization_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"format":"date-time","description":"Filter logs from this date (ISO 8601)","type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"format":"date-time","description":"Filter logs until this date (ISO 8601)","type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"minimum":1,"maximum":100,"description":"Maximum number of log entries to return","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"description":"Maximum number of log entries to return","type":"number"}]}},{"name":"page","in":"query","required":false,"schema":{"minimum":1,"description":"Page number for pagination","anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Page number for pagination","type":"number"}]}},{"name":"service","in":"query","required":false,"schema":{"description":"Filter by source service (api_key, domain, mailing…)","type":"string"}},{"name":"action","in":"query","required":false,"schema":{"description":"Filter by action verb (created, deleted, sent…)","type":"string"}},{"name":"resource_type","in":"query","required":false,"schema":{"description":"Filter by resource type (api_key, domain, email…)","type":"string"}},{"name":"resource_id","in":"query","required":false,"schema":{"description":"Filter by specific resource ID","type":"string"}},{"name":"actor_type","in":"query","required":false,"schema":{"type":"string","enum":["user","api_key","system"]}},{"name":"actor_id","in":"query","required":false,"schema":{"description":"Filter by actor ID (user_id or api_key_id)","type":"string"}},{"name":"environment","in":"query","required":false,"schema":{"type":"string","enum":["production","development","test"]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["logs","count","hasMore","nextCursor"],"properties":{"logs":{"type":"array","items":{"type":"object","required":["uuid","event","level","trace_id","metadata","status_code","created_at","requestDetails","request_body"],"properties":{"uuid":{"description":"Unique log identifier","type":"string"},"event":{"description":"Event or log name","type":"string"},"level":{"description":"Stored log level","type":"string"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{},"status_code":{"description":"HTTP status code","anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"format":"date-time","type":"string"},"requestDetails":{},"request_body":{"description":"The request body sent by the user"},"actor_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"service":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}]},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"environment":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"count":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"stats":{"type":"object","required":["debug","info","warn","error","fatal"],"properties":{"debug":{"type":"number"},"info":{"type":"number"},"warn":{"type":"number"},"error":{"type":"number"},"fatal":{"type":"number"}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1List"}},"/api/logs/v1/{log_id}":{"get":{"tags":["Logs"],"summary":"Get Log","description":"Returns a single log entry by id.","x-codeSamples":[{"id":"node","lang":"js","label":"Node.js","source":"const response = await fetch(\"https://api.reloop.sh/api/logs/v1/log_123456789\", {\n  method: \"GET\",\n  headers: {\n    \"x-api-key\": \"rl_123456789\"\n  }\n});\n\nconst log = await response.json();"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X GET https://api.reloop.sh/api/logs/v1/log_123456789 \\\n  -H \"x-api-key: rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nresponse = requests.get(\n    \"https://api.reloop.sh/api/logs/v1/log_123456789\",\n    headers={\n        \"x-api-key\": \"rl_123456789\"\n    }\n)\n\nlog = response.json()"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->get('https://api.reloop.sh/api/logs/v1/log_123456789', [\n    'headers' => [\n        'x-api-key' => 'rl_123456789'\n    ]\n]);\n\n$log = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.reloop.sh/api/logs/v1/log_123456789\"))\n    .header(\"x-api-key\", \"rl_123456789\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-api-key\", \"rl_123456789\");\n\nvar response = await client.GetAsync(\n    \"https://api.reloop.sh/api/logs/v1/log_123456789\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"minLength":1,"description":"Unique log identifier","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["uuid","event","level","trace_id","metadata","status_code","created_at","requestDetails","request_body"],"properties":{"uuid":{"description":"Unique event identifier","type":"string"},"event":{"description":"Event name","type":"string"},"level":{"description":"Stored log level","type":"string"},"trace_id":{"description":"Distributed trace identifier","anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"description":"Additional structured metadata"},"status_code":{"description":"HTTP status code","anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"format":"date-time","type":"string"},"requestDetails":{},"request_body":{"description":"The request body sent by the user"},"email":{"description":"Enriched email log details. Only present when the log metadata contains an email ID."},"actor_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"service":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}]},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}]},"environment":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Log not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1ByLog_id"}},"/api/logs/v1/emails":{"get":{"tags":["Logs"],"summary":"List Email Logs","description":"Returns email logs for the active organization.","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":1,"type":"number","anyOf":[{"default":0,"type":"string","format":"numeric"},{"default":1,"type":"number"}]}]}},{"name":"limit","in":"query","required":false,"schema":{"default":10,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":10,"type":"number","anyOf":[{"default":0,"type":"string","format":"numeric"},{"default":10,"type":"number"}]}]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"domain","in":"query","required":false,"schema":{"type":"string"}},{"name":"api_key_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"recipient","in":"query","required":false,"schema":{"description":"Return only emails sent to this recipient address","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","data","total","page","limit","hasMore","nextCursor"],"properties":{"object":{"const":"list","type":"string"},"data":{"type":"array","items":{"type":"object","required":["id","subject","fromEmail","toEmails","status","createdAt"],"properties":{"id":{"type":"string"},"subject":{"type":"string"},"fromEmail":{"type":"string"},"toEmails":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"createdAt":{"type":"string"},"hasAttachments":{"type":"boolean"},"source":{"type":"string"},"origin":{"anyOf":[{"type":"object","required":["type","id","name"],"properties":{"type":{"anyOf":[{"const":"campaign","type":"string"},{"const":"automation","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1Emails"}},"/api/logs/v1/onboarding/dashboard":{"post":{"tags":["Logs","Onboarding"],"summary":"Attribute onboarding email log on Go to Dashboard","description":"Session-authenticated. Body { apiKey }. Attributes onboarding email_log + activity_log to the API key's organizationId (not the session active org).","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"minLength":1,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"minLength":1,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"minLength":1,"type":"string"}}}}}},"operationId":"postApiLogsV1OnboardingDashboard","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/logs/v1/emails/contact-activity":{"get":{"tags":["Logs"],"summary":"Get Contact Email Activity","description":"Returns all emails sent to a given recipient address with full event timelines. Used to power the Activity section on contact detail pages.","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"email","in":"query","required":true,"schema":{"description":"Recipient email address","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":1,"minimum":1,"type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"default":10,"minimum":1,"maximum":50,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":10,"minimum":1,"maximum":50,"type":"number"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","email","data","total","page","limit","hasMore","nextCursor","stats","engagement"],"properties":{"object":{"const":"contact_activity","type":"string"},"email":{"type":"string"},"data":{"type":"array","items":{"type":"object","required":["id","subject","fromEmail","toEmails","status","sentAt","deliveredAt","failedAt","errorMessage","createdAt","events"],"properties":{"id":{"type":"string"},"subject":{"type":"string"},"fromEmail":{"type":"string"},"toEmails":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"failedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"events":{"type":"array","items":{"type":"object","required":["id","type","metadata","createdAt"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"metadata":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}}}}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"stats":{"type":"object","required":["total","sent","delivered","opened","clicked","bounced","failed","complained"],"properties":{"total":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"opened":{"type":"number"},"clicked":{"type":"number"},"bounced":{"type":"number"},"failed":{"type":"number"},"complained":{"type":"number"}}},"engagement":{"type":"object","required":["score","rating"],"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"rating":{"type":"string","enum":["New","Excellent","Good","Fair","At risk","Poor"]}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1EmailsContact-activity"}},"/api/logs/v1/contacts/{contact_id}/history":{"get":{"tags":["Logs"],"summary":"Get Contact Action History","description":"Returns profile and membership actions for a contact (updates, groups, channels). Powers the Activity timeline on contact detail pages alongside email activity.","security":[{"apiKey":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"minLength":1,"description":"Contact ID","type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"default":1,"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":1,"minimum":1,"type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"minimum":1,"maximum":50,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"default":20,"minimum":1,"maximum":50,"type":"number"}]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["object","contactId","data","total","page","limit","hasMore","nextCursor"],"properties":{"object":{"const":"contact_history","type":"string"},"contactId":{"type":"string"},"data":{"type":"array","items":{"type":"object","required":["id","event","action","createdAt","actorType","actorId","actorName","actorImage","title","summary","changes","requestBody","metadata"],"properties":{"id":{"type":"string"},"event":{"type":"string"},"action":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"actorType":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","required":["field","from","to"],"properties":{"field":{"type":"string"},"from":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}]},"to":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}]},"label":{"type":"string"}}}},{"type":"null"}]},"requestBody":{"anyOf":[{},{"type":"null"}]},"metadata":{}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1ContactsByContact_idHistory"}},"/api/logs/v1/emails/{id}":{"get":{"tags":["Logs"],"summary":"Get Email Log Details","description":"Returns detailed information for a specific email log.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","messageId","organizationId","domainId","fromEmail","fromName","toEmails","ccEmails","bccEmails","replyTo","subject","textBody","htmlBody","status","errorMessage","provider","size","headers","sentAt","deliveredAt","failedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"messageId":{"type":"string"},"organizationId":{"type":"string"},"domainId":{"type":"string"},"fromEmail":{"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"toEmails":{"type":"array","items":{"type":"string"}},"ccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bccEmails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"string"},"textBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"htmlBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"rawMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"type":"string"},"size":{"type":"number"},"headers":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"failedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","contentType","size","storagePath"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"number"},"storagePath":{"type":"string"},"contentDisposition":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"events":{"type":"array","items":{"type":"object","required":["id","type","metadata","createdAt"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"metadata":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}}}},"source":{"type":"string"},"origin":{"anyOf":[{"type":"object","required":["type","id","name"],"properties":{"type":{"anyOf":[{"const":"campaign","type":"string"},{"const":"automation","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Email log not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1EmailsById"}},"/api/logs/v1/emails/stats":{"get":{"tags":["Logs"],"summary":"Get Email Stats","description":"Returns aggregated email statistics for charts.","security":[{"apiKey":[]}],"parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"domain_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"format":"date-time","type":"string"}},{"name":"interval","in":"query","required":false,"schema":{"type":"string","enum":["day","hour"]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["dates","sent","delivered","bounced","complaint","opened","rate","bounceBreakdown"],"properties":{"dates":{"type":"array","items":{"type":"string"}},"sent":{"type":"array","items":{"type":"number"}},"delivered":{"type":"array","items":{"type":"number"}},"bounced":{"type":"array","items":{"type":"number"}},"complaint":{"type":"array","items":{"type":"number"}},"opened":{"type":"array","items":{"type":"number"}},"unsubscribed":{"type":"array","items":{"type":"number"}},"rate":{"type":"array","items":{"type":"number"}},"bounceBreakdown":{"type":"object","required":["transient","permanent","undetermined"],"properties":{"transient":{"type":"array","items":{"type":"number"}},"permanent":{"type":"array","items":{"type":"number"}},"undetermined":{"type":"array","items":{"type":"number"}}}}}}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Access forbidden","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Internal server error","type":"string"}}}]}}}}},"operationId":"getApiLogsV1EmailsStats"}},"/api/logs/v1/ws":{"ws":{"security":[{"apiKey":[]}],"operationId":"wsApiLogsV1Ws"}},"/api/upload/v1/upload":{"post":{"tags":["Upload"],"summary":"Upload an image file","description":"Uploads an image file and returns file metadata with URL","responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","filename","originalName","mimeType","size","path","url","userId","createdAt","updatedAt"],"properties":{"id":{"description":"Unique file identifier","type":"string"},"filename":{"description":"Stored filename","type":"string"},"originalName":{"description":"Original filename","type":"string"},"mimeType":{"description":"MIME type","type":"string"},"size":{"description":"File size in bytes","type":"number"},"path":{"description":"File path","type":"string"},"url":{"description":"File URL for access","type":"string"},"userId":{"description":"User ID","type":"string"},"createdAt":{"description":"Creation timestamp","type":"string"},"updatedAt":{"description":"Last update timestamp","type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiUploadV1Upload"}},"/api/upload/v1/files/content":{"get":{"tags":["Upload"],"summary":"Get uploaded file content","description":"Return the raw bytes for an uploaded file by storage key. Callers must send the same session cookie or API key used to upload the file.","parameters":[{"name":"path","in":"query","required":true,"schema":{"minLength":1,"description":"Upload object key or public URL","type":"string"}}],"responses":{"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"File not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiUploadV1FilesContent"}},"/api/upload/v1/files/{fileId}":{"delete":{"tags":["Upload"],"summary":"Delete an uploaded file","description":"Deletes an uploaded file (soft delete)","parameters":[{"name":"fileId","in":"path","required":true,"schema":{"minLength":1,"description":"File ID","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"Unauthorized access","type":"string"}}}]}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"message":{"const":"File not found","type":"string"}}}]}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"deleteApiUploadV1FilesByFileId"}},"/api/template/v1/create":{"post":{"tags":["Templates"],"summary":"Create a new template","description":"Creates a new email template for the organization","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst template = await reloop.template.create({\n  name: \"Welcome Email\",\n  subject: \"Welcome to Reloop!\",\n  content: []\n});"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/template/v1/create \\\n  -H \"Authorization: Bearer rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Welcome Email\",\n    \"subject\": \"Welcome to Reloop!\",\n    \"content\": []\n  }'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst template = reloop.template.create({\n  name: \"Welcome Email\",\n  subject: \"Welcome to Reloop!\",\n  content: []\n});"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->post('https://reloop.sh/template/v1/create', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n        'Content-Type'  => 'application/json',\n    ],\n    'json' => [\n        'name' => 'Welcome Email',\n        'subject' => 'Welcome to Reloop!',\n        'content' => [],\n    ],\n]);\n\n$template = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nString body = \"\"\"\n    {\n      \"name\": \"Welcome Email\",\n      \"subject\": \"Welcome to Reloop!\",\n      \"content\": []\n    }\n    \"\"\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/create\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .header(\"Content-Type\", \"application/json\")\n    .POST(BodyPublishers.ofString(body))\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\nusing System.Net.Http.Json;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar payload = new {\n    name = \"Welcome Email\",\n    subject = \"Welcome to Reloop!\",\n    content = new object[] {}\n};\n\nvar response = await client.PostAsJsonAsync(\n    \"https://reloop.sh/template/v1/create\",\n    payload\n);"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"slug":{"maxLength":128,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Org-unique handle for sending by slug, e.g. welcome-email. Generated from the name when omitted.","type":"string"},"description":{"type":"string"},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"content":{"type":"array","items":{}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"slug":{"maxLength":128,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Org-unique handle for sending by slug, e.g. welcome-email. Generated from the name when omitted.","type":"string"},"description":{"type":"string"},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"content":{"type":"array","items":{}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"slug":{"maxLength":128,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Org-unique handle for sending by slug, e.g. welcome-email. Generated from the name when omitted.","type":"string"},"description":{"type":"string"},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"content":{"type":"array","items":{}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1Create","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/template/v1/html-to-image":{"post":{"tags":["Templates"],"summary":"Convert HTML to an image","description":"Renders email HTML in a headless browser and returns a PNG, JPEG, or WebP of the full document. Use this to generate template thumbnails from saved `renderedHtml`.","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\nimport { writeFile } from \"node:fs/promises\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst image = await reloop.template.htmlToImage({\n  html: \"<h1>Welcome</h1><p>Thanks for signing up.</p>\",\n  width: 600,\n  format: \"png\"\n});\n\nawait writeFile(\"template.png\", image);"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/template/v1/html-to-image \\\n  -H \"Authorization: Bearer rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  --output template.png \\\n  -d '{\n    \"html\": \"<h1>Welcome</h1><p>Thanks for signing up.</p>\",\n    \"width\": 600,\n    \"format\": \"png\"\n  }'"},{"id":"python","lang":"python","label":"Python","source":"import requests\n\nresponse = requests.post(\n    \"https://reloop.sh/template/v1/html-to-image\",\n    headers={\n        \"Authorization\": \"Bearer rl_123456789\",\n        \"Content-Type\": \"application/json\",\n    },\n    json={\n        \"html\": \"<h1>Welcome</h1><p>Thanks for signing up.</p>\",\n        \"width\": 600,\n        \"format\": \"png\",\n    },\n)\nresponse.raise_for_status()\nopen(\"template.png\", \"wb\").write(response.content)"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->post('https://reloop.sh/template/v1/html-to-image', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n        'Content-Type'  => 'application/json',\n    ],\n    'json' => [\n        'html' => '<h1>Welcome</h1><p>Thanks for signing up.</p>',\n        'width' => 600,\n        'format' => 'png',\n    ],\n    'sink' => 'template.png',\n]);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\n\nHttpClient client = HttpClient.newHttpClient();\nString body = \"\"\"\n    {\n      \"html\": \"<h1>Welcome</h1><p>Thanks for signing up.</p>\",\n      \"width\": 600,\n      \"format\": \"png\"\n    }\n    \"\"\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/html-to-image\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .header(\"Content-Type\", \"application/json\")\n    .POST(HttpRequest.BodyPublishers.ofString(body))\n    .build();\n\nHttpResponse<byte[]> response = client.send(\n    request, HttpResponse.BodyHandlers.ofByteArray());\nFiles.write(Path.of(\"template.png\"), response.body());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\nusing System.Net.Http.Headers;\nusing System.Text;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar content = new StringContent(\n    \"\"\"{\"html\":\"<h1>Welcome</h1><p>Thanks for signing up.</p>\",\"width\":600,\"format\":\"png\"}\"\"\",\n    Encoding.UTF8,\n    \"application/json\");\n\nvar response = await client.PostAsync(\n    \"https://reloop.sh/template/v1/html-to-image\",\n    content);\nvar bytes = await response.Content.ReadAsByteArrayAsync();\nawait File.WriteAllBytesAsync(\"template.png\", bytes);"}],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["html"],"properties":{"html":{"minLength":1,"type":"string"},"width":{"minimum":200,"maximum":2000,"type":"number"},"format":{"type":"string","enum":["png","jpeg","webp"]},"quality":{"minimum":1,"maximum":100,"type":"number"},"scale":{"minimum":1,"maximum":3,"type":"number"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["html"],"properties":{"html":{"minLength":1,"type":"string"},"width":{"minimum":200,"maximum":2000,"type":"number"},"format":{"type":"string","enum":["png","jpeg","webp"]},"quality":{"minimum":1,"maximum":100,"type":"number"},"scale":{"minimum":1,"maximum":3,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["html"],"properties":{"html":{"minLength":1,"type":"string"},"width":{"minimum":200,"maximum":2000,"type":"number"},"format":{"type":"string","enum":["png","jpeg","webp"]},"quality":{"minimum":1,"maximum":100,"type":"number"},"scale":{"minimum":1,"maximum":3,"type":"number"}}}}}},"responses":{"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1Html-to-image","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/template/v1/{id}/versions":{"post":{"tags":["Templates"],"summary":"Create a new template version","description":"Saves a snapshot of the current template content as a new version","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst version = await reloop.template.createVersion(\"tpl_123456789\", {\n  content: [],\n  isMajor: true,\n  name: \"v1.0.0\"\n});"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/template/v1/tpl_123456789/versions \\\n  -H \"Authorization: Bearer rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"content\": [],\n    \"isMajor\": true,\n    \"name\": \"v1.0.0\"\n  }'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst version = reloop.template.createVersion(\"tpl_123456789\", {\n  content: [],\n  isMajor: true,\n  name: \"v1.0.0\"\n});"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->post('https://reloop.sh/template/v1/tpl_123456789/versions', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n        'Content-Type'  => 'application/json',\n    ],\n    'json' => [\n        'content' => [],\n        'isMajor' => true,\n        'name' => 'v1.0.0',\n    ],\n]);\n\n$version = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nString body = \"\"\"\n    {\n      \"content\": [],\n      \"isMajor\": true,\n      \"name\": \"v1.0.0\"\n    }\n    \"\"\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789/versions\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .header(\"Content-Type\", \"application/json\")\n    .POST(BodyPublishers.ofString(body))\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\nusing System.Net.Http.Json;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar payload = new {\n    content = new object[] {},\n    isMajor = true,\n    name = \"v1.0.0\"\n};\n\nvar response = await client.PostAsJsonAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789/versions\",\n    payload\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"array","items":{}},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"description":{"maxLength":500,"type":"string"},"name":{"maxLength":255,"type":"string"},"isMajor":{"type":"boolean"},"renderedHtml":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number"]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"array","items":{}},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"description":{"maxLength":500,"type":"string"},"name":{"maxLength":255,"type":"string"},"isMajor":{"type":"boolean"},"renderedHtml":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number"]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"array","items":{}},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"description":{"maxLength":500,"type":"string"},"name":{"maxLength":255,"type":"string"},"isMajor":{"type":"boolean"},"renderedHtml":{"type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number"]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","templateId","version","name","isMajor","subject","fromEmail","replyTo","previewText","description","content","variables","renderedHtml","createdByUserId","createdAt"],"properties":{"id":{"type":"string"},"templateId":{"type":"string"},"version":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"isMajor":{"type":"boolean"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"renderedHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"type":"string"},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"draftNumber":{"type":"number"},"publishNumber":{"type":"number"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1ByIdVersions"},"get":{"tags":["Templates"],"summary":"List Template","description":"Returns all saved versions for a template, ordered newest first","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst versions = await reloop.template.listVersions(\"tpl_123456789\", { page: 1, limit: 10 });"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/template/v1/tpl_123456789/versions?page=1&limit=10\" \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst versions = reloop.template.listVersions(\"tpl_123456789\", { page: 1, limit: 10 });"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->get('https://reloop.sh/template/v1/tpl_123456789/versions', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n    'query' => [\n        'page' => 1,\n        'limit' => 10,\n    ],\n]);\n\n$versions = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789/versions?page=1&limit=10\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.GetAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789/versions?page=1&limit=10\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","templateId","version","name","isMajor","subject","fromEmail","replyTo","previewText","description","content","variables","renderedHtml","createdByUserId","createdAt"],"properties":{"id":{"type":"string"},"templateId":{"type":"string"},"version":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"isMajor":{"type":"boolean"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"renderedHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"type":"string"},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiTemplateV1ByIdVersions"}},"/api/template/v1/{id}/versions/{versionId}":{"delete":{"tags":["Templates"],"summary":"Delete template version","description":"Deletes a specific version of a template if it is not the active version","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nawait reloop.template.deleteVersion(\"tpl_123456789\", \"ver_123456789\");"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789 \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nreloop.template.deleteVersion(\"tpl_123456789\", \"ver_123456789\");"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$client->delete('https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .DELETE()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.DeleteAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","templateId","version","name","isMajor","subject","fromEmail","replyTo","previewText","description","content","variables","renderedHtml","createdByUserId","createdAt"],"properties":{"id":{"type":"string"},"templateId":{"type":"string"},"version":{"type":"number"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"isMajor":{"type":"boolean"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"renderedHtml":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"type":"string"},"createdBy":{"type":"object","required":["id","name","email","image"],"properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiTemplateV1ByIdVersionsByVersionId"}},"/api/template/v1/{id}/versions/{versionId}/restore":{"post":{"tags":["Templates"],"summary":"Restore template version","description":"Restores a template to a specific historical version","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst template = await reloop.template.restoreVersion(\"tpl_123456789\", \"ver_123456789\");"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789/restore \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst template = reloop.template.restoreVersion(\"tpl_123456789\", \"ver_123456789\");"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->post('https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789/restore', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n]);\n\n$template = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789/restore\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .POST(HttpRequest.BodyPublishers.noBody())\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.PostAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789/versions/ver_123456789/restore\",\n    null\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1ByIdVersionsByVersionIdRestore"}},"/api/template/v1/{id}/thumbnail":{"get":{"tags":["Templates"],"summary":"Get template thumbnail","description":"Returns a PNG preview of the latest saved template HTML. Generates and stores the image on first request.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiTemplateV1ByIdThumbnail"}},"/api/template/v1/slug/{slug}":{"get":{"tags":["Templates"],"summary":"Get template by slug","description":"Retrieves a single template by its organization-unique slug","security":[{"apiKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiTemplateV1SlugBySlug"}},"/api/template/v1/{id}":{"get":{"tags":["Templates"],"summary":"Get template by ID","description":"Retrieves a single template by its ID","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst template = await reloop.template.retrieve(\"tpl_123456789\");"},{"id":"curl","lang":"bash","label":"cURL","source":"curl https://reloop.sh/template/v1/tpl_123456789 \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst template = reloop.template.retrieve(\"tpl_123456789\");"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->get('https://reloop.sh/template/v1/tpl_123456789', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n]);\n\n$template = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.GetAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiTemplateV1ById"},"put":{"tags":["Templates"],"summary":"Update template","description":"Updates template properties or draft content","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst updatedTemplate = await reloop.template.update(\"tpl_123456789\", {\n  name: \"Updated Welcome Email\",\n  subject: \"Welcome to Reloop! (Updated)\"\n});"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X PUT https://reloop.sh/template/v1/tpl_123456789 \\\n  -H \"Authorization: Bearer rl_123456789\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Updated Welcome Email\",\n    \"subject\": \"Welcome to Reloop! (Updated)\"\n  }'"},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst updatedTemplate = reloop.template.update(\"tpl_123456789\", {\n  name: \"Updated Welcome Email\",\n  subject: \"Welcome to Reloop! (Updated)\"\n});"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->put('https://reloop.sh/template/v1/tpl_123456789', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n        'Content-Type'  => 'application/json',\n    ],\n    'json' => [\n        'name' => 'Updated Welcome Email',\n        'subject' => 'Welcome to Reloop! (Updated)',\n    ],\n]);\n\n$updatedTemplate = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nString body = \"\"\"\n    {\n      \"name\": \"Updated Welcome Email\",\n      \"subject\": \"Welcome to Reloop! (Updated)\"\n    }\n    \"\"\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .header(\"Content-Type\", \"application/json\")\n    .PUT(BodyPublishers.ofString(body))\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\nusing System.Net.Http.Json;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar payload = new {\n    name = \"Updated Welcome Email\",\n    subject = \"Welcome to Reloop! (Updated)\"\n};\n\nvar response = await client.PutAsJsonAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789\",\n    payload\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"slug":{"maxLength":128,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Org-unique handle for sending by slug. Changing it breaks API calls that use the old slug.","type":"string"},"description":{"type":"string"},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"content":{"type":"array","items":{}},"renderedHtml":{"description":"Composed HTML of the draft content. Refreshes the list thumbnail until the template is first published; not stored.","type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number"]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"status":{"type":"string","enum":["draft","published","archived"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"slug":{"maxLength":128,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Org-unique handle for sending by slug. Changing it breaks API calls that use the old slug.","type":"string"},"description":{"type":"string"},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"content":{"type":"array","items":{}},"renderedHtml":{"description":"Composed HTML of the draft content. Refreshes the list thumbnail until the template is first published; not stored.","type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number"]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"status":{"type":"string","enum":["draft","published","archived"]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"slug":{"maxLength":128,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Org-unique handle for sending by slug. Changing it breaks API calls that use the old slug.","type":"string"},"description":{"type":"string"},"subject":{"maxLength":500,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"content":{"type":"array","items":{}},"renderedHtml":{"description":"Composed HTML of the draft content. Refreshes the list thumbnail until the template is first published; not stored.","type":"string"},"variables":{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number"]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"status":{"type":"string","enum":["draft","published","archived"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"putApiTemplateV1ById"},"delete":{"tags":["Templates"],"summary":"Delete template","description":"Soft deletes a template","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nawait reloop.template.delete(\"tpl_123456789\");"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X DELETE https://reloop.sh/template/v1/tpl_123456789 \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nreloop.template.delete(\"tpl_123456789\");"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$client->delete('https://reloop.sh/template/v1/tpl_123456789', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n]);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .DELETE()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.DeleteAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiTemplateV1ById"}},"/api/template/v1/list":{"get":{"tags":["Templates"],"summary":"List templates","description":"Lists all templates for the organization with pagination","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst templates = await reloop.template.list({ page: 1, limit: 10 });"},{"id":"curl","lang":"bash","label":"cURL","source":"curl \"https://reloop.sh/template/v1/list?page=1&limit=10\" \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst templates = reloop.template.list({ page: 1, limit: 10 });"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->get('https://reloop.sh/template/v1/list', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n    'query' => [\n        'page' => 1,\n        'limit' => 10,\n    ],\n]);\n\n$templates = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/list?page=1&limit=10\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.GetAsync(\n    \"https://reloop.sh/template/v1/list?page=1&limit=10\"\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["templates","total","page","limit","hasMore","nextCursor"],"properties":{"templates":{"type":"array","items":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiTemplateV1List"}},"/api/template/v1/{id}/duplicate":{"post":{"tags":["Templates"],"summary":"Duplicate template","description":"Creates a copy of an existing template","x-codeSamples":[{"id":"node","lang":"javascript","label":"Node.js","source":"import { Reloop } from \"reloop-email\";\n\nconst reloop = new Reloop({ apiKey: \"rl_123456789\" });\n\nconst newTemplate = await reloop.template.duplicate(\"tpl_123456789\");"},{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/template/v1/tpl_123456789/duplicate \\\n  -H \"Authorization: Bearer rl_123456789\""},{"id":"python","lang":"python","label":"Python","source":"from reloop_email import Reloop\n\nreloop = Reloop(api_key=\"rl_123456789\")\n\nconst newTemplate = reloop.template.duplicate(\"tpl_123456789\");"},{"id":"php","lang":"php","label":"PHP","source":"<?php\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->post('https://reloop.sh/template/v1/tpl_123456789/duplicate', [\n    'headers' => [\n        'Authorization' => 'Bearer rl_123456789',\n    ],\n]);\n\n$newTemplate = json_decode($response->getBody(), true);"},{"id":"java","lang":"java","label":"Java","source":"import java.net.URI;\nHttpClient client = HttpClient.newHttpClient();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://reloop.sh/template/v1/tpl_123456789/duplicate\"))\n    .header(\"Authorization\", \"Bearer rl_123456789\")\n    .POST(HttpRequest.BodyPublishers.noBody())\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());"},{"id":"dotnet","lang":"csharp","label":".NET","source":"using System.Net.Http;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer rl_123456789\");\n\nvar response = await client.PostAsync(\n    \"https://reloop.sh/template/v1/tpl_123456789/duplicate\",\n    null\n);"}],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","name","slug","description","subject","fromEmail","replyTo","previewText","organizationId","createdByUserId","status","content","variables","currentVersion","thumbnailUrl","isDefault","deletedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizationId":{"type":"string"},"createdByUserId":{"type":"string"},"status":{"type":"string","enum":["draft","published","archived"]},"content":{"type":"array","items":{}},"variables":{"anyOf":[{"type":"array","items":{"type":"object","required":["name","type","defaultValue"],"properties":{"name":{"type":"string"},"type":{"anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"}]},"defaultValue":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"currentVersion":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"deletedAt":{"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1ByIdDuplicate"}},"/api/template/v1/{id}/test":{"post":{"tags":["Templates"],"summary":"Send test email","description":"Sends a test email for the template with resolved variables.","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"minLength":1,"type":"string"},"fromEmail":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"variables":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["to"],"properties":{"to":{"minLength":1,"type":"string"},"fromEmail":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"variables":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["to"],"properties":{"to":{"minLength":1,"type":"string"},"fromEmail":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"variables":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1ByIdTest"}},"/api/template/v1/ai":{"post":{"tags":["Templates","AI"],"summary":"Generate AI email template stream","description":"Streams HTML email templates via OpenRouter (inclusionai/ling-3.0-flash:free by default), Gemma/Ollama, Gemini, or OpenAI for the React Email editor.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"minLength":1,"type":"string"},"system":{"type":"string"},"model":{"type":"string"},"apiKey":{"type":"string"},"mode":{"type":"string","enum":["text-stream","ui-message-stream","sse-text","sse-ui","text-response","ui-message-response","manual-sse"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"minLength":1,"type":"string"},"system":{"type":"string"},"model":{"type":"string"},"apiKey":{"type":"string"},"mode":{"type":"string","enum":["text-stream","ui-message-stream","sse-text","sse-ui","text-response","ui-message-response","manual-sse"]}}}},"multipart/form-data":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"minLength":1,"type":"string"},"system":{"type":"string"},"model":{"type":"string"},"apiKey":{"type":"string"},"mode":{"type":"string","enum":["text-stream","ui-message-stream","sse-text","sse-ui","text-response","ui-message-response","manual-sse"]}}}}}},"responses":{"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1Ai","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/template/v1/ai/agent":{"post":{"tags":["Templates","AI"],"summary":"Agentic email template generation (SSE)","description":"Multi-turn agent/plan harness. Streams step events, plan JSON, and HTML deltas for the template editor AI panel.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"mode":{"type":"string","enum":["agent","plan"]},"messages":{"minItems":1,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"minLength":1,"type":"string"}}}},"templateId":{"type":"string"},"editorSnapshot":{"type":"object","properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{},"renderedHtmlSnippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentJson":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"attachments":{"type":"array","items":{"type":"object","required":["url","mime","name"],"properties":{"url":{"minLength":1,"type":"string"},"mime":{"type":"string"},"name":{"type":"string"}}}},"executePlan":{"type":"object","required":["id","summary","steps"],"properties":{"id":{"type":"string"},"summary":{"type":"string"},"steps":{"minItems":1,"type":"array","items":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}},"model":{"type":"string"},"system":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["messages"],"properties":{"mode":{"type":"string","enum":["agent","plan"]},"messages":{"minItems":1,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"minLength":1,"type":"string"}}}},"templateId":{"type":"string"},"editorSnapshot":{"type":"object","properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{},"renderedHtmlSnippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentJson":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"attachments":{"type":"array","items":{"type":"object","required":["url","mime","name"],"properties":{"url":{"minLength":1,"type":"string"},"mime":{"type":"string"},"name":{"type":"string"}}}},"executePlan":{"type":"object","required":["id","summary","steps"],"properties":{"id":{"type":"string"},"summary":{"type":"string"},"steps":{"minItems":1,"type":"array","items":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}},"model":{"type":"string"},"system":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["messages"],"properties":{"mode":{"type":"string","enum":["agent","plan"]},"messages":{"minItems":1,"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant","system"]},"content":{"minLength":1,"type":"string"}}}},"templateId":{"type":"string"},"editorSnapshot":{"type":"object","properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{},"renderedHtmlSnippet":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentJson":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"attachments":{"type":"array","items":{"type":"object","required":["url","mime","name"],"properties":{"url":{"minLength":1,"type":"string"},"mime":{"type":"string"},"name":{"type":"string"}}}},"executePlan":{"type":"object","required":["id","summary","steps"],"properties":{"id":{"type":"string"},"summary":{"type":"string"},"steps":{"minItems":1,"type":"array","items":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}},"model":{"type":"string"},"system":{"type":"string"}}}}}},"responses":{"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiTemplateV1AiAgent","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/template/collab/{roomName}":{"ws":{"security":[{"apiKey":[]}],"parameters":[{"name":"roomName","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"wsApiTemplateCollabByRoomName"}},"/api/campaigns/v1/create":{"post":{"tags":["Campaigns"],"summary":"Create a campaign","description":"Creates a draft broadcast campaign. Pass sendImmediately or scheduledAt to start delivery.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","audienceType"],"properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"subject":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"fromName":{"maxLength":255,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"type":"string"},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"templateId":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"csvEmails":{"maxItems":50000,"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"string"},"sendImmediately":{"type":"boolean"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name","audienceType"],"properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"subject":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"fromName":{"maxLength":255,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"type":"string"},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"templateId":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"csvEmails":{"maxItems":50000,"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"string"},"sendImmediately":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","audienceType"],"properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"subject":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"fromName":{"maxLength":255,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"type":"string"},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"templateId":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"csvEmails":{"maxItems":50000,"type":"array","items":{"type":"string"}},"scheduledAt":{"type":"string"},"sendImmediately":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiCampaignsV1Create","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/api/campaigns/v1/list":{"get":{"tags":["Campaigns"],"summary":"List campaigns","security":[{"apiKey":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"number"}},{"name":"limit","in":"query","required":false,"schema":{"type":"number"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"pattern":"^(draft|scheduled|sending|sent|cancelled)(,(draft|scheduled|sending|sent|cancelled))*$","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["campaigns","total","page","limit","hasMore","nextCursor"],"properties":{"campaigns":{"type":"array","items":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiCampaignsV1List"}},"/api/campaigns/v1/{id}":{"get":{"tags":["Campaigns"],"summary":"Get a campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiCampaignsV1ById"},"patch":{"tags":["Campaigns"],"summary":"Update a draft campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"subject":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"fromName":{"maxLength":255,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"type":"string"},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"templateId":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"csvEmails":{"maxItems":50000,"type":"array","items":{"type":"string"}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"subject":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"fromName":{"maxLength":255,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"type":"string"},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"templateId":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"csvEmails":{"maxItems":50000,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"},"subject":{"maxLength":255,"type":"string"},"previewText":{"type":"string"},"fromName":{"maxLength":255,"type":"string"},"fromEmail":{"maxLength":255,"type":"string"},"replyTo":{"type":"string"},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"templateId":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"csvEmails":{"maxItems":50000,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"patchApiCampaignsV1ById"},"delete":{"tags":["Campaigns"],"summary":"Delete a draft or cancelled campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"id":{"type":"string"}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"deleteApiCampaignsV1ById"}},"/api/campaigns/v1/{id}/send":{"post":{"tags":["Campaigns"],"summary":"Send a campaign now","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiCampaignsV1ByIdSend"}},"/api/campaigns/v1/{id}/schedule":{"post":{"tags":["Campaigns"],"summary":"Schedule a campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["scheduledAt"],"properties":{"scheduledAt":{"format":"date-time","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["scheduledAt"],"properties":{"scheduledAt":{"format":"date-time","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["scheduledAt"],"properties":{"scheduledAt":{"format":"date-time","type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiCampaignsV1ByIdSchedule"}},"/api/campaigns/v1/{id}/cancel":{"post":{"tags":["Campaigns"],"summary":"Cancel a campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiCampaignsV1ByIdCancel"}},"/api/campaigns/v1/{id}/duplicate":{"post":{"tags":["Campaigns"],"summary":"Duplicate a campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","name","subject","fromName","fromEmail","status","audienceType","recipientCount","sentCount","deliveredCount","openedCount","clickedCount","failedCount","skippedCount","content","contentHtml","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string"},"replyTo":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled"]},"audienceType":{"type":"string","enum":["all","group","channel","csv"]},"audienceTargetId":{"type":"string"},"audienceTargetName":{"type":"string"},"recipientCount":{"type":"number"},"sentCount":{"type":"number"},"deliveredCount":{"type":"number"},"openedCount":{"type":"number"},"clickedCount":{"type":"number"},"failedCount":{"type":"number"},"skippedCount":{"type":"number"},"templateId":{"type":"string"},"templateName":{"type":"string"},"content":{"type":"array","items":{}},"contentHtml":{"type":"string"},"scheduledAt":{"type":"string"},"sentAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastError":{"type":"string"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiCampaignsV1ByIdDuplicate"}},"/api/campaigns/v1/{id}/test":{"post":{"tags":["Campaigns"],"summary":"Send a test email for a campaign","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string"},"variables":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string"},"variables":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string"},"variables":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}},"headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/IdempotentReplayed"}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiCampaignsV1ByIdTest"}},"/api/campaigns/v1/{id}/recipients":{"get":{"tags":["Campaigns"],"summary":"List campaign recipients","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"maxLength":512,"description":"Opaque cursor from a previous response's `nextCursor`. Returns the page after it; `page` is ignored when set. See https://reloop.sh/docs/api/pagination.","type":"string"}},{"name":"page","in":"query","required":false,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","sending","sent","skipped","failed"]}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["unsubscribed","bounced","suppressed","complained","clicked","all"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["recipients","total","page","limit","hasMore","nextCursor"],"properties":{"recipients":{"type":"array","items":{"type":"object","required":["id","email","status"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"contactId":{"type":"string"},"status":{"type":"string","enum":["pending","sending","sent","skipped","failed"]},"skipReason":{"type":"string"},"emailLogId":{"type":"string"},"error":{"type":"string"},"category":{"type":"string"},"contactName":{"type":"string"},"openedAt":{"type":"string"},"clickedAt":{"type":"string"},"clickCount":{"type":"number"},"uniqueClickCount":{"type":"number"},"updatedAt":{"type":"string"}}}},"links":{"type":"array","items":{"type":"object","required":["url","clickCount","uniqueClickCount"],"properties":{"url":{"type":"string"},"clickCount":{"type":"number"},"uniqueClickCount":{"type":"number"}}}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"hasMore":{"description":"Whether more results exist after this page.","type":"boolean"},"nextCursor":{"description":"Pass as `cursor` to fetch the next page. `null` on the last page.","anyOf":[{"type":"string"},{"type":"null"}]},"counts":{"type":"object","required":["unsubscribed","bounced","suppressed","complained","clicked","clickedTotal","all"],"properties":{"unsubscribed":{"type":"number"},"bounced":{"type":"number"},"suppressed":{"type":"number"},"complained":{"type":"number"},"clicked":{"type":"number"},"clickedTotal":{"type":"number"},"all":{"type":"number"}}}}}}}},"400":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Standard error response format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"getApiCampaignsV1ByIdRecipients"}},"/api/tools/v1/temp-email-checker":{"post":{"tags":["Tools"],"description":"Reports whether an email address or bare domain is disposable, a role address, or from a free consumer provider. Public and unauthenticated; rate limited per IP. Nothing is stored.","summary":"Temp email check","x-codeSamples":[{"id":"curl","lang":"bash","label":"cURL","source":"curl -X POST https://reloop.sh/api/tools/v1/temp-email-checker \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"you@mailinator.com\"}'"},{"id":"node","lang":"javascript","label":"Node.js","source":"// No SDK, no API key: it is a plain POST.\nconst res = await fetch(\n  \"https://reloop.sh/api/tools/v1/temp-email-checker\",\n  {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ email: \"you@mailinator.com\" }),\n  },\n);\n\nconst result = await res.json();"},{"id":"python","lang":"python","label":"Python","source":"# pip install requests\nimport requests\n\nresult = requests.post(\n    \"https://reloop.sh/api/tools/v1/temp-email-checker\",\n    json={\"email\": \"you@mailinator.com\"},\n).json()"},{"id":"go","lang":"go","label":"Go","source":"body, _ := json.Marshal(map[string]string{\n    \"email\": \"you@mailinator.com\",\n})\n\nres, err := http.Post(\n    \"https://reloop.sh/api/tools/v1/temp-email-checker\",\n    \"application/json\",\n    bytes.NewReader(body),\n)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":400,"description":"An email address or a bare domain.","examples":["you@mailinator.com","tempmail.com"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":400,"description":"An email address or a bare domain.","examples":["you@mailinator.com","tempmail.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":400,"description":"An email address or a bare domain.","examples":["you@mailinator.com","tempmail.com"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["input","kind","domain","unicodeDomain","verdict","isValidSyntax","syntaxFailure","isDisposable","disposableMatch","isAllowlisted","isRoleAddress","isFreeProvider","signals","mxRecords","confidence","riskScore","flags"],"properties":{"input":{"description":"The input after trimming and lowercasing.","type":"string"},"kind":{"description":"Whether the input parsed as an address or a bare domain.","anyOf":[{"const":"email","type":"string"},{"const":"domain","type":"string"},{"type":"null"}]},"domain":{"description":"Punycode domain used for the lookup.","anyOf":[{"type":"string"},{"type":"null"}]},"unicodeDomain":{"description":"Unicode form of the domain, when it differs.","anyOf":[{"type":"string"},{"type":"null"}]},"verdict":{"type":"string","enum":["invalid","disposable","risky","deliverable"]},"isValidSyntax":{"type":"boolean"},"syntaxFailure":{"description":"Machine-readable reason the address failed to parse.","anyOf":[{"type":"string"},{"type":"null"}]},"isDisposable":{"type":"boolean"},"disposableMatch":{"anyOf":[{"type":"object","required":["kind","domain"],"properties":{"kind":{"anyOf":[{"const":"exact","type":"string"},{"const":"wildcard","type":"string"}]},"domain":{"type":"string"},"pattern":{"type":"string"}}},{"type":"null"}]},"isAllowlisted":{"type":"boolean"},"isRoleAddress":{"type":"boolean"},"isFreeProvider":{"type":"boolean"},"signals":{"type":"object","required":["syntax","disposable","role","freeProvider"],"properties":{"syntax":{"type":"string","enum":["pass","fail","warn","neutral"]},"disposable":{"type":"string","enum":["pass","fail","warn","neutral"]},"role":{"type":"string","enum":["pass","fail","warn","neutral"]},"freeProvider":{"type":"string","enum":["pass","fail","warn","neutral"]}}},"mxRecords":{"description":"MX hosts for the domain, lowest priority first. Empty when the input is invalid, the domain has no MX, or DNS did not answer.","type":"array","items":{"type":"string"}},"confidence":{"minimum":0,"maximum":1,"description":"How sure the engine is of the verdict, from 0 to 1.","type":"number"},"riskScore":{"minimum":0,"maximum":1,"description":"Signup / list-quality risk, from 0 (safe) to 1 (throwaway).","type":"number"},"flags":{"description":"Machine-readable reasons behind the verdict and scores.","type":"array","items":{"type":"string","enum":["INVALID_SYNTAX","DISPOSABLE_DOMAIN","WILDCARD_DISPOSABLE","PUBLIC_INBOX_DETECTED","ROLE_BASED_PREFIX","FREE_PROVIDER","ALLOWLISTED","NO_MX_RECORDS"]}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Temp-email-checker"}},"/api/tools/v1/spam-check":{"post":{"tags":["Tools"],"summary":"Spam check","description":"Evaluates an email subject line and body copy against deterministic spam rules, trigger words, URL shorteners, and caps ratios. Public and unauthenticated; rate limited per IP. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"maxLength":1000,"description":"Email subject line to evaluate.","examples":["Your monthly analytics report is ready"],"type":"string"},"body":{"maxLength":50000,"description":"Email body text or copy to evaluate.","examples":["Hi Alex, your weekly report has been generated..."],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"subject":{"maxLength":1000,"description":"Email subject line to evaluate.","examples":["Your monthly analytics report is ready"],"type":"string"},"body":{"maxLength":50000,"description":"Email body text or copy to evaluate.","examples":["Hi Alex, your weekly report has been generated..."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"subject":{"maxLength":1000,"description":"Email subject line to evaluate.","examples":["Your monthly analytics report is ready"],"type":"string"},"body":{"maxLength":50000,"description":"Email body text or copy to evaluate.","examples":["Hi Alex, your weekly report has been generated..."],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["score","grade","verdict","verdictLabel","breakdown","metrics","categoryCounts","detectedTriggers","issues","recommendations"],"properties":{"score":{"description":"Overall spam/deliverability score from 0 to 100.","type":"number"},"grade":{"description":"Letter grade (A+, A, B, C, D, F).","type":"string"},"verdict":{"type":"string","enum":["inbox_ready","needs_review","high_risk"]},"verdictLabel":{"type":"string"},"breakdown":{"type":"object","required":["subjectScore","contentScore","linkScore","formattingScore"],"properties":{"subjectScore":{"type":"number"},"contentScore":{"type":"number"},"linkScore":{"type":"number"},"formattingScore":{"type":"number"}}},"metrics":{"type":"object","required":["wordCount","charCount","subjectLength","linkCount","triggerWordCount","capsPercentage","readingTimeSec"],"properties":{"wordCount":{"type":"number"},"charCount":{"type":"number"},"subjectLength":{"type":"number"},"linkCount":{"type":"number"},"triggerWordCount":{"type":"number"},"capsPercentage":{"type":"number"},"readingTimeSec":{"type":"number"}}},"categoryCounts":{"type":"object","required":["urgency","shady","overpromise","money","outreach"],"properties":{"urgency":{"type":"number"},"shady":{"type":"number"},"overpromise":{"type":"number"},"money":{"type":"number"},"outreach":{"type":"number"}}},"detectedTriggers":{"type":"array","items":{"type":"object","required":["word","originalMatch","category","categoryLabel","severity","startIndex","endIndex","context"],"properties":{"word":{"type":"string"},"originalMatch":{"type":"string"},"category":{"type":"string","enum":["urgency","shady","overpromise","money","outreach"]},"categoryLabel":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"startIndex":{"type":"number"},"endIndex":{"type":"number"},"context":{"type":"string","enum":["subject","body"]}}}},"issues":{"type":"array","items":{"type":"object","required":["category","severity","title","detail"],"properties":{"category":{"type":"string","enum":["trigger_word","subject","link","formatting","compliance"]},"severity":{"type":"string","enum":["high","medium","low"]},"title":{"type":"string"},"detail":{"type":"string"},"recommendation":{"type":"string"}}}},"recommendations":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Spam-check"}},"/api/tools/v1/spam-check/rewrite":{"post":{"tags":["Tools"],"summary":"AI spam rewrite","description":"Rewrites email subject and body copy to eliminate spam triggers and maximize inbox placement. Uses Gemini Free tier with local deliverability fallback.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"maxLength":1000,"type":"string"},"body":{"maxLength":50000,"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"subject":{"maxLength":1000,"type":"string"},"body":{"maxLength":50000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"subject":{"maxLength":1000,"type":"string"},"body":{"maxLength":50000,"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["subject","body","provider"],"properties":{"subject":{"type":"string"},"body":{"type":"string"},"provider":{"type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Spam-checkRewrite"}},"/api/tools/v1/blocklist-check":{"post":{"tags":["Tools"],"summary":"Blocklist check","description":"Queries 35 IP DNSBLs and 7 domain URI lists (42 public DNS zones). These are DNS blocklists, not websites. Failed or refused queries are errors, not clean. Public and rate limited per IP. The target is logged; results are not stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["target"],"properties":{"target":{"minLength":1,"maxLength":255,"description":"Domain name, IPv4 address, or IPv6 address (e.g. example.com, 198.51.100.1).","examples":["reloop.sh","1.1.1.1","2001:4860:4860::8888"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["target"],"properties":{"target":{"minLength":1,"maxLength":255,"description":"Domain name, IPv4 address, or IPv6 address (e.g. example.com, 198.51.100.1).","examples":["reloop.sh","1.1.1.1","2001:4860:4860::8888"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["target"],"properties":{"target":{"minLength":1,"maxLength":255,"description":"Domain name, IPv4 address, or IPv6 address (e.g. example.com, 198.51.100.1).","examples":["reloop.sh","1.1.1.1","2001:4860:4860::8888"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["target","inputType","ipVersion","resolvedIp","hostname","checkedIps","spfIncludes","spfRanges","ipNote","verdict","isClean","totalChecked","listedCount","cleanCount","errorCount","skippedCount","scanDurationMs","results","recommendations"],"properties":{"target":{"type":"string"},"inputType":{"type":"string","enum":["domain","ip"]},"ipVersion":{"anyOf":[{"const":"ipv4","type":"string"},{"const":"ipv6","type":"string"},{"type":"null"}]},"resolvedIp":{"anyOf":[{"type":"string"},{"type":"null"}]},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedIps":{"type":"array","items":{"type":"object","required":["ip","source","version"],"properties":{"ip":{"type":"string"},"source":{"type":"string","enum":["input","spf","mx","a"]},"version":{"type":"string","enum":["ipv4","ipv6"]}}}},"spfIncludes":{"type":"array","items":{"type":"string"}},"spfRanges":{"type":"array","items":{"type":"string"}},"ipNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"verdict":{"type":"string","enum":["clean","listed","inconclusive"]},"isClean":{"type":"boolean"},"totalChecked":{"type":"number"},"listedCount":{"type":"number"},"cleanCount":{"type":"number"},"errorCount":{"type":"number"},"skippedCount":{"type":"number"},"scanDurationMs":{"type":"number"},"results":{"type":"array","items":{"type":"object","required":["id","name","host","listType","category","impact","status","isListed","responseCodes","responseTimeMs","delistUrl","description","listedTargets"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"host":{"type":"string"},"listType":{"type":"string","enum":["ip","domain"]},"category":{"type":"string","enum":["reputation","spam","malware","domain"]},"impact":{"type":"string","enum":["high","medium","low"]},"status":{"type":"string","enum":["listed","not_listed","error","skipped"]},"isListed":{"type":"boolean"},"responseCodes":{"type":"array","items":{"type":"string"}},"responseTimeMs":{"type":"number"},"delistUrl":{"type":"string"},"description":{"type":"string"},"listedTargets":{"type":"array","items":{"type":"string"}},"txtRecord":{"type":"string"},"error":{"type":"string"}}}},"recommendations":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Blocklist-check"}},"/api/tools/v1/deliverability-test":{"post":{"summary":"Create inbox test","description":"Generates a unique ephemeral email address (e.g. test-a1b2c3@mailtest.reloop.sh) to send a test email from your mail server or ESP.","tags":["Tools","Deliverability"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["token","address","expiresAt","pollUrl"],"properties":{"token":{"type":"string"},"address":{"type":"string"},"expiresAt":{"type":"string"},"pollUrl":{"type":"string"}}}}}},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Deliverability-test"}},"/api/tools/v1/deliverability-test/{token}":{"get":{"summary":"Inbox test report","description":"Poll for test results. Returns 'pending' while waiting for the email to arrive, or 'received' with the complete 0–10 score and diagnostic breakdown once ingested.","tags":["Tools","Deliverability"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"description":"The unique session token returned when the test address was created.","type":"string"}}],"operationId":"getApiToolsV1Deliverability-testByToken","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/tools/v1/deliverability-test/inject":{"post":{"summary":"Ingest test email","description":"Directly inject raw MIME for testing the deliverability diagnostic engine.","tags":["Tools","Deliverability"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rawMime"],"properties":{"rawMime":{"description":"Raw RFC 822 MIME message string to analyze directly.","type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["rawMime"],"properties":{"rawMime":{"description":"Raw RFC 822 MIME message string to analyze directly.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["rawMime"],"properties":{"rawMime":{"description":"Raw RFC 822 MIME message string to analyze directly.","type":"string"}}}}}},"operationId":"postApiToolsV1Deliverability-testInject","responses":{"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/tools/v1/email-health-check":{"post":{"tags":["Tools"],"summary":"Email health check","description":"Evaluates syntax, disposable provider presence, role mailbox status, free provider classification, and active DNS MX records. Public and unauthenticated. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":400,"description":"An email address or a bare domain.","examples":["you@mailinator.com","tempmail.com"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":400,"description":"An email address or a bare domain.","examples":["you@mailinator.com","tempmail.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"minLength":1,"maxLength":400,"description":"An email address or a bare domain.","examples":["you@mailinator.com","tempmail.com"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["input","kind","domain","unicodeDomain","verdict","isValidSyntax","syntaxFailure","isDisposable","disposableMatch","isAllowlisted","isRoleAddress","isFreeProvider","signals","mxRecords","confidence","riskScore","flags","health"],"properties":{"input":{"description":"The input after trimming and lowercasing.","type":"string"},"kind":{"description":"Whether the input parsed as an address or a bare domain.","anyOf":[{"const":"email","type":"string"},{"const":"domain","type":"string"},{"type":"null"}]},"domain":{"description":"Punycode domain used for the lookup.","anyOf":[{"type":"string"},{"type":"null"}]},"unicodeDomain":{"description":"Unicode form of the domain, when it differs.","anyOf":[{"type":"string"},{"type":"null"}]},"verdict":{"type":"string","enum":["invalid","disposable","risky","deliverable"]},"isValidSyntax":{"type":"boolean"},"syntaxFailure":{"description":"Machine-readable reason the address failed to parse.","anyOf":[{"type":"string"},{"type":"null"}]},"isDisposable":{"type":"boolean"},"disposableMatch":{"anyOf":[{"type":"object","required":["kind","domain"],"properties":{"kind":{"anyOf":[{"const":"exact","type":"string"},{"const":"wildcard","type":"string"}]},"domain":{"type":"string"},"pattern":{"type":"string"}}},{"type":"null"}]},"isAllowlisted":{"type":"boolean"},"isRoleAddress":{"type":"boolean"},"isFreeProvider":{"type":"boolean"},"signals":{"type":"object","required":["syntax","disposable","role","freeProvider"],"properties":{"syntax":{"type":"string","enum":["pass","fail","warn","neutral"]},"disposable":{"type":"string","enum":["pass","fail","warn","neutral"]},"role":{"type":"string","enum":["pass","fail","warn","neutral"]},"freeProvider":{"type":"string","enum":["pass","fail","warn","neutral"]}}},"mxRecords":{"description":"MX hosts for the domain, lowest priority first. Empty when the input is invalid, the domain has no MX, or DNS did not answer.","type":"array","items":{"type":"string"}},"confidence":{"minimum":0,"maximum":1,"description":"How sure the engine is of the verdict, from 0 to 1.","type":"number"},"riskScore":{"minimum":0,"maximum":1,"description":"Signup / list-quality risk, from 0 (safe) to 1 (throwaway).","type":"number"},"flags":{"description":"Machine-readable reasons behind the verdict and scores.","type":"array","items":{"type":"string","enum":["INVALID_SYNTAX","DISPOSABLE_DOMAIN","WILDCARD_DISPOSABLE","PUBLIC_INBOX_DETECTED","ROLE_BASED_PREFIX","FREE_PROVIDER","ALLOWLISTED","NO_MX_RECORDS"]}},"health":{"type":"object","required":["status","summary","state","score","reason","user","domain","tag","attributes","mailServer"],"properties":{"status":{"type":"string","enum":["pass","fail","warn"]},"summary":{"description":"One-line health summary derived from verdict and flags.","type":"string"},"state":{"type":"string","enum":["deliverable","undeliverable","risky","unknown"]},"score":{"minimum":0,"maximum":100,"type":"number"},"reason":{"type":"string","enum":["accepted_email","rejected_email","no_mx_records","disposable_domain","invalid_syntax","role_based","low_deliverability"]},"user":{"type":"string"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"tag":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributes":{"type":"object","required":["free","role","disposable","acceptAll","tag","numericalCharacters","alphabeticalCharacters","unicodeSymbols","mailboxFull","noReply","secureEmailGateway"],"properties":{"free":{"type":"boolean"},"role":{"type":"boolean"},"disposable":{"type":"boolean"},"acceptAll":{"type":"boolean"},"tag":{"type":"boolean"},"numericalCharacters":{"type":"number"},"alphabeticalCharacters":{"type":"number"},"unicodeSymbols":{"type":"number"},"mailboxFull":{"type":"boolean"},"noReply":{"type":"boolean"},"secureEmailGateway":{"type":"boolean"}}},"mailServer":{"type":"object","required":["smtpProvider","mxRecord","mxRecords","implicitMxRecord","hasMx"],"properties":{"smtpProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"mxRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"mxRecords":{"type":"array","items":{"type":"string"}},"implicitMxRecord":{"type":"boolean"},"hasMx":{"type":"boolean"}}}}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Email-health-check"}},"/api/tools/v1/email-health-check/batch":{"post":{"tags":["Tools"],"summary":"Batch health check","description":"Accepts an array of email strings or a multipart CSV file (max 1,000 unique addresses). Returns an async job token to poll.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"file":{}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"file":{}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"file":{}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["token","status","pollUrl"],"properties":{"token":{"type":"string"},"status":{"const":"queued","type":"string"},"pollUrl":{"type":"string"}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Email-health-checkBatch"}},"/api/tools/v1/email-health-check/batch/{token}":{"get":{"tags":["Tools"],"summary":"Poll batch results","description":"Returns job status (queued, running, done, failed) and complete per-address evaluation results with list health summary once completed.","parameters":[{"name":"token","in":"path","required":true,"schema":{"description":"The unique batch job token returned from /batch.","type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["token","status","createdAt","completedAt","totalUploaded","totalUnique","duplicatesRemoved","results","summary","error"],"properties":{"token":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed"]},"createdAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalUploaded":{"type":"number"},"totalUnique":{"type":"number"},"duplicatesRemoved":{"type":"number"},"results":{"type":"array","items":{"type":"object","required":["email","rowNumber","domain","verdict","isValidSyntax","isDisposable","isRoleAddress","isFreeProvider","mxRecords","confidence","riskScore","flags","health"],"properties":{"email":{"type":"string"},"rowNumber":{"type":"number"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"verdict":{"type":"string","enum":["invalid","disposable","risky","deliverable"]},"isValidSyntax":{"type":"boolean"},"isDisposable":{"type":"boolean"},"isRoleAddress":{"type":"boolean"},"isFreeProvider":{"type":"boolean"},"mxRecords":{"type":"array","items":{"type":"string"}},"confidence":{"type":"number"},"riskScore":{"type":"number"},"flags":{"type":"array","items":{"type":"string"}},"health":{"type":"object","required":["status","summary","state","score","reason","user","domain","tag","attributes","mailServer"],"properties":{"status":{"type":"string","enum":["pass","fail","warn"]},"summary":{"description":"One-line health summary derived from verdict and flags.","type":"string"},"state":{"type":"string","enum":["deliverable","undeliverable","risky","unknown"]},"score":{"minimum":0,"maximum":100,"type":"number"},"reason":{"type":"string","enum":["accepted_email","rejected_email","no_mx_records","disposable_domain","invalid_syntax","role_based","low_deliverability"]},"user":{"type":"string"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"tag":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributes":{"type":"object","required":["free","role","disposable","acceptAll","tag","numericalCharacters","alphabeticalCharacters","unicodeSymbols","mailboxFull","noReply","secureEmailGateway"],"properties":{"free":{"type":"boolean"},"role":{"type":"boolean"},"disposable":{"type":"boolean"},"acceptAll":{"type":"boolean"},"tag":{"type":"boolean"},"numericalCharacters":{"type":"number"},"alphabeticalCharacters":{"type":"number"},"unicodeSymbols":{"type":"number"},"mailboxFull":{"type":"boolean"},"noReply":{"type":"boolean"},"secureEmailGateway":{"type":"boolean"}}},"mailServer":{"type":"object","required":["smtpProvider","mxRecord","mxRecords","implicitMxRecord","hasMx"],"properties":{"smtpProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"mxRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"mxRecords":{"type":"array","items":{"type":"string"}},"implicitMxRecord":{"type":"boolean"},"hasMx":{"type":"boolean"}}}}}}}},"summary":{"anyOf":[{"type":"object","required":["totalUploaded","totalUnique","duplicatesRemoved","deliverableCount","riskyCount","disposableCount","invalidCount","noMxCount","avgRiskScore","healthyPct"],"properties":{"totalUploaded":{"type":"number"},"totalUnique":{"type":"number"},"duplicatesRemoved":{"type":"number"},"deliverableCount":{"type":"number"},"riskyCount":{"type":"number"},"disposableCount":{"type":"number"},"invalidCount":{"type":"number"},"noMxCount":{"type":"number"},"avgRiskScore":{"type":"number"},"healthyPct":{"type":"number"}}},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"getApiToolsV1Email-health-checkBatchByToken"}},"/api/tools/v1/dns-lookup":{"post":{"tags":["Tools"],"summary":"DNS lookup","description":"Performs comprehensive DNS queries (A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, PTR, SRV), detects authoritative nameserver hosting providers (e.g. Cloudflare, AWS Route 53), and runs automated SPF/DMARC email health checks. Public and rate-limited per IP. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"Domain name, hostname, IP address, or query with prefix (e.g. ohraya.com, a:ohraya.com, mx:ohraya.com).","examples":["ohraya.com","a:ohraya.com","mx:google.com","txt:_dmarc.apple.com"],"type":"string"},"recordType":{"type":"string","enum":["ANY","A","AAAA","MX","TXT","CNAME","NS","SOA","CAA","PTR","SRV"]}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"Domain name, hostname, IP address, or query with prefix (e.g. ohraya.com, a:ohraya.com, mx:ohraya.com).","examples":["ohraya.com","a:ohraya.com","mx:google.com","txt:_dmarc.apple.com"],"type":"string"},"recordType":{"type":"string","enum":["ANY","A","AAAA","MX","TXT","CNAME","NS","SOA","CAA","PTR","SRV"]}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"Domain name, hostname, IP address, or query with prefix (e.g. ohraya.com, a:ohraya.com, mx:ohraya.com).","examples":["ohraya.com","a:ohraya.com","mx:google.com","txt:_dmarc.apple.com"],"type":"string"},"recordType":{"type":"string","enum":["ANY","A","AAAA","MX","TXT","CNAME","NS","SOA","CAA","PTR","SRV"]}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["query","domain","recordType","resolvedAt","responseTimeMs","nameserver","provider","records","diagnostics","summary"],"properties":{"query":{"type":"string"},"domain":{"type":"string"},"recordType":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"nameserver":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"anyOf":[{"type":"object","required":["id","name","website","category","description"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"website":{"type":"string"},"category":{"anyOf":[{"const":"managed_dns","type":"string"},{"const":"cloud","type":"string"},{"const":"registrar","type":"string"},{"const":"cdn","type":"string"},{"const":"hosting","type":"string"}]},"description":{"type":"string"}}},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","required":["type","name","value","ttl"],"properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"ttl":{"anyOf":[{"type":"number"},{"type":"null"}]},"priority":{"type":"number"},"details":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"diagnostics":{"type":"array","items":{"type":"object","required":["id","name","category","status","message"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["dns","email_auth","security","web"]},"status":{"type":"string","enum":["pass","warn","fail","info"]},"message":{"type":"string"},"details":{"type":"string"}}}},"summary":{"type":"object","required":["totalRecords","hasA","hasAaaa","hasMx","hasTxt","hasCname","hasNs","hasSoa","hasDmarc","hasSpf","dmarcPolicy","spfRecord"],"properties":{"totalRecords":{"type":"number"},"hasA":{"type":"boolean"},"hasAaaa":{"type":"boolean"},"hasMx":{"type":"boolean"},"hasTxt":{"type":"boolean"},"hasCname":{"type":"boolean"},"hasNs":{"type":"boolean"},"hasSoa":{"type":"boolean"},"hasDmarc":{"type":"boolean"},"hasSpf":{"type":"boolean"},"dmarcPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"spfRecord":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}},"operationId":"postApiToolsV1Dns-lookup"}},"/api/tools/v1/auth-checker":{"post":{"tags":["Tools"],"summary":"SPF / DKIM / DMARC check","description":"Audit sending domain authentication records against RFC standards. Evaluates SPF mechanism limits, DKIM cryptographic public keys, DMARC alignment policies, and MX server reachability.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name to check email authentication for.","examples":["stripe.com","google.com"],"type":"string"},"selector":{"maxLength":100,"description":"Optional DKIM selector (e.g. s1, google, default, k1).","examples":["s1","google","default"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name to check email authentication for.","examples":["stripe.com","google.com"],"type":"string"},"selector":{"maxLength":100,"description":"Optional DKIM selector (e.g. s1, google, default, k1).","examples":["s1","google","default"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name to check email authentication for.","examples":["stripe.com","google.com"],"type":"string"},"selector":{"maxLength":100,"description":"Optional DKIM selector (e.g. s1, google, default, k1).","examples":["s1","google","default"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","resolvedAt","responseTimeMs","score","grade","verdict","verdictLabel","spf","dkim","dmarc","mx","bimi","mtaSts","diagnostics"],"properties":{"domain":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"score":{"type":"number"},"grade":{"type":"string"},"verdict":{"type":"string","enum":["fully_aligned","partially_aligned","misconfigured","vulnerable"]},"verdictLabel":{"type":"string"},"spf":{"type":"object","required":["status","published","rawRecord","qualifier","lookupCount","mechanisms","includes","ip4","ip6","warnings"],"properties":{"status":{"type":"string","enum":["pass","warn","fail","info"]},"published":{"type":"boolean"},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"qualifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"mechanisms":{"type":"array","items":{"type":"string"}},"includes":{"type":"array","items":{"type":"string"}},"ip4":{"type":"array","items":{"type":"string"}},"ip6":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"dkim":{"type":"object","required":["status","published","selector","rawRecord","publicKey","keyLength","algorithm","testedSelectors","warnings"],"properties":{"status":{"type":"string","enum":["pass","warn","fail","info"]},"published":{"type":"boolean"},"selector":{"anyOf":[{"type":"string"},{"type":"null"}]},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"publicKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyLength":{"anyOf":[{"type":"number"},{"type":"null"}]},"algorithm":{"anyOf":[{"type":"string"},{"type":"null"}]},"testedSelectors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"dmarc":{"type":"object","required":["status","published","rawRecord","policy","subdomainPolicy","percentage","rua","ruf","dkimAlignment","spfAlignment","warnings"],"properties":{"status":{"type":"string","enum":["pass","warn","fail","info"]},"published":{"type":"boolean"},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"anyOf":[{"type":"number"},{"type":"null"}]},"rua":{"type":"array","items":{"type":"string"}},"ruf":{"type":"array","items":{"type":"string"}},"dkimAlignment":{"anyOf":[{"type":"string"},{"type":"null"}]},"spfAlignment":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}}}},"mx":{"type":"object","required":["status","published","provider","records","warnings"],"properties":{"status":{"type":"string","enum":["pass","warn","fail","info"]},"published":{"type":"boolean"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]},"records":{"type":"array","items":{"type":"object","required":["exchange","priority"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"bimi":{"type":"object","required":["status","published","rawRecord","svgUrl","vmcUrl"],"properties":{"status":{"type":"string","enum":["pass","warn","fail","info"]},"published":{"type":"boolean"},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"svgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"vmcUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"mtaSts":{"type":"object","required":["status","published","rawRecord","mode"],"properties":{"status":{"type":"string","enum":["pass","warn","fail","info"]},"published":{"type":"boolean"},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"mode":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"diagnostics":{"type":"array","items":{"type":"object","required":["id","name","category","status","message"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["spf","dkim","dmarc","mx","security"]},"status":{"type":"string","enum":["pass","warn","fail","info"]},"message":{"type":"string"},"details":{"type":"string"}}}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Auth-checker"}},"/api/tools/v1/spoof-checker":{"post":{"tags":["Tools"],"summary":"Spoof check","description":"Answers whether attackers can forge email from your domain without permission. Analyzes DMARC enforcement policies, SPF '+all' loopholes, and subdomain vulnerabilities.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name or URL to check spoofability for.","examples":["stripe.com","github.com","acme.com"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name or URL to check spoofability for.","examples":["stripe.com","github.com","acme.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name or URL to check spoofability for.","examples":["stripe.com","github.com","acme.com"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","resolvedAt","responseTimeMs","spoofable","verdict","headline","summary","inboxOutcome","dmarc","spf","dkim","mx","reasons","nextStep"],"properties":{"domain":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"spoofable":{"type":"boolean"},"verdict":{"type":"string","enum":["spoofable","partially_protected","protected"]},"headline":{"type":"string"},"summary":{"type":"string"},"inboxOutcome":{"type":"string","enum":["delivered","spam","rejected"]},"dmarc":{"type":"object","required":["published","policy","subdomainPolicy","percentage","rawRecord"],"properties":{"published":{"type":"boolean"},"policy":{"anyOf":[{"type":"string"},{"type":"null"}]},"subdomainPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"anyOf":[{"type":"number"},{"type":"null"}]},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"spf":{"type":"object","required":["published","qualifier","lookupCount","rawRecord"],"properties":{"published":{"type":"boolean"},"qualifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"dkim":{"type":"object","required":["published","selector","keyLength"],"properties":{"published":{"type":"boolean"},"selector":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyLength":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"mx":{"type":"object","required":["published","provider"],"properties":{"published":{"type":"boolean"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"reasons":{"type":"array","items":{"type":"object","required":["id","severity","title","detail"],"properties":{"id":{"type":"string"},"severity":{"type":"string","enum":["critical","warning","info","success"]},"title":{"type":"string"},"detail":{"type":"string"}}}},"nextStep":{"type":"object","required":["title","body","href"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"href":{"type":"string"}}},"subdomainNote":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Spoof-checker"}},"/api/tools/v1/who-sends":{"post":{"tags":["Tools"],"summary":"Who sends this email","description":"Inspects which third-party email service providers (e.g. Google, Amazon SES, SendGrid, Mailchimp) are authorized to send email for a domain, and who owns the inbound mailbox.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name or URL to analyze sender permissions for.","examples":["stripe.com","github.com","reloop.sh"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name or URL to analyze sender permissions for.","examples":["stripe.com","github.com","reloop.sh"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The sending domain name or URL to analyze sender permissions for.","examples":["stripe.com","github.com","reloop.sh"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","resolvedAt","responseTimeMs","verdict","headline","summary","disclaimer","inbox","senders","unnamed","spf","nextStep"],"properties":{"domain":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"verdict":{"type":"string","enum":["single_stack","split_stack","crowded","send_only","opaque","unpublished","wide_open"]},"headline":{"type":"string"},"summary":{"type":"string"},"disclaimer":{"type":"string"},"inbox":{"type":"object","required":["provider","exchanges"],"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}]},"exchanges":{"type":"array","items":{"type":"string"}}}},"senders":{"type":"array","items":{"type":"object","required":["vendor","role","confidence","leftover","evidence"],"properties":{"vendor":{"type":"string"},"role":{"type":"string","enum":["inbox_and_send","inbox_only","send","dkim_only"]},"confidence":{"type":"string","enum":["high","medium","low"]},"leftover":{"type":"boolean"},"evidence":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["spf_include","nested_spf_include","dkim_selector","mx_host","ip4","ip6"]},"value":{"type":"string"}}}}}}},"unnamed":{"type":"object","required":["ip4","ip6","includes"],"properties":{"ip4":{"type":"array","items":{"type":"string"}},"ip6":{"type":"array","items":{"type":"string"}},"includes":{"type":"array","items":{"type":"string"}}}},"spf":{"type":"object","required":["published","qualifier","lookupCount","rawRecord"],"properties":{"published":{"type":"boolean"},"qualifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"lookupCount":{"type":"number"},"rawRecord":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"nextStep":{"type":"object","required":["title","body","href"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"href":{"type":"string"}}},"subdomainNote":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Who-sends"}},"/api/tools/v1/domain-age":{"post":{"tags":["Tools"],"summary":"Domain age check","description":"Inspects domain registration age via RDAP and combines it with SPF/DKIM/DMARC status to evaluate mailbox filter cold-domain risk.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The domain name or URL to check registration age and email readiness for.","examples":["google.com","github.com","reloop.sh"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The domain name or URL to check registration age and email readiness for.","examples":["google.com","github.com","reloop.sh"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The domain name or URL to check registration age and email readiness for.","examples":["google.com","github.com","reloop.sh"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","registrableDomain","resolvedAt","responseTimeMs","verdict","headline","summary","disclaimer","age","registry","nameservers","emailSetup","nextStep","warnings"],"properties":{"domain":{"type":"string"},"registrableDomain":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"verdict":{"type":"string","enum":["too_new","cold","warming","established","mature","unknown_age","not_registered","held"]},"headline":{"type":"string"},"summary":{"type":"string"},"disclaimer":{"type":"string"},"age":{"type":"object","required":["createdAt","ageDays","expiresAt","updatedAt","source"],"properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ageDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string","enum":["rdap","none"]}}},"registry":{"type":"object","required":["registrar","status","tld"],"properties":{"registrar":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"array","items":{"type":"string"}},"tld":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"nameservers":{"type":"object","required":["hosts","provider","kind"],"properties":{"hosts":{"type":"array","items":{"type":"string"}},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string","enum":["production","registrar_default","parking","unknown"]}}},"emailSetup":{"type":"object","required":["spf","dmarc","dmarcPolicy","mx"],"properties":{"spf":{"type":"boolean"},"dmarc":{"type":"boolean"},"dmarcPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"mx":{"type":"boolean"}}},"nextStep":{"type":"object","required":["title","body","href"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"href":{"type":"string"}}},"warnings":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Domain-age"}},"/api/tools/v1/lookalike-watch":{"post":{"tags":["Tools"],"summary":"Lookalike watch","description":"Generates bounded candidate permutations (TLDs, typos, affixes, homoglyphs) and scans public DNS to detect registered lookalike domains that can send email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The primary domain name or URL to scan for phishing lookalikes.","examples":["stripe.com","github.com","reloop.sh"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The primary domain name or URL to scan for phishing lookalikes.","examples":["stripe.com","github.com","reloop.sh"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"The primary domain name or URL to scan for phishing lookalikes.","examples":["stripe.com","github.com","reloop.sh"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","registrableDomain","resolvedAt","responseTimeMs","verdict","headline","summary","disclaimer","scanned","hits","nextStep"],"properties":{"domain":{"type":"string"},"registrableDomain":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"verdict":{"type":"string","enum":["mail_twins","parked_twins","clear_scan"]},"headline":{"type":"string"},"summary":{"type":"string"},"disclaimer":{"type":"string"},"scanned":{"type":"number"},"hits":{"type":"array","items":{"type":"object","required":["name","unicodeName","trick","registered","mailCapable","mx","spf"],"properties":{"name":{"type":"string"},"unicodeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"trick":{"type":"string","enum":["tld","affix","typo","homoglyph"]},"registered":{"type":"boolean"},"mailCapable":{"type":"boolean"},"mx":{"type":"boolean"},"spf":{"type":"boolean"}}}},"nextStep":{"type":"object","required":["title","body","href"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"href":{"type":"string"}}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Lookalike-watch"}},"/api/tools/v1/bimi-check":{"post":{"tags":["Tools"],"summary":"BIMI check","description":"Looks up default._bimi.{domain} TXT, validates v=BIMI1 / l= / a=, and checks that DMARC is at enforcement (p=quarantine or p=reject, pct=100). Optionally fetches the logo over HTTPS and applies SVG Tiny PS heuristics. Public and rate limited per IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"Domain to look up default._bimi and _dmarc for.","examples":["paypal.com","example.com"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"Domain to look up default._bimi and _dmarc for.","examples":["paypal.com","example.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":255,"description":"Domain to look up default._bimi and _dmarc for.","examples":["paypal.com","example.com"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","queryName","verdict","bimiRecord","logoUrl","authorityUrl","dmarcRecord","dmarcPolicy","dmarcPct","dmarcEnforced","logo","checks","recommendations"],"properties":{"domain":{"type":"string"},"queryName":{"type":"string"},"verdict":{"type":"string","enum":["pass","warn","fail"]},"bimiRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorityUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"dmarcRecord":{"anyOf":[{"type":"string"},{"type":"null"}]},"dmarcPolicy":{"anyOf":[{"type":"string"},{"type":"null"}]},"dmarcPct":{"anyOf":[{"type":"number"},{"type":"null"}]},"dmarcEnforced":{"type":"boolean"},"logo":{"type":"object","required":["fetched","contentType","tinyPsOk","issues"],"properties":{"fetched":{"type":"boolean"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}]},"tinyPsOk":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"issues":{"type":"array","items":{"type":"object","required":["status","detail"],"properties":{"status":{"type":"string","enum":["pass","warn","fail"]},"detail":{"type":"string"},"fix":{"type":"string"}}}}}},"checks":{"type":"array","items":{"type":"object","required":["id","label","status","detail"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pass","warn","fail"]},"detail":{"type":"string"},"record":{"type":"string"},"fix":{"type":"string"}}}},"recommendations":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"Response for status 503","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Bimi-check"}},"/api/tools/v1/domain-reputation":{"post":{"tags":["Tools"],"summary":"Domain reputation check","description":"Evaluates sender domain reputation across email authentication (SPF, DKIM, DMARC), real-time DNS blocklists (Spamhaus, URIBL, SURBL), domain age, and DNS health.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":400,"description":"Root or sending domain to assess reputation for.","examples":["reloop.sh","github.com","stripe.com"],"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":400,"description":"Root or sending domain to assess reputation for.","examples":["reloop.sh","github.com","stripe.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"minLength":1,"maxLength":400,"description":"Root or sending domain to assess reputation for.","examples":["reloop.sh","github.com","stripe.com"],"type":"string"}}}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"type":"object","required":["domain","resolvedAt","responseTimeMs","score","grade","verdict","verdictLabel","breakdown","details","checks","recommendations"],"properties":{"domain":{"type":"string"},"resolvedAt":{"type":"string"},"responseTimeMs":{"type":"number"},"score":{"type":"number"},"grade":{"type":"string","enum":["A+","A","B","C","D","F"]},"verdict":{"type":"string","enum":["excellent","good","fair","poor","critical"]},"verdictLabel":{"type":"string"},"breakdown":{"type":"object","required":["authentication","blocklist","domainAge","dnsHealth"],"properties":{"authentication":{"type":"object","required":["score","weight","status","summary"],"properties":{"score":{"type":"number"},"weight":{"type":"number"},"status":{"type":"string","enum":["pass","warn","fail"]},"summary":{"type":"string"}}},"blocklist":{"type":"object","required":["score","weight","status","summary"],"properties":{"score":{"type":"number"},"weight":{"type":"number"},"status":{"type":"string","enum":["pass","warn","fail"]},"summary":{"type":"string"}}},"domainAge":{"type":"object","required":["score","weight","status","summary"],"properties":{"score":{"type":"number"},"weight":{"type":"number"},"status":{"type":"string","enum":["pass","warn","fail"]},"summary":{"type":"string"}}},"dnsHealth":{"type":"object","required":["score","weight","status","summary"],"properties":{"score":{"type":"number"},"weight":{"type":"number"},"status":{"type":"string","enum":["pass","warn","fail"]},"summary":{"type":"string"}}}}},"details":{"type":"object","required":["authentication","blocklist","domainAge","dnsHealth"],"properties":{"authentication":{"type":"object","required":["spf","dkim","dmarc"],"properties":{"spf":{"type":"object","required":["exists","status","detail"],"properties":{"exists":{"type":"boolean"},"record":{"type":"string"},"qualifier":{"type":"string"},"status":{"type":"string","enum":["pass","warn","fail"]},"detail":{"type":"string"}}},"dkim":{"type":"object","required":["detected","status","detail"],"properties":{"detected":{"type":"boolean"},"selector":{"type":"string"},"record":{"type":"string"},"status":{"type":"string","enum":["pass","warn","fail"]},"detail":{"type":"string"}}},"dmarc":{"type":"object","required":["exists","status","detail"],"properties":{"exists":{"type":"boolean"},"record":{"type":"string"},"policy":{"type":"string"},"pct":{"type":"number"},"status":{"type":"string","enum":["pass","warn","fail"]},"detail":{"type":"string"}}}}},"blocklist":{"type":"object","required":["cleanCount","listedCount","totalChecked","listings"],"properties":{"cleanCount":{"type":"number"},"listedCount":{"type":"number"},"totalChecked":{"type":"number"},"listings":{"type":"array","items":{"type":"object","required":["zone","name","listed"],"properties":{"zone":{"type":"string"},"name":{"type":"string"},"listed":{"type":"boolean"},"returnCode":{"type":"string"}}}}}},"domainAge":{"type":"object","required":["tier","detail"],"properties":{"ageDays":{"type":"number"},"createdDate":{"type":"string"},"expiryDate":{"type":"string"},"registrar":{"type":"string"},"tier":{"type":"string","enum":["mature","established","warming","young","new","unknown"]},"detail":{"type":"string"}}},"dnsHealth":{"type":"object","required":["mxRecords","aRecords","nsRecords","hasPtr","sslValid"],"properties":{"mxRecords":{"type":"array","items":{"type":"object","required":["exchange","priority"],"properties":{"exchange":{"type":"string"},"priority":{"type":"number"}}}},"aRecords":{"type":"array","items":{"type":"string"}},"nsRecords":{"type":"array","items":{"type":"string"}},"hasPtr":{"type":"boolean"},"sslValid":{"type":"boolean"},"sslDaysRemaining":{"type":"number"},"sslIssuer":{"type":"string"}}}}},"checks":{"type":"array","items":{"type":"object","required":["id","category","label","status","detail"],"properties":{"id":{"type":"string"},"category":{"type":"string","enum":["authentication","blocklist","domain_age","dns_health"]},"label":{"type":"string"},"status":{"type":"string","enum":["pass","warn","fail","info"]},"detail":{"type":"string"},"record":{"type":"string"}}}},"recommendations":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"operationId":"postApiToolsV1Domain-reputation"}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Reloop API key (prefix `rl_`). Create one at https://reloop.sh/dashboard/api-keys."},"bearer":{"type":"http","scheme":"bearer","description":"Reloop API key or OAuth access token as `Authorization: Bearer <token>`."}},"schemas":{"Error":{"type":"object","description":"Error returned by every Reloop API endpoint. Branch on `code`; show `message`, `why` and `fix` to people. See https://reloop.sh/docs/api/errors.","required":["code","message","link"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code, e.g. `validation_error`, `unauthorized`, `not_found`, `conflict`, `rate_limited`, `internal_error`.","example":"validation_error"},"message":{"type":"string","description":"Short summary of what went wrong."},"why":{"type":"string","description":"Why it went wrong."},"fix":{"type":"string","description":"How to fix it."},"link":{"type":"string","format":"uri","description":"Documentation for this error."},"errors":{"type":"array","description":"Per-field problems. Present on `validation_error`.","items":{"$ref":"#/components/schemas/FieldError"}}}},"FieldError":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string","description":"JSON Pointer to the invalid field, e.g. `/email`."},"message":{"type":"string"}}}},"headers":{"JobLocation":{"description":"URL of the job's status resource. Poll it with GET until the job finishes.","schema":{"type":"string","example":"/api/contacts/v1/exports/exp_abc123"}},"RetryAfter":{"description":"Seconds to wait before polling again.","schema":{"type":"integer","example":5}},"IdempotentReplayed":{"description":"`true` when this response is a replay of an earlier request with the same Idempotency-Key.","schema":{"type":"string","enum":["true"]}},"Deprecation":{"description":"Present when the endpoint is deprecated: when it was deprecated, as `@<unix seconds>` (RFC 9745).","schema":{"type":"string","example":"@1793491200"}},"Sunset":{"description":"Present when the endpoint is deprecated: the date after which it may be removed, as an HTTP-date (RFC 8594).","schema":{"type":"string","example":"Sat, 01 May 2027 00:00:00 GMT"}}},"responses":{"ValidationError":{"description":"The request did not match the endpoint's schema (`code: validation_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests (`code: rate_limited`). Wait for the `Retry-After` delay. See https://reloop.sh/docs/api/usage-limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"Unexpected server error (`code: internal_error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"IdempotencyConflict":{"description":"A request with this Idempotency-Key is still in progress (`code: idempotency_in_progress`). Retry after the `Retry-After` delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"IdempotencyKeyReused":{"description":"This Idempotency-Key was already used with a different request body or endpoint (`code: idempotency_key_reused`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key (for example a UUID) that makes retries safe. The first successful response is stored for 24 hours and replayed for retries with the same key and body. See https://reloop.sh/docs/api/idempotency.","schema":{"type":"string","maxLength":255}}}}}