<span id="审批工单奖励"></span>

# Approve a feedback ticket reward

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Record a reward approval without an amount, optionally updating the ticket status and reply.

```text
POST https://api.moi.matrixorigin.cn/v5/admin/feedback-tickets/{id}/reward-approval
```

<span id="调用前准备"></span>

## Before you call this API

Prepare a Genesis administrator Bearer token valid for the current environment. An ordinary personal access token, X-API-Key, or Workspace Owner status is insufficient. Session-authenticated writes also require CSRF protection. See [AI Studio](../../../../../developer/api/ai-studio/index.md). Replace example IDs with real tickets you are authorized to view.

{} is a valid approval request, and the ticket must have a nonempty UC account recorded. Success does not mean funds have been delivered. amount, credit, and reward_policy are not accepted; consumers handle downstream campaign rules and delivery. Reapproval reuses the first event, but supplied status/reply values may still update. The approval is followed by an independent detail read, which can fail after approval has persisted. Reread before resubmitting.

<span id="请求参数"></span>

## Request parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl -X POST "https://api.moi.matrixorigin.cn/v5/admin/feedback-tickets/ticket-example/reward-approval" \
  -H "Authorization: Bearer $GENESIS_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{}'
```

:::::
:::::{tab-item} Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | string | Yes in the Bearer example | Bearer followed by a trusted administrator token for this environment. Do not also set an API Key. |
| `id` | string | Yes | Ticket ID in the path. |
| `status` | string | No | processing or closed. Omission or null leaves the status unchanged. |
| `admin_reply` | string / null | No | Omission or null leaves the reply unchanged; an empty string explicitly clears it. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "ticket": {
      "id": "ticket-example",
      "ticket_no": "FB-EXAMPLE",
      "account_id": "principal-example",
      "uc_account_id": "uc-example",
      "title": "示例反馈",
      "description": "界面显示结果与预期不同。",
      "expected_behavior": null,
      "actual_behavior": null,
      "reproduction_steps": null,
      "suggested_priority": null,
      "status": "submitted",
      "admin_reply": null,
      "created_at": "2026-11-12T04:00:00Z",
      "updated_at": "2026-11-12T04:00:00Z",
      "user_info": {
        "name": "示例用户",
        "accounts": []
      },
      "messages": [
        {
          "sequence": 0,
          "role": "user",
          "content": "示例反馈内容。",
          "created_at": "2026-11-12T04:00:00Z"
        }
      ],
      "reward_event": {
        "id": "event-example",
        "event_type": "feedback.reward_approved",
        "source_type": "feedback_ticket",
        "source_id": "ticket-example",
        "subject_uc_account_id": "uc-example",
        "approved_by": "admin-example",
        "occurred_at": "2026-11-12T04:00:00Z",
        "delivery_status": "pending",
        "attempt_count": 0,
        "last_attempt_at": null,
        "last_error": null,
        "billing_transaction_id": null,
        "granted_at": null,
        "created_at": "2026-11-12T04:00:00Z",
        "updated_at": "2026-11-12T04:00:00Z"
      }
    },
    "reward_event": {
      "id": "event-example",
      "event_type": "feedback.reward_approved",
      "source_type": "feedback_ticket",
      "source_id": "ticket-example",
      "subject_uc_account_id": "uc-example",
      "approved_by": "admin-example",
      "occurred_at": "2026-11-12T04:00:00Z",
      "delivery_status": "pending",
      "attempt_count": 0,
      "last_attempt_at": null,
      "last_error": null,
      "billing_transaction_id": null,
      "granted_at": null,
      "created_at": "2026-11-12T04:00:00Z",
      "updated_at": "2026-11-12T04:00:00Z"
    }
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on successful approval. |
| `msg` | string | OK on successful approval. |
| `data` | object | Approval result. |
| `data.ticket` | object | Ticket reread after approval. |
| `data.reward_event` | object | The ticket's unique reward approval record, without amounts or campaign rules. |
| `data.ticket.id` | string | Object ID. |
| `data.ticket.ticket_no` | string / null | Feedback number; may be null. |
| `data.ticket.account_id` | string | Product principal ID that submitted the ticket. |
| `data.ticket.uc_account_id` | string / null | UC account facts saved at creation; may be null. This is not the current administrator's account. |
| `data.ticket.user_info` | object / null, optional | Submitter information projected from the current identity directory for administrator reads. Optional; not persisted in the ticket. |
| `data.ticket.title` | string / null | Title; may be null on a ticket. |
| `data.ticket.description` | string / null | Problem description; may be null. |
| `data.ticket.expected_behavior` | string / null | Expected behavior; may be null. |
| `data.ticket.actual_behavior` | string / null | Actual behavior; may be null. |
| `data.ticket.reproduction_steps` | string / null | Reproduction steps; may be null. |
| `data.ticket.suggested_priority` | string / null | User-suggested priority; may be null and does not imply triage. |
| `data.ticket.status` | string | Ticket status: submitted, processing, or closed. |
| `data.ticket.admin_reply` | string / null | Administrator reply; may be null. An empty string differs from null. |
| `data.ticket.created_at` | string | Creation time in RFC 3339 format. |
| `data.ticket.updated_at` | string | Update time in RFC 3339 format. |
| `data.ticket.messages` | object (array of objects), optional | Optional conversation messages; not loaded in lists. An empty detail collection may be omitted because of omitempty. |
| `data.ticket.github_issue` | object / null, optional | Optional primary GitHub Issue request; lists, details, and updates can include this association. |
| `data.ticket.reward_event` | object / null, optional | Optional reward approval record; not currently loaded in lists. Details and updates return it when present. |
| `data.reward_event.id` | string | Object ID. |
| `data.reward_event.event_type` | string | Approval event type: feedback.reward_approved. |
| `data.reward_event.source_type` | string | Source type: feedback_ticket. |
| `data.reward_event.source_id` | string | Associated ticket ID. |
| `data.reward_event.subject_uc_account_id` | string | Approved submitter's UC account. |
| `data.reward_event.approved_by` | string | Administrator principal ID from the first approval. |
| `data.reward_event.occurred_at` | string | First approval time in RFC 3339 format. |
| `data.reward_event.delivery_status` | string | pending or granted. Approval success does not mean delivery has completed. |
| `data.reward_event.attempt_count` | integer | Number of asynchronous processing attempts. |
| `data.reward_event.last_attempt_at` | string / null | Last attempt time; null if no attempt has occurred. |
| `data.reward_event.last_error` | string / null | Latest error message; may be null. |
| `data.reward_event.billing_transaction_id` | string / null | Consumer accounting reference ID; may be null. |
| `data.reward_event.granted_at` | string / null | Delivery time; may be null. |
| `data.reward_event.created_at` | string | Creation time in RFC 3339 format. |
| `data.reward_event.updated_at` | string | Update time in RFC 3339 format. |

See [Shared objects](objects.md) for all public fields of nested tickets, users, messages, approval facts, and GitHub requests. Nullability and omission are documented separately; the old SDK fixture's submitter_email is not a current field.
:::::
::::::
:::::::

<span id="错误响应"></span>

## Error responses

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{"code":"Unauthorized","msg":"Unauthorized"}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string / integer | Varies by failure stage; the example uses an authentication-layer string. |
| `msg` | string | Authentication or service-layer failure text; service text is usually localized. |
| `message` | string | Text for a numeric parameter-parsing error code; distinct from msg. |
| `data` | null | Current service-layer responseEnvelope errors retain null; authentication examples may omit this field. |
| `details` | object | Text-field 422 errors may include field/reason and other details; see the error descriptions. |

| HTTP / code | Conditions and handling |
| --- | --- |
| 401 / Unauthorized | Rejected by authentication. Do not use an ordinary PAT or also supply X-API-Key. |
| 403 / ErrForbidden | Trusted administrator eligibility was not obtained, or the current caller identity does not match it. |
| 404 / ErrFeedbackTicketNotFound | The target ticket does not exist. Current service errors return code/msg/data:null. |
| 503 / ErrServiceUnavailable | Classified identity, directory, or authorization dependency unavailability, or network timeout. |
| 500 / ErrServer | Internal processing or localization failure. Read back after a write error to confirm the result. |
| 400 / ErrFeedbackRewardSubjectMissing | The ticket has no usable UC account recorded. This request cannot fabricate one. |
| 400 / ErrFeedbackTicketStatusInvalid or ErrParamInvalid | Invalid status or request decoding failure. |

See [Errors and recovery](errors-recovery.md) for all error families and stages.
:::::
::::::
:::::::
