> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/dsx-air/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/dsx-air/_mcp/server.

# Approve a marketplace demo publish queue entry

PATCH https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/{id}/approve/
Content-Type: application/json

Approve a queued marketplace demo publish access record. The request body depends on the record's current `status`:

- **`PENDING`**: First publish. Set `publicly_published` to `true` for public visibility or `false` with `allowed_orgs` for restricted. When `publicly_published` is omitted, it defaults to the record's `prefer_public`.
- **`PENDING_ELEVATION`**: Restricted → public. Approve as public (`publicly_published` `true`); `allowed_orgs` must be empty.
- **`PENDING_RESTRICTION`**: Public → restricted. Set `publicly_published` to `false` and supply `allowed_orgs`.
- **`PENDING_ALLOWLIST`**: Allow-list update on a restricted demo. Supply the new `allowed_orgs`.
- **`PENDING_UNPUBLISH`**: Gated unpublish. No request body; unpublishes the demo when approved.

**Required scopes (any one):**

- `air:admin` (roles: `air_admin`)
- `air:sre` (roles: `air_sre`)

Reference: https://docs.nvidia.com/dsx-air/api-reference/publishing/api-v-3-publishing-marketplace-demo-publish-access-records-approve-partial-update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — A UUID string identifying this marketplace demo publish access record.

### Body (application/json)

This endpoint expects an object.

- `publicly_published` (boolean, optional) — Whether to publish as public (all users) or restricted (allow-list). When omitted, defaults to the record's `prefer_public` value.
- `allowed_orgs` (list of string, optional) — Restricted allow-list as org UUIDs. For `PENDING`, `PENDING_RESTRICTION`, or `PENDING_ALLOWLIST`, supply the list the reviewer wants (full replace for allow-list changes). The requesting org is always included automatically. `[]` means requesting-org-only. Must be omitted or empty when approving as public. Not used for `PENDING_UNPUBLISH` (empty body).

## Response

### 200

- `id` (string, required)
- `created` (datetime, required)
- `modified` (datetime, required)
- `marketplace_demo` (string, required) — UUID of the marketplace demo this record governs.
- `marketplace_demo_name` (string, required, nullable) — Marketplace demo name.
- `requested_by` (string, required, nullable) — Email of the user who submitted this record.
- `requesting_org` (string, required, nullable) — Human-readable name of the org that submitted this record.
- `requesting_org_display_name` (string, required, nullable) — Requesting org display name. Same source as list search and ordering for this field.
- `requesting_org_ngc_org_name` (string, required, nullable) — Requesting org NGC name. Same source as list search and ordering for this field.
- `reviewed_by` (string, required, nullable) — Email of the user who reviewed this record, if reviewed.
- `status` (enum, required) — Current status of the publish access record. * `PENDING` - Pending * `APPROVED` - Approved * `DENIED` - Denied * `REMOVED` - Removed * `CANCELLED` - Cancelled * `PENDING_ELEVATION` - Pending Elevation * `PENDING_RESTRICTION` - Pending Restriction * `PENDING_UNPUBLISH` - Pending Unpublish * `PENDING_ALLOWLIST` - Pending Allow List Change * `APPROVED_PENDING_IMAGE_PUBLISH` - Approved Pending Image Publish
  - Allowed values: `PENDING`, `APPROVED`, `DENIED`, `REMOVED`, `CANCELLED`, `PENDING_ELEVATION`, `PENDING_RESTRICTION`, `PENDING_UNPUBLISH`, `PENDING_ALLOWLIST`, `APPROVED_PENDING_IMAGE_PUBLISH`
- `publicly_published` (boolean, required) — Whether the resource is published to all users (public) vs restricted to the allow-list. Set by the community manager at approval time. This is the single source of truth for public vs restricted visibility.
- `prefer_public` (boolean, required) — Whether the requester prefers public publishing.
- `justification` (string, required) — Optional text from the requester explaining who/why to share.
- `allowed_orgs_request_text` (string, required) — Free-text hint from the requester describing which orgs should have access for restricted publishing. Not the authoritative allow list.
- `denial_reason` (string, required) — Reason provided by community manager when denying this record.
- `requested_at` (datetime, required, nullable) — When the current request was submitted. Cleared when the requester cancels without a review.
- `reviewed_at` (datetime, required, nullable) — When a community manager or privileged actor last reviewed the current or most recent request (approve, deny, or immediate visibility change).

## Errors

### 400 Bad Request Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `type` (enum, required) — Specific type of a 400 error. * `PROTECTED` - Instance may not be deleted as it is being referenced by other instances. * `VALIDATION` - Validation errors encountered during payload processing.
  - Allowed values: `PROTECTED`, `VALIDATION`
- `protected_instances` (list of object, optional) — Instances which bar the current instance from being deleted. Only defined when `type` is set to `PROTECTED`.
  - `id` (string, required) — ID of the instance.
  - `type` (string, required) — Type of the instance.
- `validation_errors` (map from string to list of object or object or map from string to any or list of object, optional) — Validation errors encountered during payload processing. Only defined when `type` is set to `VALIDATION`.

### 403 Forbidden Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.

### 404 Not Found Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `detail` (string, optional, default: No object matches the given query.) — Description of an error.

### 500 Internal Server Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `code` (string, required) — Error code which identifies the error. Should be provided when opening a support case.
- `detail` (string, optional, default: An unexpected error has occurred. Please contact NVIDIA Air support for further assistance.) — Description of an error.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "string",
  "created": "2024-01-15T09:30:00Z",
  "modified": "2024-01-15T09:30:00Z",
  "marketplace_demo": "string",
  "marketplace_demo_name": "string",
  "requested_by": "string",
  "requesting_org": "string",
  "requesting_org_display_name": "string",
  "requesting_org_ngc_org_name": "string",
  "reviewed_by": "string",
  "status": "PENDING",
  "publicly_published": true,
  "prefer_public": true,
  "justification": "string",
  "allowed_orgs_request_text": "string",
  "denial_reason": "string",
  "requested_at": "2024-01-15T09:30:00Z",
  "reviewed_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dsx-air.nvidia.com/api/v3/publishing/marketplace-demo-publish-access-records/id/approve/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```