> For the complete documentation index, see [llms.txt](https://docs.trustlesswork.com/trustless-work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/deploy-1/approve-and-release-milestones.md).

# Approve and Release Milestones

Builds the unsigned transaction that **approves the listed milestones and releases the funds of those same milestones** in one atomic step. A shortcut for wallets that hold **both** the approver and release-signer roles.

{% hint style="info" %}
The reference below is generated from the **live API spec** — if anything on this page disagrees with it, the reference wins.
{% endhint %}

## Endpoint

## Approve milestones AND release their funds in a single atomic tx

> Shortcut for wallets that hold both the approver and release-signer roles. Approves the listed milestones on behalf of \`signer\` and releases the funds of THOSE SAME milestones — multi-release V2 releases per-milestone, so the same index list drives both steps. If \`signer\` is not in BOTH \`roles.approvers\` and \`roles.release\_signers\`, the contract returns \`ESCROW\_SIGNER\_MUST\_BE\_APPROVER\_AND\_RELEASE\_SIGNER\` (HTTP 403).

```json
{"openapi":"3.0.0","info":{"title":"👋🏼 Trustless Work Core API — All Endpoints (Unified)","version":"1.0"},"security":[{}],"paths":{"/escrow/multi-release/v2/approve-and-release-milestones":{"post":{"description":"Shortcut for wallets that hold both the approver and release-signer roles. Approves the listed milestones on behalf of `signer` and releases the funds of THOSE SAME milestones — multi-release V2 releases per-milestone, so the same index list drives both steps. If `signer` is not in BOTH `roles.approvers` and `roles.release_signers`, the contract returns `ESCROW_SIGNER_MUST_BE_APPROVER_AND_RELEASE_SIGNER` (HTTP 403).","operationId":"ApproveAndReleaseMultiReleaseMilestonesV2Controller_approveAndReleaseMilestones","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveAndReleaseMultiReleaseMilestonesV2Dto"}}}},"responses":{"200":{"description":"Unsigned XDR built successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsignedTransactionResponse"}}}},"400":{"description":"Request body or query params fail schema validation (wrong type, missing required field, unknown property).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"401":{"description":"Missing, malformed, expired, revoked or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"403":{"description":"API key is valid but does not have the role required for this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"422":{"description":"Payload is well-formed but a business rule rejects it (e.g. amount out of range, role not allowed for this user).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"500":{"description":"Unexpected server-side failure. Use the `traceId` to look up the incident in server logs or contact support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}}},"summary":"Approve milestones AND release their funds in a single atomic tx","tags":["Multi Release Escrow V2"]}}},"components":{"schemas":{"ApproveAndReleaseMultiReleaseMilestonesV2Dto":{"type":"object","properties":{"contractId":{"type":"string","description":"Deployed multi-release v2 escrow contract (C...)."},"signer":{"type":"string","description":"Wallet that signs the transaction. MUST be in BOTH `roles.approvers` and `roles.release_signers` (enforced on-chain)."},"milestoneIndexes":{"description":"Zero-based indexes of the milestones to approve AND release in this batch. The same list is used for both inner steps.","type":"array","items":{"type":"number"}}},"required":["contractId","signer","milestoneIndexes"]},"UnsignedTransactionResponse":{"type":"object","properties":{"unsignedXdr":{"type":"string","description":"Base64-encoded unsigned XDR. Sign it with the appropriate wallet and submit to Soroban / Horizon to execute the operation on-chain."},"txHash":{"type":"string","description":"SHA-256 hash of the prepared transaction. NOTE: it only matches the executed transaction if you sign the XDR exactly as returned — re-preparing (re-simulating) it changes the hash. Prefer `contractId` for correlation when present."},"contractId":{"type":"object","description":"Deploys only: the address (C…) the new escrow contract WILL have once this transaction executes — known upfront because the service generates the deploy salt. Track your escrow with it (e.g. `GET /escrows/:contractId`) as soon as the transaction lands; it is stable even if your wallet/SDK re-prepares the transaction.","nullable":true}},"required":["unsignedXdr","txHash"]},"ProblemDetailsResponseDto":{"type":"object","properties":{"type":{"type":"string","description":"Stable URI identifying the error type. Hash-link points to the docs."},"title":{"type":"string","description":"Short human-readable summary of the problem."},"status":{"type":"number","description":"HTTP status code, repeated here for typed clients."},"code":{"type":"string","description":"Machine-readable error code. Stable across versions; safe to switch on."},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence."},"instance":{"type":"string","description":"URI of the request that triggered the error."},"traceId":{"type":"string","description":"Correlation id propagated from the `X-Trace-Id` header (or generated). Use it when contacting support to reference a specific request."},"extensions":{"type":"object","description":"Optional structured context. Shape depends on the error code; documented per-endpoint when relevant.","additionalProperties":true}},"required":["type","title","status","code","detail"]}}}}
```

## Field notes

* `signer` must be in **both** `roles.approvers` **and** `roles.releaseSigners` — otherwise the contract returns `ESCROW_SIGNER_MUST_BE_APPROVER_AND_RELEASE_SIGNER` (HTTP 403).
* Multi-release settles **per milestone**: the same index list drives both the approval and the release, and only those milestones pay out.

## What this endpoint returns

`unsignedXdr` + `txHash` — sign the XDR **exactly as returned** and submit it via [Send Transaction](/trustless-work/v2-en/api-rest/stellar/send-transaction.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/deploy-1/approve-and-release-milestones.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
