---
title: Redo one part of a draft
url: /docs/developers/reference/social-edition-redo
---

# Redo one part of a draft

`social.edition.redo@1`

Make one part of a draft again, with the recipe that made it. Requires **Write social**. Only the caption or only the picture is replaced, in place: the other part, the account and any placement stay, an approval stops covering the draft, and the old picture stays in Drive. The part is made by the recipe the draft came from, with the answers it was first made from, never a different path. A caption redo is free and works with a script key. A new picture buys one AI picture: a person's own press is the yes, and a script key or a connected agent asks once, answering `requirements` with an `approvalRequestRef`; nothing is bought until a person approves, and replaying the same `operationId` after the approval starts it once. A draft made from the person's own photo cannot make the photo again: choose another photo. The answer says the redo was admitted, not that it finished; follow its run.

## Make a caption again

Free. Send the draft as you read it; only the caption is replaced.

```curl tabs
# A new operationId for each new request; the same one to retry it.
curl https://api.growlocal.site/api/v1/profiles/YOUR_BUSINESS_ID/invocations \
  -H "Authorization: Bearer gl_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "target": {
    "featureId": "YOUR_FEATURE_ID",
    "export": "redoEdition",
    "contractRef": "social.edition.redo@1"
  },
  "operationId": "redo-caption-1",
  "input": {
    "edition": {
      "ref": {
        "businessProfileId": "YOUR_BUSINESS_ID",
        "featureId": "juniper-cakes.data",
        "collectionId": "juniper-cakes.editions",
        "id": "YOUR_EDITION_ID"
      },
      "revision": 3
    },
    "part": "caption",
    "note": "shorter"
  }
}'
```

```javascript tabs
// A new operationId for each new request; the same one to retry it.
const response = await fetch(
  "https://api.growlocal.site/api/v1/profiles/YOUR_BUSINESS_ID/invocations",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer gl_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "target": {
        "featureId": "YOUR_FEATURE_ID",
        "export": "redoEdition",
        "contractRef": "social.edition.redo@1"
      },
      "operationId": "redo-caption-1",
      "input": {
        "edition": {
          "ref": {
            "businessProfileId": "YOUR_BUSINESS_ID",
            "featureId": "juniper-cakes.data",
            "collectionId": "juniper-cakes.editions",
            "id": "YOUR_EDITION_ID"
          },
          "revision": 3
        },
        "part": "caption",
        "note": "shorter"
      }
    }),
  },
);
const receipt = await response.json();
console.log(response.status, receipt);
```

```python tabs
import requests

# A new operationId for each new request; the same one to retry it.
response = requests.post(
    "https://api.growlocal.site/api/v1/profiles/YOUR_BUSINESS_ID/invocations",
    headers={"Authorization": "Bearer gl_YOUR_API_KEY"},
    json={
        "target": {
            "featureId": "YOUR_FEATURE_ID",
            "export": "redoEdition",
            "contractRef": "social.edition.redo@1",
        },
        "operationId": "redo-caption-1",
        "input": {
            "edition": {
                "ref": {
                    "businessProfileId": "YOUR_BUSINESS_ID",
                    "featureId": "juniper-cakes.data",
                    "collectionId": "juniper-cakes.editions",
                    "id": "YOUR_EDITION_ID",
                },
                "revision": 3,
            },
            "part": "caption",
            "note": "shorter",
        },
    },
    timeout=30,
)
print(response.status_code, response.json())
```

## Parameters

What goes in `input`:

| Name | Type | Required | Description |
|---|---|---|---|
| `edition` | object | Yes | The draft to change, as you last read it. The new part is saved only over that revision; if the draft changed meanwhile, nothing is overwritten. Refused once it has gone to the platform, or when no recipe made it. |
| `edition.ref` | object | Yes | The draft's row. |
| `edition.ref.businessProfileId` | string | Yes | The business that owns it. |
| `edition.ref.featureId` | string | Yes | The editions Data feature. |
| `edition.ref.collectionId` | string | Yes | The editions table. |
| `edition.ref.id` | string | Yes | The row id. |
| `edition.revision` | integer | Yes | The revision you read it at; refused if it changed since. |
| `part` | one of `caption`, `picture` | Yes | `caption` for new words, or `picture` for a new picture where the recipe makes one. |
| `note` | string | No | Optional words about what to change, such as "shorter". Treated as untrusted text, never as instructions. |

## Response

A call that worked answers `200` with an `applied` receipt; its `output` holds these fields, among others. `GET /catalog/social.edition.redo@1` answers the complete shape as JSON Schema.

| Name | Type | Description |
|---|---|---|
| `runRef` | string | The Redo run: follow it with [Automation run inspector](automation-run-inspector.md). |
| `featureId` | string | The feature the run belongs to. |
| `part` | one of `caption`, `picture` | The part being made again. |
| `paidProduction` | object | Present for a picture: the declared production the yes covers, once, with no paid retry or fallback. |
| `pictureEstimate` | object | Present for a picture: Media's estimated cost of that one picture in USD. Not a bill or a guaranteed maximum. |

```json title="Response"
{
  "status": "applied",
  "operationId": "redo-caption-1",
  "output": {
    "runRef": "11111111-2222-4333-8444-555555555555",
    "featureId": "juniper-cakes.automations",
    "part": "caption"
  }
}
```

## Errors

Besides the answers every request can get ([Errors](../errors.md)), its receipt can say:

| Status | HTTP | What it means |
|---|---|---|
| `pending` | 202 | Accepted and still running. Look it up with `GET /operations/{operationId}`. |
| `uncertain` | 202 | GrowLocal can't yet tell whether it took effect. Look it up before trying again. |
| `requirements` | 409 | Something must happen first; the receipt lists what. |
| `conflict` | 409 | The row changed since you read it, or this `operationId` was used with a different body. |
| `rejected` | 400, or 403 when it's a matter of access | Not done. `diagnostics` says why: each has a `code`, a `path` into what you sent and a `message`. |

The codes in `diagnostics` you're most likely to see:

| Code | Status | What it means |
|---|---|---|
| `APPROVAL.REQUIRED` | `requirements` | A picture redo from a script key or a connected agent: the answer is `requirements` with an `approvalRequestRef`. Replay the same `operationId` after a person approves. Nothing is bought until then. |
| `SOCIAL.REDO_NOT_RECIPE_MADE` | `rejected` | No recipe made this draft, so no part can be made again. |
| `SOCIAL.REDO_SOURCE_UNAVAILABLE` | `rejected` | The recipe and brief that made the draft cannot be read by you. |
| `SOCIAL.REDO_RUNNING` | `rejected` | Another redo of this draft, by anyone, is still being made. Only one runs per draft at a time; nothing is asked of Media or bought. Ask `social.edition.redo.check@1` which part is running. |
| `SOCIAL.REDO_PART_UNAVAILABLE` | `rejected` | The recipe does not make that part, or the picture is the person's own photo. |
| `SOCIAL.REDO_ACCOUNT_CANNOT_TAKE` | `rejected` | The draft's account can no longer take the post. |
| `SOCIAL.DELIVERY_STARTED` | `rejected` | The post has gone to the platform and is evidence. |
| `SOCIAL.REVISION_CONFLICT` | `conflict` | The draft changed since `edition.revision` was read. |
| `MEDIA.PICTURE_APPROVAL_REQUIRED` | `rejected` | The caller cannot ask a person for the yes (an automation step, say). Start the redo in GrowLocal, with a script key or through a connected agent. |
