> ## Documentation Index
> Fetch the complete documentation index at: https://docs.makelocalads.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Targeting, copy and names

> Rewrite a group's targeting, rewrite one ad's copy, or rename a group.

[← ChatGPT ads](/chatgpt-ads/overview)

**Endpoints:** `GET /chatgpt-ad-groups/{ad_group_id}`,
`PATCH /chatgpt-ad-groups/{ad_group_id}`,
`POST /chatgpt-ad-groups/{ad_group_id}/targeting`,
`POST /chatgpt-ads/{ad_id}/copy`
**Permissions:** retrieve with `chatgpt_ads:read`, rename with
`chatgpt_ads:update`, rewrites with `chatgpt_ads:generate`

Everything after generation is free: rewrite the targeting for a whole group,
rewrite one ad's title and body, or rename a group to keep a growing library
readable in the app.

## Retrieve the group

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://makelocalads.com/api/v1/chatgpt-ad-groups/2b8f6d4e-1a3c-4e5f-9b7d-0c2e4f6a8b1d \
  --header "Authorization: Bearer $LOCALADS_API_KEY"
```

The group carries its ads, shared targeting and progress. See
[Create an ad group](/chatgpt-ads/create-an-ad-group) for the full shape.

## Rewrite a group's targeting

Context hints (`hints`) and negative phrases (`phrases`) steer every ad in the
group. Rewrite either list for the whole group, free:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST \
  --url https://makelocalads.com/api/v1/chatgpt-ad-groups/2b8f6d4e-1a3c-4e5f-9b7d-0c2e4f6a8b1d/targeting \
  --header "Authorization: Bearer $LOCALADS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "scope": "hints" }'
```

`200 OK` returns the group with its new `context_hints` (or `negative_phrases`
for `scope: "phrases"`).

<ParamField path="ad_group_id" type="string" required>
  The group whose targeting to rewrite.
</ParamField>

<ParamField body="scope" type="string" required>
  Which list to rewrite: `hints` (context hints) or `phrases` (negative
  phrases).
</ParamField>

## Rewrite one ad's copy

Write a new title and body for one ad, free. Its image stays:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST \
  --url https://makelocalads.com/api/v1/chatgpt-ads/8e1c3a5b-7d9f-4b2e-a6c8-0d2f4e6a8c1b/copy \
  --header "Authorization: Bearer $LOCALADS_API_KEY"
```

`200 OK` returns the ad's group, with the new copy on the ad.

## Rename a group

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request PATCH \
  --url https://makelocalads.com/api/v1/chatgpt-ad-groups/2b8f6d4e-1a3c-4e5f-9b7d-0c2e4f6a8b1d \
  --header "Authorization: Bearer $LOCALADS_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "name": "Linen throw, gifting" }'
```

`200 OK` returns the renamed group. The name is 1 to 120 characters and is
what the app shows in the group list.

## Errors

| Status | Code | Meaning |
| - | - | - |
| `404` | `ad_group_not_found`, `ad_not_found` | Not available to you |
| `422` | `invalid_request` | A `scope` outside `hints` or `phrases`, or an empty name |

See [Errors and retries](/concepts/errors) for the error format.
