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

# Update workspace access for an asset

PUT https://api.athenaintel.com/api/v0/assets/{asset_id}/workspace-access
Content-Type: application/json

Update the workspace-level access on an asset. Only users who have edit access to the asset and permission to share with the workspace can use this endpoint. Set 'view' or 'edit' to grant workspace-wide access.

Reference: https://docs.athenaintel.com/api-reference/assets/update-workspace-access

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `asset_id` (string, required) — Unique identifier of the asset

### Body (application/json)

This endpoint expects an UpdateWorkspaceAccessRequestIn.

- `workspace_access` (enum, required) — Permission level to grant to the entire workspace. Set to 'view' or 'edit'.
  - Allowed values: `view`, `edit`

## Response

### 200

Workspace access updated successfully

- `asset_id` (string, required) — ID of the asset
- `workspace_access` (string, required) — Workspace access level that was set ('view' or 'edit')

## Errors

### 403 Forbidden Error

Forbidden - caller does not have permission

- `message` (string, required)

### 404 Not Found Error

Asset not found

- `message` (string, required)

### 409 Conflict Error

The asset is archived (in the trash) and the change would widen its workspace share: restore it to share it. Narrowing or re-setting the current level still succeeds.

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "workspace_access": "view"
}
```

**Response**

```json
{
  "asset_id": "asset_92492920-d118-42d3-95b4-00eccfe0754f",
  "workspace_access": "view"
}
```

**SDK Code**

```python assets_update_workspace_access_example
import requests

url = "https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access"

payload = { "workspace_access": "view" }
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript assets_update_workspace_access_example
const url = 'https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access';
const options = {
  method: 'PUT',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"workspace_access":"view"}'
};

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

```go assets_update_workspace_access_example
package main

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

func main() {

	url := "https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access"

	payload := strings.NewReader("{\n  \"workspace_access\": \"view\"\n}")

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

	req.Header.Add("X-API-KEY", "<apiKey>")
	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 assets_update_workspace_access_example
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access")

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

request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"workspace_access\": \"view\"\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"workspace_access\": \"view\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access', [
  'body' => '{
  "workspace_access": "view"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp assets_update_workspace_access_example
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"workspace_access\": \"view\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift assets_update_workspace_access_example
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["workspace_access": "view"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/assets/asset_id/workspace-access")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```