curl --request POST \
--url https://www.rainbrand.com/api/v1/brands/{id}/edits \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change": {
"kind": "instruction",
"instruction": "<string>"
},
"replacesEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"evidence": {
"sources": [],
"imageIds": []
}
}
'import requests
url = "https://www.rainbrand.com/api/v1/brands/{id}/edits"
payload = {
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change": {
"kind": "instruction",
"instruction": "<string>"
},
"replacesEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"evidence": {
"sources": [],
"imageIds": []
}
}
headers = {
"idempotency-key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
baseSkillId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
change: {kind: 'instruction', instruction: '<string>'},
replacesEditId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
evidence: {sources: [], imageIds: []}
})
};
fetch('https://www.rainbrand.com/api/v1/brands/{id}/edits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.rainbrand.com/api/v1/brands/{id}/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'baseSkillId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'change' => [
'kind' => 'instruction',
'instruction' => '<string>'
],
'replacesEditId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'evidence' => [
'sources' => [
],
'imageIds' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.rainbrand.com/api/v1/brands/{id}/edits"
payload := strings.NewReader("{\n \"baseSkillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change\": {\n \"kind\": \"instruction\",\n \"instruction\": \"<string>\"\n },\n \"replacesEditId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"evidence\": {\n \"sources\": [],\n \"imageIds\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.rainbrand.com/api/v1/brands/{id}/edits")
.header("idempotency-key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"baseSkillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change\": {\n \"kind\": \"instruction\",\n \"instruction\": \"<string>\"\n },\n \"replacesEditId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"evidence\": {\n \"sources\": [],\n \"imageIds\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.rainbrand.com/api/v1/brands/{id}/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"baseSkillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change\": {\n \"kind\": \"instruction\",\n \"instruction\": \"<string>\"\n },\n \"replacesEditId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"evidence\": {\n \"sources\": [],\n \"imageIds\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brandId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "preparing",
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": {
"skillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"changeSet": {
"schemaVersion": 2,
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"profileChanges": [
{
"kind": "field",
"path": "<string>",
"operation": "add",
"previous": "<string>",
"next": "<string>"
}
],
"markdownChanges": [
{
"path": "<string>",
"operation": "add",
"additions": 4503599627370495,
"deletions": 4503599627370495,
"hunks": [
{
"oldStart": 4503599627370495,
"oldLines": 4503599627370495,
"newStart": 4503599627370495,
"newLines": 4503599627370495,
"lines": [
{
"kind": "context",
"text": "<string>",
"noNewlineAtEndOfFile": true
}
]
}
],
"truncated": true
}
],
"assetChanges": [
{
"kind": "asset",
"role": "primary_logo",
"operation": "add",
"previousAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"targetProfile": {
"name": "<string>",
"primaryLogo": {
"imageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"colors": [
{
"hex": "<string>",
"name": "<string>",
"group": "<string>",
"usage": "<string>"
}
],
"gradients": [
{
"name": "<string>",
"angle": 1,
"stops": [
{
"hex": "<string>",
"position": 50
}
],
"usage": "<string>"
}
],
"typography": {
"roles": [
{
"name": "<string>",
"weight": 0,
"font": {
"source": "google",
"family": "<string>"
}
}
],
"heading": {
"source": "google",
"family": "<string>"
},
"body": {
"source": "google",
"family": "<string>"
}
}
},
"interaction": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subject": "<string>",
"prompt": "<string>",
"kind": "clarification",
"accepts": {
"text": {
"required": false,
"minLength": 1,
"maxLength": 10000
},
"images": {
"max": 0,
"min": 0
},
"sources": {
"max": 0,
"min": 0
}
}
},
"replacement": {
"replacesEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"replacedByEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discardReason": "explicit"
},
"changeSummary": "<string>",
"statusMessage": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "INVALID_INPUT",
"status": 400,
"message": "Invalid Brand Edit input",
"data": "<unknown>"
}
}{
"error": {
"code": "UNAUTHORIZED",
"status": 401,
"message": "Invalid or missing API credentials",
"data": "<unknown>"
}
}{
"error": {
"code": "INSUFFICIENT_CREDITS",
"status": 402,
"message": "Not enough credits to edit this brand",
"data": {
"action_url": "<string>",
"credits_required": 123,
"balance": 123,
"pricing_version": 0
}
}
}{
"error": {
"code": "ACCOUNT_BANNED",
"status": 403,
"message": "This account has been suspended.",
"data": "<unknown>"
}
}{
"error": {
"code": "BRAND_NOT_FOUND",
"status": 404,
"message": "Brand not found",
"data": "<unknown>"
}
}{
"error": {
"code": "BRAND_SKILL_UNAVAILABLE",
"status": 409,
"message": "Brand has no editable Skill",
"data": "<unknown>"
}
}{
"error": {
"code": "TOO_MANY_REQUESTS",
"status": 429,
"message": "Rate limit exceeded",
"data": "<unknown>"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"status": 500,
"message": "Failed to create Brand Edit",
"data": "<unknown>"
}
}Create a Brand Edit
Prepare proposed changes to a brand without changing its active guidance or profile. See Edit a brand to prepare, review, and apply changes.
curl --request POST \
--url https://www.rainbrand.com/api/v1/brands/{id}/edits \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change": {
"kind": "instruction",
"instruction": "<string>"
},
"replacesEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"evidence": {
"sources": [],
"imageIds": []
}
}
'import requests
url = "https://www.rainbrand.com/api/v1/brands/{id}/edits"
payload = {
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change": {
"kind": "instruction",
"instruction": "<string>"
},
"replacesEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"evidence": {
"sources": [],
"imageIds": []
}
}
headers = {
"idempotency-key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
baseSkillId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
change: {kind: 'instruction', instruction: '<string>'},
replacesEditId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
evidence: {sources: [], imageIds: []}
})
};
fetch('https://www.rainbrand.com/api/v1/brands/{id}/edits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.rainbrand.com/api/v1/brands/{id}/edits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'baseSkillId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'change' => [
'kind' => 'instruction',
'instruction' => '<string>'
],
'replacesEditId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'evidence' => [
'sources' => [
],
'imageIds' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.rainbrand.com/api/v1/brands/{id}/edits"
payload := strings.NewReader("{\n \"baseSkillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change\": {\n \"kind\": \"instruction\",\n \"instruction\": \"<string>\"\n },\n \"replacesEditId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"evidence\": {\n \"sources\": [],\n \"imageIds\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.rainbrand.com/api/v1/brands/{id}/edits")
.header("idempotency-key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"baseSkillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change\": {\n \"kind\": \"instruction\",\n \"instruction\": \"<string>\"\n },\n \"replacesEditId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"evidence\": {\n \"sources\": [],\n \"imageIds\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.rainbrand.com/api/v1/brands/{id}/edits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"baseSkillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change\": {\n \"kind\": \"instruction\",\n \"instruction\": \"<string>\"\n },\n \"replacesEditId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"evidence\": {\n \"sources\": [],\n \"imageIds\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brandId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "preparing",
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target": {
"skillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"changeSet": {
"schemaVersion": 2,
"baseSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetSkillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"profileChanges": [
{
"kind": "field",
"path": "<string>",
"operation": "add",
"previous": "<string>",
"next": "<string>"
}
],
"markdownChanges": [
{
"path": "<string>",
"operation": "add",
"additions": 4503599627370495,
"deletions": 4503599627370495,
"hunks": [
{
"oldStart": 4503599627370495,
"oldLines": 4503599627370495,
"newStart": 4503599627370495,
"newLines": 4503599627370495,
"lines": [
{
"kind": "context",
"text": "<string>",
"noNewlineAtEndOfFile": true
}
]
}
],
"truncated": true
}
],
"assetChanges": [
{
"kind": "asset",
"role": "primary_logo",
"operation": "add",
"previousAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
},
"targetProfile": {
"name": "<string>",
"primaryLogo": {
"imageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"colors": [
{
"hex": "<string>",
"name": "<string>",
"group": "<string>",
"usage": "<string>"
}
],
"gradients": [
{
"name": "<string>",
"angle": 1,
"stops": [
{
"hex": "<string>",
"position": 50
}
],
"usage": "<string>"
}
],
"typography": {
"roles": [
{
"name": "<string>",
"weight": 0,
"font": {
"source": "google",
"family": "<string>"
}
}
],
"heading": {
"source": "google",
"family": "<string>"
},
"body": {
"source": "google",
"family": "<string>"
}
}
},
"interaction": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subject": "<string>",
"prompt": "<string>",
"kind": "clarification",
"accepts": {
"text": {
"required": false,
"minLength": 1,
"maxLength": 10000
},
"images": {
"max": 0,
"min": 0
},
"sources": {
"max": 0,
"min": 0
}
}
},
"replacement": {
"replacesEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"replacedByEditId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discardReason": "explicit"
},
"changeSummary": "<string>",
"statusMessage": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "INVALID_INPUT",
"status": 400,
"message": "Invalid Brand Edit input",
"data": "<unknown>"
}
}{
"error": {
"code": "UNAUTHORIZED",
"status": 401,
"message": "Invalid or missing API credentials",
"data": "<unknown>"
}
}{
"error": {
"code": "INSUFFICIENT_CREDITS",
"status": 402,
"message": "Not enough credits to edit this brand",
"data": {
"action_url": "<string>",
"credits_required": 123,
"balance": 123,
"pricing_version": 0
}
}
}{
"error": {
"code": "ACCOUNT_BANNED",
"status": 403,
"message": "This account has been suspended.",
"data": "<unknown>"
}
}{
"error": {
"code": "BRAND_NOT_FOUND",
"status": 404,
"message": "Brand not found",
"data": "<unknown>"
}
}{
"error": {
"code": "BRAND_SKILL_UNAVAILABLE",
"status": 409,
"message": "Brand has no editable Skill",
"data": "<unknown>"
}
}{
"error": {
"code": "TOO_MANY_REQUESTS",
"status": 429,
"message": "Rate limit exceeded",
"data": "<unknown>"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"status": 500,
"message": "Failed to create Brand Edit",
"data": "<unknown>"
}
}Authorizations
Rainbrand API key, for example x-api-key: bloom_sk_....
Headers
A unique key for this operation. Reuse it when retrying the same request.
1 - 255Path Parameters
Brand ID
Body
The active Brand Skill version on which this edit is based.
The requested change: an instruction for a semantic edit, or exact profile values with an optional related instruction.
- Option 1
- Option 2
Show child attributes
Show child attributes
A candidate awaiting approval to replace atomically once the new candidate is ready. The previous candidate remains available while preparation is incomplete or unsuccessful.
Optional sources and Brand Library images that support the requested change.
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Was this page helpful?