> 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.

# Mint a studio token for one asset

POST https://api.athenaintel.com/api/v0/assets/{asset_id}/studio-token
Content-Type: application/json

Mint a short-lived asset token for the service that edits an asset: a spreadsheet's, a Word document's or a deck's, named in ``audience``. The token names the caller, this asset and one access level, lasts 15 minutes and is good only on that service's routes for this asset, so code (an SDK in a computer, for example) never sends the service a long-lived credential. The caller must be able to view the asset and be a member of its workspace; the token is read-write only when the caller can edit the asset and asked for edit. A computer's or session's credential mints tokens for assets of its own workspace only. With audience 'pptx-studio-source' it mints the read-only token the deck editing service reads a spreadsheet, figure or semantic model with for a linked table, OLE object or chart; a recording's token is always that one. Any other asset (another type, a live provider file, or one outside every workspace) is refused with 422.

Reference: https://docs.athenaintel.com/api-reference/assets/create-studio-token

## Authentication

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

## Request

### Path parameters

- `asset_id` (string, required) — The spreadsheet, Word document or deck to mint a token for

### Body (application/json)

This endpoint expects a StudioTokenRequestIn.

- `access` (enum, optional, default: edit) — 'edit' asks for a read-write token and gets one only when the caller can edit the asset (and it is not archived); 'view' always gets a read-only token. Omitted, the token carries the caller's own access.
  - Allowed values: `view`, `edit`
- `audience` ("pptx-studio-source", optional, nullable) — Omitted, the token is for the service that edits the asset. 'pptx-studio-source' asks for the read-only token the deck editing service reads a spreadsheet, figure or semantic model with for a linked table, OLE object or chart on a deck; send it beside the deck's own token. A recording's token is always that one: a deck placing a range of it is the one service that reads it. A token for this audience only reads, whatever 'access' asks.

## Response

### 200

Successful Response

- `access_type` (enum, required) — The access the token carries: r reads only (the service refuses its writes), rw reads and writes. The service still checks the caller's live permission on every request.
  - Allowed values: `r`, `rw`
- `asset_id` (string, required) — The asset the token is for.
- `audience` (enum, required) — The service the token is for, as the token's audience identifier: the editing service of spreadsheets, of Word documents or of decks, or 'pptx-studio-source', the deck editing service reading this asset for a deck (a recording, or a source asked for with 'audience'). Compare it with the service you call before sending the token.
  - Allowed values: `docx-studio`, `pptx-studio`, `pptx-studio-source`, `xlsx-studio`
- `expires_at_ms` (integer, required) — Expiry in epoch milliseconds, at most 15 minutes from now. Mint a new token before it passes.
- `token` (string, required) — The asset token (`aat_…`). Send it as `Authorization: Bearer <token>` to the editing service `audience` names, on its routes for this asset only: it names one user, this asset, one access level and that service, and every other route and service refuses it.
- `deck_id` (string, optional, nullable) — For a deck, the id the deck's editing service names it by in its routes (an older deck's own deck id, else its asset id); the token is good for that id. Null for any other asset.

## Errors

### 400 Bad Request Error

A versioned asset id

- `any`

### 403 Forbidden Error

The caller is not a member of the asset's workspace

- `any`

### 404 Not Found Error

The asset does not exist, the caller may not read it, or it is outside the workspace the caller's credential is bound to

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 503 Service Unavailable Error

This deployment signs no asset tokens

- `any`

## 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
{
  "access": "edit"
}
```

**Response**

```json
{
  "access_type": "rw",
  "asset_id": "asset_92492920-d118-42d3-95b4-00eccfe0754f",
  "audience": "xlsx-studio",
  "expires_at_ms": 1798654500000,
  "token": "aat_<signed JWT>"
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/assets/asset_id/studio-token"

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

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

print(response.json())
```

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

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.athenaintel.com/api/v0/assets/asset_id/studio-token"

	payload := strings.NewReader("{\n  \"access\": \"edit\"\n}")

	req, _ := http.NewRequest("POST", 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
require 'uri'
require 'net/http'

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

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

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

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.post("https://api.athenaintel.com/api/v0/assets/asset_id/studio-token")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"access\": \"edit\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["access": "edit"] 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/studio-token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```