> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.markup.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.markup.ai/_mcp/server.

# Get Style Agent Target

GET https://api.markup.ai/style-agent/targets/{target_id}

Deprecated alias of `GET /style-agent/style-guides/{style_guide_id}`.

"Target" is the legacy name for a style guide; this route stays for
existing integrations. Use the style-guides route for new work.

Reference: https://docs.markup.ai/developer-reference/api-reference/style-agent/get-style-agent-target

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `target_id` (string, required)

## Response

### 200

Successful Response

- `id` (string, required)
- `display_name` (string, required)
- `language` (StyleGuideLanguage, required)
- `description` (string, optional, nullable)
- `enabled` (boolean, optional, default: true)
- `language_variant` (StyleGuideLanguageVariant, optional, nullable)
- `goals` (list of StyleGuideGoal, optional)

## Errors

### 401 Unauthorized Error

Authentication failed or no valid API key provided.

- `detail` (string, required) — A description of the error that occurred.
- `status` (integer, required) — The HTTP status code generated by the server for this issue
- `request_id` (string, required) — A unique ID associated with the HTTP request.

### 403 Forbidden Error

Forbidden

- `detail` (string, required) — A description of the error that occurred.
- `status` (integer, required) — The HTTP status code generated by the server for this issue
- `request_id` (string, required) — A unique ID associated with the HTTP request.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required) — A description of the error that occurred.
- `status` (integer, required) — The HTTP status code generated by the server for this issue
- `request_id` (string, required) — A unique ID associated with the HTTP request.

## Types

### StyleGuideLanguage

- `display_name` (string, required)
- `abbreviation` (string, required)

### StyleGuideLanguageVariant

- `identifier` (string, required)
- `display_name` (string, required)

### StyleGuideGoal

- `id` (string, required)
- `identifier` (string, required)
- `display_name` (string, optional, nullable)
- `color` (string, optional, nullable)
- `sort_key` (integer, optional, nullable)
- `severity` (string, optional, nullable)
- `goal_groups` (list of StyleGuideGoalGroup, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### StyleGuideGoalGroup

- `id` (string, required)
- `display_name` (string, optional, nullable)
- `sort_key` (integer, optional, nullable)
- `guidelines` (list of StyleGuideGuideline, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

### StyleGuideGuideline

A single guideline (rule) within a style guide goal group. ``presets`` and other SLS-internal metadata are intentionally omitted: the customer-facing view renders only the resolved state for the selected preset. Nested ``parameters`` / ``compound_available_values`` use narrow models (not opaque dicts) so internal fields can't leak through either.

- `id` (string, required)
- `identifier` (string, required)
- `display_name` (string, required)
- `guideline_type` (string, required)
- `context_configurable` (boolean, optional, default: false)
- `active` (boolean, optional, default: false)
- `parameters` (list of StyleGuideParameter, optional, nullable)
- `parameter_value` (map from string to any, optional, nullable)
- `contexts` (list of string, optional, nullable)
- `contexts_filter_type` (string, optional, nullable)
- `contexts_active` (boolean, optional, default: false)
- `compound_selected_value` (string, optional, nullable)
- `compound_available_values` (list of StyleGuideCompoundOption, optional)

### StyleGuideParameter

A parameter definition for a guideline: its key, label, value type, and numeric bounds.

- `name` (string, optional, nullable)
- `id` (string, optional, nullable)
- `label` (string, optional, nullable)
- `display_name` (string, optional, nullable)
- `type` (string, optional, nullable)
- `minimum` (double, optional, nullable)
- `maximum` (double, optional, nullable)

### StyleGuideCompoundOption

One selectable option for a multi-option ("compound") guideline.

- `id` (string, optional, nullable)
- `display_name` (string, optional, nullable)

## Examples

**Response**

```json
{
  "id": "string",
  "display_name": "string",
  "language": {
    "display_name": "string",
    "abbreviation": "string"
  },
  "description": "string",
  "enabled": true,
  "language_variant": {
    "identifier": "string",
    "display_name": "string"
  },
  "goals": [
    {
      "id": "string",
      "identifier": "string",
      "display_name": "string",
      "color": "string",
      "sort_key": 1,
      "severity": "string",
      "goal_groups": [
        {
          "id": "string",
          "display_name": "string",
          "sort_key": 1,
          "guidelines": [
            {
              "id": "string",
              "identifier": "string",
              "display_name": "string",
              "guideline_type": "string",
              "context_configurable": false,
              "active": false,
              "parameters": [
                {
                  "name": "string",
                  "id": "string",
                  "label": "string",
                  "display_name": "string",
                  "type": "string",
                  "minimum": 1.1,
                  "maximum": 1.1
                }
              ],
              "parameter_value": {},
              "contexts": [
                "string"
              ],
              "contexts_filter_type": "string",
              "contexts_active": false,
              "compound_selected_value": "string",
              "compound_available_values": [
                {
                  "id": "string",
                  "display_name": "string"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.markup.ai/style-agent/targets/target_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.markup.ai/style-agent/targets/target_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.markup.ai/style-agent/targets/target_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.markup.ai/style-agent/targets/target_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.markup.ai/style-agent/targets/target_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.markup.ai/style-agent/targets/target_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.markup.ai/style-agent/targets/target_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.markup.ai/style-agent/targets/target_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```