{"openapi":"3.0.0","info":{"title":"Blackleaf API","version":"2.8.4","description":"<div><p>The Blackleaf API is organized around <a href=\"http://en.wikipedia.org/wiki/Representational_State_Transfer\"><span>REST</span></a>. Our API has predictable resource-oriented URLs, accepts <a href=\"https://en.wikipedia.org/wiki/POST_(HTTP)#Use_for_submitting_web_forms\"><span>form-encoded</span></a> request bodies, returns <a href=\"http://www.json.org/\"><span>JSON-encoded</span></a> responses, and uses standard HTTP response codes, authentication, and verbs.</p></div>"},"servers":[{"url":"https://api.blackleaf.io"},{"url":"https://api-dev.blackleaf.io"},{"url":"https://api-test.blackleaf.io"},{"url":"http://localhost:3000"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"security":[{"BearerAuth":[]}],"customOptions":{"customCss":"","customSiteTitle":"Blackleaf API Documentation","customfavIcon":"https://blackleaf.io/apple-touch-icon.png?v=24189"},"paths":{"/messaging/create/template":{"post":{"security":[{"BearerAuth":[]}],"tags":["Messaging"],"summary":"Create a text message template","description":"Creates a template that is used to send texts. Requires an `Authorization` header with a Bearer token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","example":"Hello {{firstName}}! You have a new notification}","default":""},"image":{"type":"string","example":"","default":""},"unsubscribeText":{"type":"string","example":"Text STOP to end","default":""}}},"required":[]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the template.","example":"12345"},"accepted":{"type":"string","description":"Message is usable.","example":true},"bodyAccepted":{"type":"string","description":"Message is usable.","example":true},"imageAccepted":{"type":"string","description":"Message is usable.","example":true},"status":{"type":"string","description":"Status.","example":"accepted,rejected"},"explanation":{"type":"string","description":"","example":"Your template has been accepted."},"cost":{"type":"number","description":"Cost of message creation","example":0.01}}}}}}},"x-blackleaf-mcp":{"name":"api_post_messaging_create_template","scope":"api:api_post_messaging_create_template"}}},"/messaging/send/text":{"post":{"security":[{"BearerAuth":[]}],"tags":["Messaging"],"summary":"Send a Text Message (SMS, MMS)","description":"Sends a text message. Requires an `Authorization` header with a Bearer token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","example":"phone","default":""},"templateId":{"type":"string","example":"12345","default":""},"body":{"type":"string","example":"Hello World!","default":""},"image":{"type":"string","example":"","default":""},"contact":{"type":"object","example":{"firstName":"John","lastName":"Doe"},"default":""},"order":{"type":"object","example":{"status":"Complete","total":0},"default":""},"location":{"type":"object","example":{"storeName":"Long Beach","address":"123 E Ocean Blvd","city":"Long Beach","state":"CA","zip":"90804"},"default":""},"landingUrl":{"type":"string","example":"https://google.com/","default":""},"landingImage":{"type":"string","example":"","default":""},"landingBody":{"type":"string","example":"","default":""},"campaignId":{"type":"string","example":"","default":""},"sendingProfileId":{"type":"string","example":"","default":""},"dob":{"type":"string","example":"2000-01-01T00:00:00.000","default":""}}},"required":["templateId"]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_messaging_send_text","scope":"api:api_post_messaging_send_text"}}},"/messaging/send/2fa":{"post":{"security":[{"BearerAuth":[]}],"tags":["Messaging"],"summary":"Send a 2FA code to a phone number","description":"Sends a 2FA code. Requires an `Authorization` header with a Bearer token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","example":"5555555555","default":""},"digits":{"type":"number","example":5,"default":""},"expires":{"type":"number","example":300,"default":""}}},"required":["phone"]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_messaging_send_2fa","scope":"api:api_post_messaging_send_2fa"}}},"/messaging/verify/2fa":{"post":{"security":[{"BearerAuth":[]}],"tags":["Messaging"],"summary":"Verify a 2FA code","description":"Sends a 2FA code. Requires an `Authorization` header with a Bearer token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","example":"5555555555","default":""},"code":{"type":"number","example":12345,"default":""}}},"required":["phone","code"]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_messaging_verify_2fa","scope":"api:api_post_messaging_verify_2fa"}}},"/messaging/messages":{"get":{"security":[{"BearerAuth":[]}],"tags":["Messaging"],"summary":"List of messages","description":"Retrieves a list of messages with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"campaignId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-message-id"},"hash":{"type":"string","example":"example-hash"},"org":{"type":"string","example":"example-org-id"},"status":{"type":"string","example":"delivered"},"from":{"type":"string","example":""},"to":{"type":"string","example":"phone"},"fromAddress":{"type":"string","example":"your@company.com"},"fromName":{"type":"string","example":"Your Company"},"subject":{"type":"string","example":"You Received a New Message!"},"templateId":{"type":"string","example":"12345"},"body":{"type":"string","example":"Hello World!"},"image":{"type":"string","example":""},"contact":{"type":"object","example":{"firstName":"John","lastName":"Doe"}},"order":{"type":"object","example":{"status":"Complete","total":0}},"location":{"type":"object","example":{"storeName":"Long Beach","address":"123 E Ocean Blvd","city":"Long Beach","state":"CA","zip":"90804"}},"landingUrl":{"type":"string","example":"https://google.com/"},"landingImage":{"type":"string","example":""},"landingBody":{"type":"string","example":""},"campaignId":{"type":"string","example":""},"group":{"exampleValue":"","required":false,"requestParameter":true,"displayAs":"sendingProfileId"},"carrierName":{"type":"string","example":"AT&T"},"rate":{"exampleValue":0.04,"required":false,"requestParameter":false,"displayAs":"cost"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"dateCreated":{"type":"string","example":"2023-07-02T15:32:24.694Z"},"dateModified":{"type":"string","example":"2023-07-02T15:32:24.694Z"},"type":{"type":"string","example":"mms"},"parts":{"type":"number","example":1},"sendingProfileId":{"type":"string","example":""},"cost":{"type":"number","example":0.04}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_messaging_messages","scope":"api:api_get_messaging_messages"}}},"/messaging/senders/profiles":{"get":{"security":[{"BearerAuth":[]}],"tags":["Messaging"],"summary":"Get a list of message sender profiles","description":"Retrieves a list of sender profiles with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"ffffffff77457d230beabf3d"},"org":{"type":"string","example":"ohkVAdGPQ"},"title":{"type":"string","example":"SMS and MMS Sender"},"total":{"type":"number","example":0},"autobuy":{"type":"boolean","example":false},"dateCreated":{"type":"string","example":"2024-06-28T18:41:07.342Z"},"dateModified":{"type":"string","example":"2024-06-28T18:41:07.349Z"},"sampleSize":{"type":"number","example":5},"maxNumbers":{"type":"number","example":150},"maxPending":{"type":"number","example":2500},"failedThreshold":{"type":"number","example":5},"failAction":{"type":"string","example":"disable"},"minHealthyNumbers":{"type":"number","example":1},"sticky":{"type":"boolean","example":true},"healthy":{"type":"number","example":0}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_messaging_senders_profiles","scope":"api:api_get_messaging_senders_profiles"}}},"/automation/{_id}/invoke/":{"post":{"security":[{"BearerAuth":[]}],"tags":["Automations"],"summary":"Invoke automation","description":"Start automation.","parameters":[{"in":"path","name":"_id","example":"12345","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","example":{"customerId":"12345","phone":"555-555-5555","firstName":"Some","lastName":"One"},"default":""},"payload":{"type":"object","example":{},"default":""}}},"required":["_id","contact"]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Started.","example":"Started"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_automation_by_id_invoke","scope":"api:api_post_automation_by_id_invoke"}}},"/campaign/{_id}/add/":{"post":{"tags":["Campaigns"],"summary":"add","description":"Add an existing, eligible contact to an unscheduled campaign draft. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"phone","required":true,"schema":{"type":"string","example":"2025550101"},"description":"One customer or test recipient phone number."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_add","scope":"api:api_post_campaign_by_id_add"}}},"/campaign/{_id}/remove/":{"post":{"tags":["Campaigns"],"summary":"remove","description":"Exclude a contact from an unscheduled campaign draft. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"phone","required":true,"schema":{"type":"string","example":"2025550101"},"description":"One customer or test recipient phone number."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_remove","scope":"api:api_post_campaign_by_id_remove"}}},"/campaign/{_id}/add-list/":{"post":{"tags":["Campaigns"],"summary":"add-list","description":"Add eligible contacts matching a saved list to an unscheduled campaign draft. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Saved list identifier from this workspace."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_add_list","scope":"api:api_post_campaign_by_id_add_list"}}},"/campaign/{_id}/remove-list/":{"post":{"tags":["Campaigns"],"summary":"remove-list","description":"Exclude contacts matching a saved list from an unscheduled campaign draft. The saved list is unchanged. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Saved list identifier from this workspace."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_remove_list","scope":"api:api_post_campaign_by_id_remove_list"}}},"/campaign/{_id}/send-test/":{"post":{"tags":["Campaigns"],"summary":"send-test","description":"Send the saved SMS campaign to one phone number with a [TEST] marker. Opt-outs and account balance are checked. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"phone","required":true,"schema":{"type":"string","example":"2025550101"},"description":"One customer or test recipient phone number."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_send_test","scope":"api:api_post_campaign_by_id_send_test"}}},"/campaign/{_id}/send/":{"post":{"tags":["Campaigns"],"summary":"send","description":"Start a campaign through its usual launch checks. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_send","scope":"api:api_post_campaign_by_id_send"}}},"/campaign/{_id}/pause/":{"post":{"tags":["Campaigns"],"summary":"pause","description":"Pause campaign delivery. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_pause","scope":"api:api_post_campaign_by_id_pause"}}},"/campaign/{_id}/cancel/":{"post":{"tags":["Campaigns"],"summary":"cancel","description":"Cancel campaign delivery. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_cancel","scope":"api:api_post_campaign_by_id_cancel"}}},"/campaign/contact/add":{"post":{"tags":["Campaigns"],"summary":"Add an existing, eligible contact to an unscheduled campaign draft.","description":"Compatibility route. Send campaignId and phone in the JSON body. Returns a queued request.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["campaignId","phone"],"properties":{"campaignId":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"phone":{"type":"string","example":"2025550101"}}}}}},"responses":{"202":{"description":"Action queued."}},"x-blackleaf-mcp":{"name":"api_post_campaign_contact_add","scope":"api:api_post_campaign_contact_add"}}},"/campaign/contact/remove":{"post":{"tags":["Campaigns"],"summary":"Exclude a contact from an unscheduled campaign draft.","description":"Compatibility route. Send campaignId and phone in the JSON body. Returns a queued request.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["campaignId","phone"],"properties":{"campaignId":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"phone":{"type":"string","example":"2025550101"}}}}}},"responses":{"202":{"description":"Action queued."}},"x-blackleaf-mcp":{"name":"api_post_campaign_contact_remove","scope":"api:api_post_campaign_contact_remove"}}},"/campaign/{_id}/requests/{requestId}/":{"get":{"tags":["Campaigns"],"summary":"Check a campaign action","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"}},{"in":"path","name":"requestId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"}}],"description":"completed means the command was processed. Campaign review and message delivery can continue afterward. A processing request interrupted by a server restart needs review before retrying a send.","responses":{"200":{"description":"Request status: queued, processing, completed or failed."},"404":{"description":"Request not found in this workspace."}},"x-blackleaf-mcp":{"name":"api_get_campaign_by_id_requests_by_requestid","scope":"api:api_get_campaign_by_id_requests_by_requestid"}}},"/campaign/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Campaigns"],"summary":"List of campaigns","description":"Retrieves a list of campaigns with pagination. Optionally filter by campaignType, _id, or both. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"_id","schema":{"type":"string","default":""},"required":false,"description":"Filter by an exact campaign identifier."},{"in":"query","name":"campaignType","schema":{"type":"string","default":""},"required":false,"description":"Filter by an exact campaign type, such as one-time, repeating, or trigger."},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"desc","default":"desc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"000000000000000000000001"},"body":{"type":"string","example":"Enjoy 40% OFF your entire order—today through the weekend! Use code SAVE40 at checkout. Don’t miss out!\n\nhttps://example.com"},"image":{"type":"string","example":"https://example.com/example-image.jpg"},"totalList":{"type":"number","example":10313},"messagesSent":{"type":"number","example":10062},"optedOut":{"type":"number","example":181},"outboundMessages":{"type":"number","example":10061},"accepted":{"type":"number","example":9724},"delivered":{"type":"number","example":9341},"failed":{"type":"number","example":658},"expired":{"type":"number","example":0},"paused":{"type":"number","example":0},"errored":{"type":"number","example":0},"undelivered":{"type":"number","example":63},"cost":{"type":"number","example":503.05},"linkClicks":{"type":"number","example":0},"campaignType":{"type":"string","example":"one-time"},"channelName":{"type":"string","example":"Example Channel"},"criteria":{"type":"string","example":"{\"$and\":[{\"nothing\":{\"$eq\":\"\"}},{\"$or\":[{\"tags.importFile.example_tag\":{\"$ne\":null}}]}]}"},"dateCreated":{"type":"string","example":"2024-11-22T16:37:33.132Z"},"dateModified":{"type":"string","example":"2024-11-25T08:16:14.934Z"},"elapsedTime":{"type":"number","example":5549976},"enabled":{"type":"boolean","example":true},"exclusions":{"type":"string","example":""},"fromAddress":{"type":"string","example":""},"fromName":{"type":"string","example":""},"group":{"type":"string","example":"example-group-id"},"groupName":{"type":"string","example":"Example Sender Group"},"hash":{"type":"string","example":"example-hash"},"optOutMessage":{"type":"string","example":"Reply STOP to UNSUBSCRIBE"},"org":{"type":"string","example":"example-org-id"},"processedBody":{"type":"string","example":"Enjoy 40% OFF your entire order—today through the weekend! Use code SAVE40 at checkout. Don't miss out!\n\nhttps://example.com\n\nReply STOP to UNSUBSCRIBE"},"repeatEnabled":{"type":"boolean","example":false},"repeatSchedule":{"type":"string","example":"0 0 * * * *"},"runEnded":{"type":"number","example":0},"runStarted":{"type":"number","example":1732293499064},"scheduleDate":{"type":"number","example":1732291200000},"shortener":{"type":"string","example":""},"status":{"type":"string","example":"stopped"},"subject":{"type":"string","example":""},"trackLink":{"type":"boolean","example":false},"transactions":{"type":"number","example":0},"webBody":{"type":"string","example":""},"dateStart":{"type":"string","example":"2024-11-22T16:37:34.200Z"},"lastMessageSentDate":{"type":"number","example":1732296459700},"lastMessageStatusDate":{"type":"number","example":1732296571932},"lastPhoneNumber":{"type":"string","example":"555-555-5555"}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_campaign","scope":"api:api_get_campaign"}}},"/campaign/set":{"post":{"security":[{"BearerAuth":[]}],"tags":["Campaigns"],"summary":"Create or Modify a campaign","description":"Save an inactive SMS draft through the platform processor. Omitted sender uses 10 DLC - Marketing with assigned numbers, then another populated SMS profile. Explicit profile IDs may have zero numbers. allowEmptySenderProfile:true explicitly permits no sender on a draft. Returns 202 queued with campaignId; GET /campaign?_id=... to read the saved draft. Requires a workspace Bearer API key.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string","example":"000000000000000000000001","default":""},"title":{"type":"string","example":"Today’s notification","default":""},"body":{"type":"string","example":"Your update is ready.","default":""},"audienceIds":{"type":"array","example":[],"default":"","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}},"senderProfileId":{"type":"string","example":"000000000000000000000002","default":""},"allowEmptySenderProfile":{"type":"boolean","example":false,"default":""}},"required":["title","body"]},"required":["title","body"]}}},"responses":{"202":{"description":"Draft queued for the workspace processor.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"queued"},"campaignId":{"type":"string"},"senderProfileId":{"type":"string"},"enabled":{"type":"boolean","example":false},"scheduled":{"type":"boolean","example":false}}}}}},"400":{"description":"Invalid draft fields or profile selection."},"401":{"description":"Invalid workspace API key."},"409":{"description":"No populated default sender, or the campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_set","scope":"api:api_post_campaign_set"}}},"/contact/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Get a list of contacts","description":"Retrieves a list of contacts with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_contact","scope":"api:api_get_contact"}}},"/contact/{phone}":{"get":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Get a contact","description":"Retrieves a contact. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"phone","schema":{"type":"string","default":""},"required":false}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"searchParameter":true,"exampleValue":"5555555555","required":false,"requestParameter":true,"in":"path"}}}}}}},"x-blackleaf-mcp":{"name":"api_get_contact_by_phone","scope":"api:api_get_contact_by_phone"}}},"/contact/set":{"post":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Create or Modify a contact","description":"Contact will be updated based on their phone number, email, id or a new contact will be created. Requires an `Authorization` header with a Bearer token.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","example":"example-customer-id","default":""},"displayName":{"type":"string","example":"John Doe","default":""},"phone":{"type":"string","example":"555-123-4567","default":""},"email":{"type":"string","example":"","default":""},"firstName":{"type":"string","example":"John","default":""},"lastName":{"type":"string","example":"Doe","default":""},"dob":{"type":"string","example":"2000-01-01T00:00:00.000","default":""},"gender":{"type":"string","example":"M","default":""},"address":{"type":"string","example":"123 Example St","default":""},"city":{"type":"string","example":"Example City","default":""},"state":{"type":"string","example":"CA","default":""},"zip":{"type":"string","example":"12345","default":""},"unsubscribed":{"type":"boolean","example":false,"default":""},"points":{"type":"number","example":150,"default":""},"lifetimePoints":{"type":"number","example":150,"default":""},"consumerType":{"type":"string","example":"AdultUse","default":""}}},"required":[]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_contact_set","scope":"api:api_post_contact_set"}}},"/contact/{phone}/subscribe":{"post":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Subscribe a contact to receive messages","description":"Contact will be updated based on their phone number, email, id. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"phone","example":"5555555555","schema":{"type":"string"},"required":false}],"requestBody":null,"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_contact_by_phone_subscribe","scope":"api:api_post_contact_by_phone_subscribe"}}},"/contact/{phone}/unsubscribe":{"post":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Unsubscribe a contact from receiving messages","description":"Contact will be updated based on their phone number, email, id. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"phone","example":"5555555555","schema":{"type":"string"},"required":false}],"requestBody":null,"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_contact_by_phone_unsubscribe","scope":"api:api_post_contact_by_phone_unsubscribe"}}},"/contact/{phone}/points":{"post":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Add/Remove Contact Rewards Points","description":"Contact will be updated based on their phone number, email, id. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"phone","example":"5555555555","schema":{"type":"string"},"required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"points":{"type":"string","example":"10","default":""},"title":{"type":"string","example":"10 points earned for your purchase.","default":""},"description":{"type":"string","example":"You earned 10 points for your recent purchase of $10. You earned 1 point per dollar.","default":""}}},"required":[]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the object.","example":"12345"},"status":{"type":"string","description":"Status.","example":"success"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_contact_by_phone_points","scope":"api:api_post_contact_by_phone_points"}}},"/list":{"get":{"tags":["Lists"],"security":[{"BearerAuth":[]}],"summary":"Get saved lists","description":"Lists belonging to the API key’s workspace. Counts may be pending background refresh.","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"in":"query","name":"after","schema":{"type":"string"},"description":"nextCursor from the previous page."}],"responses":{"200":{"description":"Success. List IDs can be used as campaign audience IDs."},"400":{"description":"Invalid input."},"401":{"description":"API key required."},"404":{"description":"List/contact not found in this workspace."},"409":{"description":"List cannot be changed or requestId conflicts."}},"x-blackleaf-mcp":{"name":"api_get_list","scope":"api:api_get_list"}},"post":{"tags":["Lists"],"security":[{"BearerAuth":[]}],"summary":"Create a saved list","description":"Omit criteria (or use {}) for an empty manual list. Filters remain dynamic; manual additions override filters and removals remain excluded. No messages are sent. See routes/list/README.md for supported filters.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":2000},"criteria":{"type":"object","example":{"areaCodes":["562"]},"description":"Optional areaCodes filter and whitelisted contact comparisons. Arbitrary Mongo expressions and regex are rejected."},"requestId":{"type":"string","format":"uuid","description":"Reuse on create retries to avoid duplicate lists."}}}}}},"responses":{"201":{"description":"Success. List IDs can be used as campaign audience IDs."},"400":{"description":"Invalid input."},"401":{"description":"API key required."},"404":{"description":"List/contact not found in this workspace."},"409":{"description":"List cannot be changed or requestId conflicts."}},"x-blackleaf-mcp":{"name":"api_post_list","scope":"api:api_post_list"}}},"/list/{listId}":{"get":{"tags":["Lists"],"security":[{"BearerAuth":[]}],"summary":"Get a saved list","description":"Returns live membership and distinct eligible phone counts.","parameters":[{"in":"path","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"responses":{"200":{"description":"Success. List IDs can be used as campaign audience IDs."},"400":{"description":"Invalid input."},"401":{"description":"API key required."},"404":{"description":"List/contact not found in this workspace."},"409":{"description":"List cannot be changed or requestId conflicts."}},"x-blackleaf-mcp":{"name":"api_get_list_by_listid","scope":"api:api_get_list_by_listid"}}},"/list/{listId}/phones":{"get":{"tags":["Lists"],"security":[{"BearerAuth":[]}],"summary":"Get list phones","description":"Returns paginated contacts and SMS eligibility. Membership does not change global subscription status.","parameters":[{"in":"path","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"in":"query","name":"after","schema":{"type":"string"},"description":"nextCursor from the previous page."}],"responses":{"200":{"description":"Success. List IDs can be used as campaign audience IDs."},"400":{"description":"Invalid input."},"401":{"description":"API key required."},"404":{"description":"List/contact not found in this workspace."},"409":{"description":"List cannot be changed or requestId conflicts."}},"x-blackleaf-mcp":{"name":"api_get_list_by_listid_phones","scope":"api:api_get_list_by_listid_phones"}}},"/list/{listId}/phones/add":{"post":{"tags":["Lists"],"security":[{"BearerAuth":[]}],"summary":"Add phones to a list","description":"Provide phone or phones. Existing global opt-outs are preserved. Unknown phones require createContacts:true.","parameters":[{"in":"path","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"phone":{"type":"string","example":"+1 (562) 555-0100"},"phones":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string"}},"createContacts":{"type":"boolean","default":false,"description":"Create basic workspace contacts for unknown phones. Never re-subscribes an existing contact."}},"oneOf":[{"required":["phone"]},{"required":["phones"]}]}}}},"responses":{"200":{"description":"Success. List IDs can be used as campaign audience IDs."},"400":{"description":"Invalid input."},"401":{"description":"API key required."},"404":{"description":"List/contact not found in this workspace."},"409":{"description":"List cannot be changed or requestId conflicts."}},"x-blackleaf-mcp":{"name":"api_post_list_by_listid_phones_add","scope":"api:api_post_list_by_listid_phones_add"}}},"/list/{listId}/phones/remove":{"post":{"tags":["Lists"],"security":[{"BearerAuth":[]}],"summary":"Remove phones from a list","description":"Excludes phones even when they match the list’s criteria. Re-adding clears that list exclusion. Other lists and global subscriptions are unaffected.","parameters":[{"in":"path","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"phone":{"type":"string","example":"+1 (562) 555-0100"},"phones":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string"}}},"oneOf":[{"required":["phone"]},{"required":["phones"]}]}}}},"responses":{"200":{"description":"Success. List IDs can be used as campaign audience IDs."},"400":{"description":"Invalid input."},"401":{"description":"API key required."},"404":{"description":"List/contact not found in this workspace."},"409":{"description":"List cannot be changed or requestId conflicts."}},"x-blackleaf-mcp":{"name":"api_post_list_by_listid_phones_remove","scope":"api:api_post_list_by_listid_phones_remove"}}},"/product/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Products"],"summary":"Get a list of products","description":"Retrieves a list of contacts with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_products","scope":"api:api_get_products"}}},"/product/{id}":{"get":{"security":[{"BearerAuth":[]}],"tags":["Products"],"summary":"Get a product","description":"Retrieves a product. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"productId","schema":{"type":"string","default":""},"required":false}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"searchParameter":true,"exampleValue":"12345","required":false,"requestParameter":true,"in":"path"}}}}}}},"x-blackleaf-mcp":{"name":"api_get_products_by_id","scope":"api:api_get_products_by_id"}}},"/order/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Orders"],"summary":"Get a list of orders","description":"Retrieves a list of contacts with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_orders","scope":"api:api_get_orders"}}},"/order/{id}":{"get":{"security":[{"BearerAuth":[]}],"tags":["Orders"],"summary":"Get a order","description":"Retrieves an order. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"orderId","schema":{"type":"string","default":""},"required":false}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"searchParameter":true,"exampleValue":"12345","required":false,"requestParameter":true,"in":"path"}}}}}}},"x-blackleaf-mcp":{"name":"api_get_orders_by_id","scope":"api:api_get_orders_by_id"}}},"/account/balance":{"get":{"security":[{"BearerAuth":[]}],"tags":["Account"],"summary":"Get Account Balance","description":"Get Account Balance. Requires an `Authorization` header with a Bearer token.","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"org":{"exampleValue":"12345","required":false,"requestParameter":true},"title":{"exampleValue":"My Company","required":false,"requestParameter":true},"balance":{"exampleValue":0,"required":false,"requestParameter":true},"autoload":{"displayAs":"autoloadFunds","exampleValue":true,"required":false,"requestParameter":true},"autoloadLow":{"displayAs":"autoloadLowTrigger","exampleValue":100,"required":false,"requestParameter":true},"autoloadAmount":{"exampleValue":500,"required":false,"requestParameter":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_account_balance","scope":"api:api_get_account_balance"}}},"/careers/":{"get":{"security":[],"summary":"Read published workspace jobs","description":"Read published jobs. MCP binds this public operation to its connected workspace; action publicGet also needs slug.","parameters":[{"in":"query","name":"org","schema":{"type":"string","default":"blackleaf"}},{"in":"query","name":"action","schema":{"type":"string","enum":["publicList","publicGet"]}},{"in":"query","name":"slug","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"Published jobs only."}},"x-blackleaf-mcp":{"name":"api_get_careers","scope":"api:api_get_careers"}},"post":{"security":[],"summary":"Submit a job application","description":"Submit a JSON application for a published job. MCP binds this public operation to its connected workspace. Roles requiring a PDF resume use the existing multipart HTTP application form. Resume uploads and resume autofill remain HTTP-only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action","roleId","requestId","name","email"],"properties":{"org":{"type":"string","default":"blackleaf"},"action":{"type":"string","enum":["apply"]},"roleId":{"type":"string","maxLength":100},"requestId":{"type":"string","maxLength":100},"name":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":254},"phone":{"type":"string","maxLength":50},"location":{"type":"string","maxLength":300},"linkedin":{"type":"string","maxLength":1000},"portfolio":{"type":"string","maxLength":1000},"answers":{"type":"object","additionalProperties":{"type":"string","maxLength":10000}}}}}}},"responses":{"200":{"description":"Application received."}},"x-blackleaf-mcp":{"name":"api_post_careers","scope":"api:api_post_careers","httpOnlyVariants":"PDF resume upload and resume autofill require the existing multipart HTTP form."}}},"/analytics/reports":{"get":{"tags":["Analytics"],"summary":"Get reports for your organization or location","description":"Retrieve reports for your organization or a specific location. Matching entries are combined and their numeric metrics totaled. Without a specific period or date range, results start at today and go backward. Use nextCursor to retrieve additional results.","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","required":true,"name":"keyType","description":"Reporting interval, such as hour, day, week, month, or year.","schema":{"type":"string","example":"day"}},{"in":"query","required":false,"name":"locationId","description":"Limit reports to a specific location. Omit for organization-wide reports.","schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","example":"example-location-id"}},{"in":"query","required":false,"name":"key","description":"A specific reporting period (YYYY-MM-DD for daily reports). Use keyFrom and keyTo for a range, or omit all three to start at today.","schema":{"type":"string","example":"2026-10-08"}},{"in":"query","required":false,"name":"subKey","description":"Exact entity key. Defaults to top when omitted.","schema":{"type":"string","default":"top","example":"top"}},{"in":"query","required":false,"name":"subKeyType","description":"Exact entity type, such as top, product, customer, employee, or location. Defaults to top when omitted.","schema":{"type":"string","default":"top","example":"top"}},{"in":"query","required":false,"name":"keyFrom","description":"First reporting period to include in a range.","schema":{"type":"string","example":"2025-02-01"}},{"in":"query","required":false,"name":"keyTo","description":"Last reporting period to include in a range.","schema":{"type":"string","example":"2025-02-28"}},{"in":"query","required":false,"name":"pageSize","description":"Maximum number of combined report results per page.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"in":"query","required":false,"name":"sort","description":"Order reporting periods from newest to oldest (desc) or oldest to newest (asc).","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"in":"query","required":false,"name":"cursor","description":"Use nextCursor from the previous response with the same filters, location and sort. Omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Report results and pagination details. nextCursor is null when there are no more results.","content":{"application/json":{"schema":{"type":"object","required":["items","pageSize","hasMoreItems","nextCursor"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"pageSize":{"type":"integer"},"hasMoreItems":{"type":"boolean"},"nextCursor":{"type":"string","nullable":true}}}}}},"400":{"description":"Invalid filter, page size, sort, or cursor; unknown parameters (including org and page) are rejected."},"401":{"description":"Bearer authentication required."},"403":{"description":"Invalid authenticated organization."},"503":{"description":"Reports are temporarily unavailable. Please try again later."},"504":{"description":"The request took too long. Narrow your filters and try again."}},"x-blackleaf-mcp":{"name":"api_get_analytics_reports","scope":"api:api_get_analytics_reports"}}},"/analytics/summary/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Analytics"],"summary":"Get a summary of account activity","description":"Retrieves a list of account activity with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_analytics","scope":"api:api_get_analytics"}}},"/analytics/messaging/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Analytics","Messaging"],"summary":"Get a summary of messaging activity","description":"Retrieves a list of messaging activity with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}}}},"/analytics/orders/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Analytics"],"summary":"Get a summary of order activity","description":"Retrieves a list of order activity with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}}}},"/analytics/inventory/report-card/":{"get":{"security":[{"BearerAuth":[]}],"tags":["Analytics"],"summary":"Get a report card grading your inventory","description":"Report card with detail on where to improve. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}}}},"/automation/{_id}/invoke":{"post":{"security":[{"BearerAuth":[]}],"tags":["Automations"],"summary":"Invoke automation","description":"Start automation.","parameters":[{"in":"path","name":"_id","example":"12345","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","example":{"customerId":"12345","phone":"555-555-5555","firstName":"Some","lastName":"One"},"default":""},"payload":{"type":"object","example":{},"default":""}}},"required":["_id","contact"]}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Started.","example":"Started"}}}}}}},"x-blackleaf-mcp":{"name":"api_post_automation_by_id_invoke","scope":"api:api_post_automation_by_id_invoke"}}},"/campaign/{_id}/add":{"post":{"tags":["Campaigns"],"summary":"add","description":"Add an existing, eligible contact to an unscheduled campaign draft. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"phone","required":true,"schema":{"type":"string","example":"2025550101"},"description":"One customer or test recipient phone number."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_add","scope":"api:api_post_campaign_by_id_add"}}},"/campaign/{_id}/remove":{"post":{"tags":["Campaigns"],"summary":"remove","description":"Exclude a contact from an unscheduled campaign draft. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"phone","required":true,"schema":{"type":"string","example":"2025550101"},"description":"One customer or test recipient phone number."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_remove","scope":"api:api_post_campaign_by_id_remove"}}},"/campaign/{_id}/add-list":{"post":{"tags":["Campaigns"],"summary":"add-list","description":"Add eligible contacts matching a saved list to an unscheduled campaign draft. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Saved list identifier from this workspace."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_add_list","scope":"api:api_post_campaign_by_id_add_list"}}},"/campaign/{_id}/remove-list":{"post":{"tags":["Campaigns"],"summary":"remove-list","description":"Exclude contacts matching a saved list from an unscheduled campaign draft. The saved list is unchanged. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"listId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Saved list identifier from this workspace."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_remove_list","scope":"api:api_post_campaign_by_id_remove_list"}}},"/campaign/{_id}/send-test":{"post":{"tags":["Campaigns"],"summary":"send-test","description":"Send the saved SMS campaign to one phone number with a [TEST] marker. Opt-outs and account balance are checked. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."},{"in":"query","name":"phone","required":true,"schema":{"type":"string","example":"2025550101"},"description":"One customer or test recipient phone number."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_send_test","scope":"api:api_post_campaign_by_id_send_test"}}},"/campaign/{_id}/send":{"post":{"tags":["Campaigns"],"summary":"send","description":"Start a campaign through its usual launch checks. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_send","scope":"api:api_post_campaign_by_id_send"}}},"/campaign/{_id}/pause":{"post":{"tags":["Campaigns"],"summary":"pause","description":"Pause campaign delivery. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_pause","scope":"api:api_post_campaign_by_id_pause"}}},"/campaign/{_id}/cancel":{"post":{"tags":["Campaigns"],"summary":"cancel","description":"Cancel campaign delivery. Use POST with a workspace Bearer API key. Returns a queued request; follow statusUrl to check completion.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"},"description":"Campaign identifier."}],"responses":{"202":{"description":"Action queued. The response includes status, requestId and statusUrl."},"400":{"description":"Invalid action parameters."},"401":{"description":"Authentication required."},"404":{"description":"Campaign or list not found in this workspace."},"409":{"description":"Campaign is not an editable draft."}},"x-blackleaf-mcp":{"name":"api_post_campaign_by_id_cancel","scope":"api:api_post_campaign_by_id_cancel"}}},"/campaign/{_id}/requests/{requestId}":{"get":{"tags":["Campaigns"],"summary":"Check a campaign action","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"_id","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"}},{"in":"path","name":"requestId","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","example":"000000000000000000000001"}}],"description":"completed means the command was processed. Campaign review and message delivery can continue afterward. A processing request interrupted by a server restart needs review before retrying a send.","responses":{"200":{"description":"Request status: queued, processing, completed or failed."},"404":{"description":"Request not found in this workspace."}},"x-blackleaf-mcp":{"name":"api_get_campaign_by_id_requests_by_requestid","scope":"api:api_get_campaign_by_id_requests_by_requestid"}}},"/campaign":{"get":{"security":[{"BearerAuth":[]}],"tags":["Campaigns"],"summary":"List of campaigns","description":"Retrieves a list of campaigns with pagination. Optionally filter by campaignType, _id, or both. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"_id","schema":{"type":"string","default":""},"required":false,"description":"Filter by an exact campaign identifier."},{"in":"query","name":"campaignType","schema":{"type":"string","default":""},"required":false,"description":"Filter by an exact campaign type, such as one-time, repeating, or trigger."},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"desc","default":"desc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"000000000000000000000001"},"body":{"type":"string","example":"Enjoy 40% OFF your entire order—today through the weekend! Use code SAVE40 at checkout. Don’t miss out!\n\nhttps://example.com"},"image":{"type":"string","example":"https://example.com/example-image.jpg"},"totalList":{"type":"number","example":10313},"messagesSent":{"type":"number","example":10062},"optedOut":{"type":"number","example":181},"outboundMessages":{"type":"number","example":10061},"accepted":{"type":"number","example":9724},"delivered":{"type":"number","example":9341},"failed":{"type":"number","example":658},"expired":{"type":"number","example":0},"paused":{"type":"number","example":0},"errored":{"type":"number","example":0},"undelivered":{"type":"number","example":63},"cost":{"type":"number","example":503.05},"linkClicks":{"type":"number","example":0},"campaignType":{"type":"string","example":"one-time"},"channelName":{"type":"string","example":"Example Channel"},"criteria":{"type":"string","example":"{\"$and\":[{\"nothing\":{\"$eq\":\"\"}},{\"$or\":[{\"tags.importFile.example_tag\":{\"$ne\":null}}]}]}"},"dateCreated":{"type":"string","example":"2024-11-22T16:37:33.132Z"},"dateModified":{"type":"string","example":"2024-11-25T08:16:14.934Z"},"elapsedTime":{"type":"number","example":5549976},"enabled":{"type":"boolean","example":true},"exclusions":{"type":"string","example":""},"fromAddress":{"type":"string","example":""},"fromName":{"type":"string","example":""},"group":{"type":"string","example":"example-group-id"},"groupName":{"type":"string","example":"Example Sender Group"},"hash":{"type":"string","example":"example-hash"},"optOutMessage":{"type":"string","example":"Reply STOP to UNSUBSCRIBE"},"org":{"type":"string","example":"example-org-id"},"processedBody":{"type":"string","example":"Enjoy 40% OFF your entire order—today through the weekend! Use code SAVE40 at checkout. Don't miss out!\n\nhttps://example.com\n\nReply STOP to UNSUBSCRIBE"},"repeatEnabled":{"type":"boolean","example":false},"repeatSchedule":{"type":"string","example":"0 0 * * * *"},"runEnded":{"type":"number","example":0},"runStarted":{"type":"number","example":1732293499064},"scheduleDate":{"type":"number","example":1732291200000},"shortener":{"type":"string","example":""},"status":{"type":"string","example":"stopped"},"subject":{"type":"string","example":""},"trackLink":{"type":"boolean","example":false},"transactions":{"type":"number","example":0},"webBody":{"type":"string","example":""},"dateStart":{"type":"string","example":"2024-11-22T16:37:34.200Z"},"lastMessageSentDate":{"type":"number","example":1732296459700},"lastMessageStatusDate":{"type":"number","example":1732296571932},"lastPhoneNumber":{"type":"string","example":"555-555-5555"}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_campaign","scope":"api:api_get_campaign"}}},"/contact":{"get":{"security":[{"BearerAuth":[]}],"tags":["Contacts"],"summary":"Get a list of contacts","description":"Retrieves a list of contacts with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_contact","scope":"api:api_get_contact"}}},"/products":{"get":{"security":[{"BearerAuth":[]}],"tags":["Products"],"summary":"Get a list of products","description":"Retrieves a list of contacts with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_products","scope":"api:api_get_products"}}},"/products/{id}":{"get":{"security":[{"BearerAuth":[]}],"tags":["Products"],"summary":"Get a product","description":"Retrieves a product. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"productId","schema":{"type":"string","default":""},"required":false}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"searchParameter":true,"exampleValue":"12345","required":false,"requestParameter":true,"in":"path"}}}}}}},"x-blackleaf-mcp":{"name":"api_get_products_by_id","scope":"api:api_get_products_by_id"}}},"/orders":{"get":{"security":[{"BearerAuth":[]}],"tags":["Orders"],"summary":"Get a list of orders","description":"Retrieves a list of contacts with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_orders","scope":"api:api_get_orders"}}},"/orders/{id}":{"get":{"security":[{"BearerAuth":[]}],"tags":["Orders"],"summary":"Get a order","description":"Retrieves an order. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"path","name":"orderId","schema":{"type":"string","default":""},"required":false}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"searchParameter":true,"exampleValue":"12345","required":false,"requestParameter":true,"in":"path"}}}}}}},"x-blackleaf-mcp":{"name":"api_get_orders_by_id","scope":"api:api_get_orders_by_id"}}},"/careers":{"get":{"security":[],"summary":"Read published workspace jobs","description":"Read published jobs. MCP binds this public operation to its connected workspace; action publicGet also needs slug.","parameters":[{"in":"query","name":"org","schema":{"type":"string","default":"blackleaf"}},{"in":"query","name":"action","schema":{"type":"string","enum":["publicList","publicGet"]}},{"in":"query","name":"slug","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"Published jobs only."}},"x-blackleaf-mcp":{"name":"api_get_careers","scope":"api:api_get_careers"}},"post":{"security":[],"summary":"Submit a job application","description":"Submit a JSON application for a published job. MCP binds this public operation to its connected workspace. Roles requiring a PDF resume use the existing multipart HTTP application form. Resume uploads and resume autofill remain HTTP-only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action","roleId","requestId","name","email"],"properties":{"org":{"type":"string","default":"blackleaf"},"action":{"type":"string","enum":["apply"]},"roleId":{"type":"string","maxLength":100},"requestId":{"type":"string","maxLength":100},"name":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":254},"phone":{"type":"string","maxLength":50},"location":{"type":"string","maxLength":300},"linkedin":{"type":"string","maxLength":1000},"portfolio":{"type":"string","maxLength":1000},"answers":{"type":"object","additionalProperties":{"type":"string","maxLength":10000}}}}}}},"responses":{"200":{"description":"Application received."}},"x-blackleaf-mcp":{"name":"api_post_careers","scope":"api:api_post_careers","httpOnlyVariants":"PDF resume upload and resume autofill require the existing multipart HTTP form."}}},"/analytics":{"get":{"security":[{"BearerAuth":[]}],"tags":["Analytics"],"summary":"Get a summary of account activity","description":"Retrieves a list of account activity with pagination. Requires an `Authorization` header with a Bearer token.","parameters":[{"in":"query","name":"customerId","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"phone","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"email","schema":{"type":"string","default":""},"required":false},{"in":"query","name":"unsubscribed","schema":{"type":"boolean","default":""},"required":false},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"description":"The number of items to return per page (1-1000)."},{"in":"query","name":"page","schema":{"type":"integer","minimum":0,"default":0},"required":false,"description":"The page number to retrieve."},{"in":"query","name":"lastModified","schema":{"type":"string","format":"date-time","example":""},"required":false,"description":"Filter results to include only items modified after this UTC timestamp. Must be in ISO 8601 format (eg: 2024-11-24T18:30:00Z)"},{"in":"query","name":"sort","schema":{"type":"string","example":"asc","enum":["asc","desc"]},"required":false,"description":"Sort based on last modified date"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","example":"example-id"},"customerId":{"type":"string","example":"example-customer-id"},"displayName":{"type":"string","example":"John Doe"},"phone":{"type":"string","example":"555-123-4567"},"email":{"type":"string","example":""},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"dob":{"type":"string","example":"2000-01-01T00:00:00.000"},"gender":{"type":"string","example":"M"},"address":{"type":"string","example":"123 Example St"},"city":{"type":"string","example":"Example City"},"state":{"type":"string","example":"CA"},"zip":{"type":"string","example":"12345"},"optOut":{"displayAs":"unsubscribed","exampleValue":false,"defaultValue":false,"alwaysInclude":true,"required":false,"requestParameter":true,"searchParameter":true},"spenderAnnual":{"type":"string","example":"top"},"spenderPerVisit":{"type":"string","example":"top"},"points":{"type":"number","example":150},"lifetimePoints":{"type":"number","example":150},"spendLastYear":{"type":"number","example":1000.27},"spendLifetime":{"type":"number","example":1500.3},"costLastYear":{"type":"number","example":500.43},"costLifetime":{"type":"number","example":520},"transactionsLastYear":{"type":"number","example":50},"transactionsLifetime":{"type":"number","example":70},"firstTransaction":{"type":"string","example":"2024-04-30T02:17:16.119Z"},"lastTransaction":{"type":"string","example":"2024-11-25T05:45:37.067Z"},"consumerType":{"type":"string","example":"AdultUse"},"lastMessageStatus":{"type":"string","example":"delivered"},"lastMessageBody":{"type":"string","example":"Your code is 12345."},"lastMessageDate":{"type":"string","example":"2024-06-24T00:05:28.239Z"},"sent":{"exampleValue":1,"required":false,"requestParameter":false,"displayAs":"messagesSent"},"profile":{"type":"object","example":{"recent":{"transactions":50,"total":1000.5,"daysBetweenVisits":3,"categories":["preroll","edible"],"brands":["Brand A","Brand B"],"subCategories":["infused","tincture"],"classifications":["indica","sativa"]}}},"dateModified":{"type":"string","example":"2024-11-25T05:46:29.779Z"},"unsubscribed":{"type":"boolean","example":false},"messagesSent":{"type":"number","example":1}}}},"page":{"type":"integer","description":"The current page.","example":1},"pageSize":{"type":"integer","description":"The amount of items returned per page.","example":100},"totalItems":{"type":"integer","description":"The total amount of items matching this criteria.","example":100000},"hasMoreItems":{"type":"boolean","description":"There are more items after this page.","example":true}}}}}}},"x-blackleaf-mcp":{"name":"api_get_analytics","scope":"api:api_get_analytics"}}}},"tags":[],"x-blackleaf-mcp-operations":[{"name":"api_post_messaging_create_template","method":"POST","path":"/messaging/create/template","scope":"api:api_post_messaging_create_template","summary":"Create a text message template"},{"name":"api_post_messaging_send_text","method":"POST","path":"/messaging/send/text","scope":"api:api_post_messaging_send_text","summary":"Send a Text Message (SMS, MMS)"},{"name":"api_post_messaging_send_2fa","method":"POST","path":"/messaging/send/2fa","scope":"api:api_post_messaging_send_2fa","summary":"Send a 2FA code to a phone number"},{"name":"api_post_messaging_verify_2fa","method":"POST","path":"/messaging/verify/2fa","scope":"api:api_post_messaging_verify_2fa","summary":"Verify a 2FA code"},{"name":"api_get_messaging_messages","method":"GET","path":"/messaging/messages","scope":"api:api_get_messaging_messages","summary":"List of messages"},{"name":"api_get_messaging_senders_profiles","method":"GET","path":"/messaging/senders/profiles","scope":"api:api_get_messaging_senders_profiles","summary":"Get a list of message sender profiles"},{"name":"api_post_automation_by_id_invoke","method":"POST","path":"/automation/{_id}/invoke","scope":"api:api_post_automation_by_id_invoke","summary":"Invoke automation"},{"name":"api_post_campaign_by_id_add","method":"POST","path":"/campaign/{_id}/add","scope":"api:api_post_campaign_by_id_add","summary":"add"},{"name":"api_post_campaign_by_id_remove","method":"POST","path":"/campaign/{_id}/remove","scope":"api:api_post_campaign_by_id_remove","summary":"remove"},{"name":"api_post_campaign_by_id_add_list","method":"POST","path":"/campaign/{_id}/add-list","scope":"api:api_post_campaign_by_id_add_list","summary":"add-list"},{"name":"api_post_campaign_by_id_remove_list","method":"POST","path":"/campaign/{_id}/remove-list","scope":"api:api_post_campaign_by_id_remove_list","summary":"remove-list"},{"name":"api_post_campaign_by_id_send_test","method":"POST","path":"/campaign/{_id}/send-test","scope":"api:api_post_campaign_by_id_send_test","summary":"send-test"},{"name":"api_post_campaign_by_id_send","method":"POST","path":"/campaign/{_id}/send","scope":"api:api_post_campaign_by_id_send","summary":"send"},{"name":"api_post_campaign_by_id_pause","method":"POST","path":"/campaign/{_id}/pause","scope":"api:api_post_campaign_by_id_pause","summary":"pause"},{"name":"api_post_campaign_by_id_cancel","method":"POST","path":"/campaign/{_id}/cancel","scope":"api:api_post_campaign_by_id_cancel","summary":"cancel"},{"name":"api_post_campaign_contact_add","method":"POST","path":"/campaign/contact/add","scope":"api:api_post_campaign_contact_add","summary":"Add an existing, eligible contact to an unscheduled campaign draft."},{"name":"api_post_campaign_contact_remove","method":"POST","path":"/campaign/contact/remove","scope":"api:api_post_campaign_contact_remove","summary":"Exclude a contact from an unscheduled campaign draft."},{"name":"api_get_campaign_by_id_requests_by_requestid","method":"GET","path":"/campaign/{_id}/requests/{requestId}","scope":"api:api_get_campaign_by_id_requests_by_requestid","summary":"Check a campaign action"},{"name":"api_get_campaign","method":"GET","path":"/campaign","scope":"api:api_get_campaign","summary":"List of campaigns"},{"name":"api_post_campaign_set","method":"POST","path":"/campaign/set","scope":"api:api_post_campaign_set","summary":"Create or Modify a campaign"},{"name":"api_get_contact","method":"GET","path":"/contact","scope":"api:api_get_contact","summary":"Get a list of contacts"},{"name":"api_get_contact_by_phone","method":"GET","path":"/contact/{phone}","scope":"api:api_get_contact_by_phone","summary":"Get a contact"},{"name":"api_post_contact_set","method":"POST","path":"/contact/set","scope":"api:api_post_contact_set","summary":"Create or Modify a contact"},{"name":"api_post_contact_by_phone_subscribe","method":"POST","path":"/contact/{phone}/subscribe","scope":"api:api_post_contact_by_phone_subscribe","summary":"Subscribe a contact to receive messages"},{"name":"api_post_contact_by_phone_unsubscribe","method":"POST","path":"/contact/{phone}/unsubscribe","scope":"api:api_post_contact_by_phone_unsubscribe","summary":"Unsubscribe a contact from receiving messages"},{"name":"api_post_contact_by_phone_points","method":"POST","path":"/contact/{phone}/points","scope":"api:api_post_contact_by_phone_points","summary":"Add/Remove Contact Rewards Points"},{"name":"api_get_list","method":"GET","path":"/list","scope":"api:api_get_list","summary":"Get saved lists"},{"name":"api_post_list","method":"POST","path":"/list","scope":"api:api_post_list","summary":"Create a saved list"},{"name":"api_get_list_by_listid","method":"GET","path":"/list/{listId}","scope":"api:api_get_list_by_listid","summary":"Get a saved list"},{"name":"api_get_list_by_listid_phones","method":"GET","path":"/list/{listId}/phones","scope":"api:api_get_list_by_listid_phones","summary":"Get list phones"},{"name":"api_post_list_by_listid_phones_add","method":"POST","path":"/list/{listId}/phones/add","scope":"api:api_post_list_by_listid_phones_add","summary":"Add phones to a list"},{"name":"api_post_list_by_listid_phones_remove","method":"POST","path":"/list/{listId}/phones/remove","scope":"api:api_post_list_by_listid_phones_remove","summary":"Remove phones from a list"},{"name":"api_get_products","method":"GET","path":"/products","scope":"api:api_get_products","summary":"Get a list of products"},{"name":"api_get_products_by_id","method":"GET","path":"/products/{id}","scope":"api:api_get_products_by_id","summary":"Get a product"},{"name":"api_get_orders","method":"GET","path":"/orders","scope":"api:api_get_orders","summary":"Get a list of orders"},{"name":"api_get_orders_by_id","method":"GET","path":"/orders/{id}","scope":"api:api_get_orders_by_id","summary":"Get a order"},{"name":"api_get_account_balance","method":"GET","path":"/account/balance","scope":"api:api_get_account_balance","summary":"Get Account Balance"},{"name":"api_get_careers","method":"GET","path":"/careers","scope":"api:api_get_careers","summary":"Read published workspace jobs"},{"name":"api_post_careers","method":"POST","path":"/careers","scope":"api:api_post_careers","summary":"Submit a job application"},{"name":"api_get_analytics_reports","method":"GET","path":"/analytics/reports","scope":"api:api_get_analytics_reports","summary":"Get reports for your organization or location"},{"name":"api_get_analytics","method":"GET","path":"/analytics","scope":"api:api_get_analytics","summary":"Get a summary of account activity"}]}