> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.getkard.com/2024-10-01/api/organizations/content-strategies/create/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getkard.com/_mcp/server. # Create POST https://rewards-api.getkard.com/v2/issuers/{organizationId}/contentStrategies Content-Type: application/json Create a content strategy for the organization. The strategy name must be unique within the organization. Reference: https://docs.getkard.com/api/organizations/content-strategies/create ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://rewards-api.getkard.com` (Production, default) - `https://test-rewards-api.getkard.com` (Sandbox) ## Request ### Path parameters - `organizationId` (string, required) — Unique identifier of the organization ### Body (application/json) This endpoint expects a CreateContentStrategyRequestBody. - `data` (CreateContentStrategyRequestData, required) — Content strategy data for creation ## Response ### 201 Created content strategy resource - `type` ("contentStrategy", required) - `id` (string, required) — Unique identifier of the content strategy (UUID v7) - `attributes` (ContentStrategyAttributes, required) — Attributes for a content strategy ## Errors ### 401 Unauthorized Error - `errors` (list of ErrorObject, required) ### 403 Forbidden Error - `errors` (list of ErrorObject, required) ### 400 Invalid Request - `errors` (list of ErrorObject, required) ### 409 Conflict Error - `errors` (list of ErrorObject, required) ### 404 Does Not Exist Error - `errors` (list of ErrorObject, required) ### 500 Internal Server Error - `errors` (list of ErrorObject, required) ## Types ### CreateContentStrategyRequestData Content strategy data structure for creation - `type` ("contentStrategy", required) — Resource type identifier - `attributes` (CreateContentStrategyAttributes, required) — Content strategy attributes for creation ### ContentStrategyAttributes Attributes for a content strategy - `name` (string, required) — Name of the content strategy (unique within an organization) - `organizationId` (string, required) — ID of the organization this content strategy belongs to - `filters` (ContentStrategyFilters, required) — Filters applied when selecting offers for the strategy - `categories` (list of enum, required) — Merchant categories to include - Allowed values: `Arts & Entertainment`, `Baby, Kids & Toys`, `Books & Digital Media`, `Clothing, Shoes & Accessories`, `Computers, Electronics & Software`, `Convenience`, `Gas`, `Department Stores`, `Food & Beverage`, `Health & Beauty`, `Home & Garden`, `Miscellaneous`, `Occasions & Gifts`, `Pets`, `Sports & Outdoors`, `Supplies & Services`, `Travel` - `categoryExclusions` (list of enum, required) — Merchant categories to exclude - Allowed values: `Arts & Entertainment`, `Baby, Kids & Toys`, `Books & Digital Media`, `Clothing, Shoes & Accessories`, `Computers, Electronics & Software`, `Convenience`, `Gas`, `Department Stores`, `Food & Beverage`, `Health & Beauty`, `Home & Garden`, `Miscellaneous`, `Occasions & Gifts`, `Pets`, `Sports & Outdoors`, `Supplies & Services`, `Travel` - `merchantExclusions` (list of string, required) — Merchant IDs to exclude - `sort` (enum, optional) — Sort applied when selecting offers for the strategy - Allowed values: `NEWLY_LIVE`, `EXPIRING_SOON`, `HIGHEST_CASHBACK`, `PERSONALIZED`, `OFFERS_NEAR_YOU` ### ErrorObject - `status` (string, required) — Status code returned from the request - `title` (string, required) — Name of error - `detail` (string, required) — Description of the specific occurance of the error - `source` (ErrorSource, optional) — An object containing a reference to the primary source of the error - `id` (string, optional) — The id of the resource which caused the error. Always returned for multi-status errors. ### CreateContentStrategyAttributes Attributes for creating a content strategy - `name` (string, required) — Name of the content strategy (unique within an organization) - `filters` (ContentStrategyFilters, required) — Filters applied when selecting offers for the strategy - `categories` (list of enum, required) — Merchant categories to include - Allowed values: `Arts & Entertainment`, `Baby, Kids & Toys`, `Books & Digital Media`, `Clothing, Shoes & Accessories`, `Computers, Electronics & Software`, `Convenience`, `Gas`, `Department Stores`, `Food & Beverage`, `Health & Beauty`, `Home & Garden`, `Miscellaneous`, `Occasions & Gifts`, `Pets`, `Sports & Outdoors`, `Supplies & Services`, `Travel` - `categoryExclusions` (list of enum, required) — Merchant categories to exclude - Allowed values: `Arts & Entertainment`, `Baby, Kids & Toys`, `Books & Digital Media`, `Clothing, Shoes & Accessories`, `Computers, Electronics & Software`, `Convenience`, `Gas`, `Department Stores`, `Food & Beverage`, `Health & Beauty`, `Home & Garden`, `Miscellaneous`, `Occasions & Gifts`, `Pets`, `Sports & Outdoors`, `Supplies & Services`, `Travel` - `merchantExclusions` (list of string, required) — Merchant IDs to exclude - `sort` (enum, optional) — Sort applied when selecting offers for the strategy - Allowed values: `NEWLY_LIVE`, `EXPIRING_SOON`, `HIGHEST_CASHBACK`, `PERSONALIZED`, `OFFERS_NEAR_YOU` ### ContentStrategyFilters Filters applied when selecting offers for a content strategy - `categories` (list of string, optional) — Merchant categories to include - `categoryExclusions` (list of string, optional) — Merchant categories to exclude - `merchantExclusions` (list of string, optional) — Merchant IDs to exclude - `offerFeatures` (list of enum, optional) — Offer features to filter by - Allowed values: `INTERACTIVE` ### ErrorSource - `pointer` (string, optional) — A JSON pointer to the value in the request document that caused the error - `parameter` (string, optional) — A string indicating which URI query parameter caused the error - `header` (string, optional) — A string indicating the name of a single request header which caused the error ## Examples **Request** ```json { "data": { "type": "contentStrategy", "attributes": { "name": "Featured Travel", "filters": { "offerFeatures": [ "INTERACTIVE" ] }, "categories": [ "Travel" ], "categoryExclusions": [ "Gas" ], "merchantExclusions": [ "merchant-abc" ], "sort": "HIGHEST_CASHBACK" } } } ``` **Response** ```json { "type": "contentStrategy", "id": "01961e5a-b74c-7d42-8456-d3a1f2c90e71", "attributes": { "name": "Featured Travel", "organizationId": "org-123", "filters": { "offerFeatures": [ "INTERACTIVE" ] }, "categories": [ "Travel" ], "categoryExclusions": [ "Gas" ], "merchantExclusions": [ "merchant-abc" ], "sort": "HIGHEST_CASHBACK" } } ``` **SDK Code** ```python Create Content Strategy import requests url = "https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies" payload = { "data": { "type": "contentStrategy", "attributes": { "name": "Featured Travel", "filters": { "offerFeatures": ["INTERACTIVE"] }, "categories": ["Travel"], "categoryExclusions": ["Gas"], "merchantExclusions": ["merchant-abc"], "sort": "HIGHEST_CASHBACK" } } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Create Content Strategy const url = 'https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"data":{"type":"contentStrategy","attributes":{"name":"Featured Travel","filters":{"offerFeatures":["INTERACTIVE"]},"categories":["Travel"],"categoryExclusions":["Gas"],"merchantExclusions":["merchant-abc"],"sort":"HIGHEST_CASHBACK"}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Create Content Strategy package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies" payload := strings.NewReader("{\n \"data\": {\n \"type\": \"contentStrategy\",\n \"attributes\": {\n \"name\": \"Featured Travel\",\n \"filters\": {\n \"offerFeatures\": [\n \"INTERACTIVE\"\n ]\n },\n \"categories\": [\n \"Travel\"\n ],\n \"categoryExclusions\": [\n \"Gas\"\n ],\n \"merchantExclusions\": [\n \"merchant-abc\"\n ],\n \"sort\": \"HIGHEST_CASHBACK\"\n }\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Create Content Strategy require 'uri' require 'net/http' url = URI("https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"data\": {\n \"type\": \"contentStrategy\",\n \"attributes\": {\n \"name\": \"Featured Travel\",\n \"filters\": {\n \"offerFeatures\": [\n \"INTERACTIVE\"\n ]\n },\n \"categories\": [\n \"Travel\"\n ],\n \"categoryExclusions\": [\n \"Gas\"\n ],\n \"merchantExclusions\": [\n \"merchant-abc\"\n ],\n \"sort\": \"HIGHEST_CASHBACK\"\n }\n }\n}" response = http.request(request) puts response.read_body ``` ```java Create Content Strategy import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"data\": {\n \"type\": \"contentStrategy\",\n \"attributes\": {\n \"name\": \"Featured Travel\",\n \"filters\": {\n \"offerFeatures\": [\n \"INTERACTIVE\"\n ]\n },\n \"categories\": [\n \"Travel\"\n ],\n \"categoryExclusions\": [\n \"Gas\"\n ],\n \"merchantExclusions\": [\n \"merchant-abc\"\n ],\n \"sort\": \"HIGHEST_CASHBACK\"\n }\n }\n}") .asString(); ``` ```php Create Content Strategy request('POST', 'https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies', [ 'body' => '{ "data": { "type": "contentStrategy", "attributes": { "name": "Featured Travel", "filters": { "offerFeatures": [ "INTERACTIVE" ] }, "categories": [ "Travel" ], "categoryExclusions": [ "Gas" ], "merchantExclusions": [ "merchant-abc" ], "sort": "HIGHEST_CASHBACK" } } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Create Content Strategy using RestSharp; var client = new RestClient("https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"data\": {\n \"type\": \"contentStrategy\",\n \"attributes\": {\n \"name\": \"Featured Travel\",\n \"filters\": {\n \"offerFeatures\": [\n \"INTERACTIVE\"\n ]\n },\n \"categories\": [\n \"Travel\"\n ],\n \"categoryExclusions\": [\n \"Gas\"\n ],\n \"merchantExclusions\": [\n \"merchant-abc\"\n ],\n \"sort\": \"HIGHEST_CASHBACK\"\n }\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Create Content Strategy import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["data": [ "type": "contentStrategy", "attributes": [ "name": "Featured Travel", "filters": ["offerFeatures": ["INTERACTIVE"]], "categories": ["Travel"], "categoryExclusions": ["Gas"], "merchantExclusions": ["merchant-abc"], "sort": "HIGHEST_CASHBACK" ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://rewards-api.getkard.com/v2/issuers/org-123/contentStrategies")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```