# Brand Review API

Use the Brand Review REST API to evaluate input content and assets against brand guidelines using AI-powered analysis.

The API analyzes content provided in the request, such as text, images, and files, by comparing it against brand kit sections for a specific tenant and organization. The analysis can evaluate content against all brand kit sections or selected sections, such as *Brand Context*, *Global Goals*, and *Tone of Voice*. SitecoreAI generates compliance scores, explanations, and improvement suggestions based on this analysis.

Use this REST API to:
- Provide content in the request body for brand evaluation against brand kit guidelines.
- Assess how the input content aligns with specific brand kit sections and subsections (fields), including *Brand Context*, *Do’s and Don’ts*, *Tone of Voice*, *Grammar Checklists*, and *Visual Guidelines*.
- Receive a brand compliance score for the input content on a scale from 1 to 5, where 5 indicates the highest level of alignment with the brand guidelines.
- Evaluate multiple input formats, including text, images, PDFs, metadata, Markdown, and JSON.

After a review is generated, teams can use the results to enforce brand consistency at scale, validate content in real time using AI-suggested improvements, and reduce compliance risk by identifying brand, legal, and accessibility issues. Compliance scores and explanations help pinpoint problem areas at the section or field level and reveal recurring trends across content.

Note the following:
- Requests typically complete within 5 seconds. Batching is not supported.
- Multiple input formats are supported, including content from SitecoreAI or XP pages.
- To use this REST API, you must authenticate all API requests.
- All API requests are made in your production environment.

For more information, see the [official Sitecore documentation](https://doc.sitecore.com/).

# Authorization
The Brand Review REST API uses the OAuth 2.0 standard with [JSON web tokens](https://doc.sitecore.com/stream/en/users/sitecore-stream/generate-a-json-web-token--jwt-.html) to authorize REST API requests.
### Create Client ID and Client Secret
  1. In the Sitecore Cloud Portal, open Stream.
  2. Click **Admin** > **AI APIs keys** > **Create credential**.
  3. In the **​Create New Client​​** dialog, enter a name and description for the client. Then click **Create**. The ​Client ID and Client Secret​​ display.
  4. Copy the Client ID and Client Secret because you won't be able to view them again in Stream. You'll use them to request an access token.

### Request an access token
Run the following cURL command to request an access token. Replace the placeholder values with your Client ID and Client Secret.
```curl
  curl -X POST 'https://auth.sitecorecloud.io/oauth/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'client_id={YOUR_API_KEY}' \
  --data-urlencode 'client_secret={YOUR_API_SECRET}' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'audience=https://api.sitecorecloud.io'
```
In the response, the `access_token` key contains the access token:
```json
  {
    "access_token": "{YOUR_ACCESS_TOKEN}",
    "scope": "ai.orgs.br:gen ai.org.brd:w ai.org.brd:r ai.org.docs:w ai.org.docs:r ai.org:admin",
    "expires_in": 86400,
    "token_type": "Bearer"
  }
```
Access tokens expire in 24 hours. If your requests unexpectedly return a response with status `401 Unauthorized`, request a new access token by repeating this `POST` request.

We recommend that you cache the access token for 24 hours to avoid repeating this `POST` request while the access token is still valid.
### Include the access token in the request header
You can now start making REST API requests. You must include the access token in the request header of every request. For example:

  ```curl
  curl -X GET '{YOUR_BASE_URL}/v2/...' \
  -H 'Authorization: Bearer {YOUR_ACCESS_TOKEN}' \
  -H 'Accept: application/json'
  ```


Version: v1
License: Closed source
Metadata:
  - product: AI skills

## Servers

Production server
```
https://edge-platform.sitecorecloud.io/stream/ai-skills-api
```

## Security

### HTTPBearer

Type: http
Scheme: bearer

## Download OpenAPI description

[Brand Review API](https://api-docs.sitecore.com/_bundle/ai-skills/ai-brand-review-admin-rest-api/index.yaml)

## Brand review

The Brand Review API lets you evaluate input content and assets against the guidelines defined in a brand kit using AI-powered analysis. The API analyzes the provided content against the rules in selected brand kit sections and subsections (fields) and returns compliance results with 1 to 5 scores, explanations, and improvement suggestions at the section and field level.

### Generate a brand review

 - [POST /api/skills/v1/brandreview/generate](https://api-docs.sitecore.com/ai-skills/ai-brand-review-admin-rest-api/brand-review/generate_brand_review_api_skills_v1_brandreview_generate_post.md): Generates a brand review using AI by evaluating the provided input against the specified brand kit, including its sections and subsections(fields). The review returns compliance scores, explanations, and improvement suggestions.

