> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Request an image reroll

POST https://api.evvahub.com/partner/v1/accounts/{creatorId}/ai/studio/images/{generationRef}/rerolls

Starts a new generation that asks the same thing again, with this generation recorded as its parent.

Rerolling a picture of the creator needs `write:ai:voice` on top of `write:ai`. Where the call uses AI, it spends the creator's AI allowance, exactly as the creator's own request does.

**Agency policy**

Your application's call goes through [action approval](/approvals). It runs automatically within the daily count the agency's own rule sets, or once an authorised person approves it. With no rule, you receive `202` with an `ApprovalRequired` body and nothing is done. After approval, send the same request again with `Partner-Approval-Id`. This operation also answers `202` when it accepts the reroll, so tell the two answers apart by `code`.

**Required scopes:** `write:ai`.

**Approval:** this operation runs through [action approval](/approvals) for applications.

Reference: https://developers.evvahub.com/api-reference/ai/reroll-ai-studio-image

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Request an access token at `POST /partner/v1/oauth/token` (`grant_type=client_credentials`) with the application's client secret or a `private_key_jwt` assertion, then send it as `Authorization: Bearer evpa_live_…` (or `evpa_test_…` for a sandbox application). Tokens are opaque and short lived (see `expires_in`); there is no refresh token. Each operation lists the scopes it requires.

## Request

### Path parameters

- `creatorId` (string, required) — The creator profile id — the ONLY source of the creator a request acts for.
- `generationRef` (string, required) — A generation reference; a malformed one, or another creator's, answers 404.

### Headers

- `X-Creator-Id` (string, optional) — Optional echo of the path `creatorId`; any other value is refused with 403 CREATOR_CONTEXT_MISMATCH.
- `Idempotency-Key` (string, required) — Required on every AI write: 1..128 characters, otherwise `400 IDEMPOTENCY_KEY_REQUIRED`. EVVA never generates a key for you, because a generated key would turn a retry into a second charge. The same key answers the same act (`200`) and never reserves the allowance twice. The key is never echoed.
- `Partner-Approval-Id` (string, optional) — The `approvalId` a previous `202 APPROVAL_REQUIRED` returned, for an operation your application may run only with approval. Re-send it with the same payload once a person has approved. A blank value is no approval. The approval is spent once, for exactly that agency, application, creator, operation and payload digest, the same amount and currency, and at most the units it was given for. It is claimed for the request's `Idempotency-Key` (required) and becomes final when the operation succeeds: - A refusal before the effect, a `4xx` or `429`, hands it back for your next attempt. - A `5xx`, `503` included, keeps it claimed for this key, because the effect may have happened. It is handed back only when EVVA knows nothing was done. - The same key re-sent replays the request and never has a second effect. You get the stored result where the operation keeps one, otherwise `409 APPROVAL_CONSUMED` with `details.replay: true`: read the resource to see the result. - Another key is `409 APPROVAL_CONSUMED`. When the approval cannot be used, the request is refused with `403` (`APPROVAL_INVALID`, `APPROVAL_MISMATCH` or `APPROVAL_DECLINED`) or `409` (`APPROVAL_PENDING`, `APPROVAL_EXPIRED` or `APPROVAL_CONSUMED`). See [action approval](/approvals).

## Response

### 200

A retry with the same `Idempotency-Key`, or a reroll that was refused or failed at submit.

- `generation` (AiStudioImage, required) — A studio image. No provider, model or routing evidence is ever included.

### 202

Accepted: a new generation, with this one recorded as its parent. For your application, `202` can also be an `ApprovalRequired` answer with `code: APPROVAL_REQUIRED`, and then nothing was done. Tell the two apart by `code`.

- `AI_rerollAiStudioImage_Response_202`
  - AiGenerationEnvelope: AiGenerationEnvelope
  - ApprovalRequired: ApprovalRequired

## Errors

### 400 Bad Request Error

Invalid or missing parameters: `INVALID_REQUEST` (`details` names the fields), or a more specific code of the operation.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 401 Unauthorized Error

Token missing, malformed, expired or revoked: `INVALID_TOKEN` (or `UNAUTHORIZED` when no bearer token was sent). Request a new token and retry.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 403 Forbidden Error

Not your creator, or a right the AI act needs is missing: `GRANT_REVOKED`, `OAUTH_SCOPE_MISSING`, `INSUFFICIENT_SCOPE`, `CREATOR_PROFILE_REQUIRED`, or `AI_IDENTITY_CREATOR_ONLY` (enrolling a voice or likeness is the creator's alone).

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 404 Not Found Error

No such resource, or it belongs to another creator: `NOT_FOUND` or a more specific code.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 409 Conflict Error

Conflicts with the current state: `IDEMPOTENCY_KEY_REUSED` (the key was used for a different request), an approval that is still pending or already used, or a more specific code of the operation.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 429 Too Many Requests Error

Rate limited: `RATE_LIMIT_EXCEEDED`. Wait `Retry-After` seconds before retrying.

- `code` (enum, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
  - Allowed values: `RATE_LIMIT_EXCEEDED`, `TOO_MANY_MESSAGES`
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (RateLimitErrorDetails, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 500 Internal Server Error

Unexpected server error: `INTERNAL_ERROR`. Nothing internal is disclosed; quote the `X-Request-Id` when you report it.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 503 Service Unavailable Error

Temporarily unavailable: `SERVICE_UNAVAILABLE`, `TEMPORARILY_UNAVAILABLE`, `MEDIA_STORAGE_UNAVAILABLE` or `CREATOR_STANDING_UNAVAILABLE`. Retry after `Retry-After` seconds.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

## Types

### AiStudioImage

A studio image. No provider, model or routing evidence is ever included.

- `ref` (string, required)
- `state` (string, required)
- `origin` (string, optional)
- `parentRef` (string, optional, nullable)
- `rootRef` (string, optional, nullable)

### AiGenerationEnvelope

- `generation` (AiStudioImage, required) — A studio image. No provider, model or routing evidence is ever included.

### ApprovalRequired

The `202` body your application receives when an operation needs a person's approval. Nothing was done. Once the request is approved, re-send the same request with `Partner-Approval-Id: <approvalId>`; watch the [event feed](/event-feed) for `approval.decided`. The request expires 24 hours after it was made, by default. See [action approval](/approvals). The request is idempotent by `Idempotency-Key` (1..128 of `[A-Za-z0-9_-]`, in your application's own key space). The same key and action return the same request; the same key for a different action is `409 IDEMPOTENCY_KEY_REUSED`. Without a key, a live request for the same action is returned instead of a second one.

- `code` (enum, required)
  - Allowed values: `APPROVAL_REQUIRED`
- `error` (string, required)
- `approvalId` (string, required)
- `status` (enum, required) — The status of an approval request. Reads show the effective status. - `PENDING` becomes `APPROVED`, `DECLINED`, `EXPIRED` or `REVOKED`. - `APPROVED` becomes `CONSUMED`, `EXPIRED` or `REVOKED`. - `REVOKED` means the request was voided: its access was withdrawn (grant or consent link), the application or agency stopped, the creator was held or restricted, or the policy that governed it was replaced. `revokedReason` says which.
  - Allowed values: `PENDING`, `APPROVED`, `DECLINED`, `EXPIRED`, `CONSUMED`, `REVOKED`
- `reason` (enum, required) — Why the action was not automatic: no policy (the default), a policy that asks for approval, or over a limit.
  - Allowed values: `NO_POLICY`, `POLICY_REQUIRES_APPROVAL`, `LIMIT_EXCEEDED`
- `expiresAt` (datetime, required)
- `requestId` (string, optional, nullable)

### RateLimitErrorDetails

Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

- `retryAfterSec` (integer, required)
- `level` (enum, optional) — The DM send limit that refused the message, set only with `TOO_MANY_MESSAGES`. It is never a quota, a count or a key. - `conversation` — one side of one thread. - `sender` — a person's own ceiling; it does not apply to applications. - `creator` — everything sent for the creator, studio included. - `application` — everything your application sends. - `agency` — everything your agency sends. - `platform` — the agency's fair share of the platform: its throughput or its concurrency. See [rate limits](/authentication/rate-limits).
  - Allowed values: `conversation`, `sender`, `creator`, `application`, `agency`, `platform`

## Examples

### AI_rerollAiStudioImage_example

**Response**

```json
{
  "generation": {
    "ref": "b85e1d07-4c3a-4f29-8e61-0a9d7c2f5b43",
    "state": "RUNNING",
    "origin": "REROLL",
    "parentRef": "3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28",
    "rootRef": "3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28",
    "assets": [],
    "cancelRequested": false,
    "failure": null,
    "maturity": "NON_ADULT",
    "options": {
      "aspectRatio": "4:5",
      "avoid": "text, logos",
      "commercialUse": true,
      "look": "PRODUCT",
      "outputCount": 2,
      "outputFormat": "jpeg",
      "quality": "STANDARD",
      "subject": "GENERIC"
    },
    "prompt": "A ceramic coffee mug on a sunlit wooden table, soft morning light",
    "requestedAt": "2026-12-01T18:47:33.018Z",
    "settledAt": null,
    "units": {
      "captured": null,
      "quoted": 8,
      "released": null,
      "reserved": 8
    }
  }
}
```

**SDK Code**

```python AI_rerollAiStudioImage_example
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls"

headers = {
    "Idempotency-Key": "a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```go AI_rerollAiStudioImage_example
package main

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

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls"

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

	req.Header.Add("Idempotency-Key", "a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672")
	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))

}
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Idempotency-Key' => 'a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672',
  ],
]);

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

### New generation, parent recorded

**Response**

```json
{
  "generation": {
    "ref": "b85e1d07-4c3a-4f29-8e61-0a9d7c2f5b43",
    "state": "QUEUED",
    "origin": "REROLL",
    "parentRef": "3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28",
    "rootRef": "3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28",
    "assets": [],
    "cancelRequested": false,
    "failure": null,
    "maturity": "NON_ADULT",
    "options": {
      "aspectRatio": "4:5",
      "avoid": "text, logos",
      "commercialUse": true,
      "look": "PRODUCT",
      "outputCount": 2,
      "outputFormat": "jpeg",
      "quality": "STANDARD",
      "subject": "GENERIC"
    },
    "prompt": "A ceramic coffee mug on a sunlit wooden table, soft morning light",
    "requestedAt": "2026-12-01T18:47:33.018Z",
    "settledAt": null,
    "units": {
      "captured": null,
      "quoted": 8,
      "released": null,
      "reserved": 8
    }
  }
}
```

**SDK Code**

```python New generation, parent recorded
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls"

headers = {
    "Idempotency-Key": "a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```go New generation, parent recorded
package main

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

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls"

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

	req.Header.Add("Idempotency-Key", "a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672")
	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))

}
```

```php New generation, parent recorded
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Idempotency-Key' => 'a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672',
  ],
]);

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

### Waiting for an authorised person

**Response**

```json
{
  "approvalId": "apr_8sKq2VnT4xLm7RcB1pYw9ZdH",
  "code": "APPROVAL_REQUIRED",
  "error": "This action needs the approval of an authorised person",
  "expiresAt": "2026-12-03T14:31:00.000Z",
  "reason": "NO_POLICY",
  "requestId": "7e134951-5bd5-4254-b4f8-9aaa338039d8",
  "status": "PENDING"
}
```

**SDK Code**

```python Waiting for an authorised person
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls"

headers = {
    "Idempotency-Key": "a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```go Waiting for an authorised person
package main

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

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls"

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

	req.Header.Add("Idempotency-Key", "a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672")
	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))

}
```

```php Waiting for an authorised person
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/ai/studio/images/3f6c2a91-7d4e-4b8a-a5c2-9e1f0b7d4c28/rerolls', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Idempotency-Key' => 'a1cc34b8-9e1d-49cc-b8c3-3da5b03f6672',
  ],
]);

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