# Get bundle sharing

Inspect content visibility, public-web publication and active share-link metadata without creating or revealing bearer share links.

POST https://api.brigg.app/v1/operations/documents.GetBundleSharing

## Access & visibility

Allow `documents.GetBundleSharing` on your API key.

**Acting member required.** Send `Brigg-Act-As` with an [approved member account ID](https://developer.brigg.app/authentication#member-delegation). The key supplies permissions; the member selects whose data is used.

The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `content_id` | string | Yes | Content identity from ListBundles. For generated documents this is the document_id used by ShareDocument; it is not an uploaded or collaborative text file_id. At least 1 character. |

## Interpret base access and outward sharing

Find content_id with [List bundles](https://developer.brigg.app/reference/workspace/ListBundles). Workspace content can be inspected by a member with access; private content requires its owner or an authorized workspace manager. The key still needs approved member delegation.

base describes access inside Brigg. audience also considers active links and public-web publication. A private base with audience=link is possible: the owner's private content has been shared with link holders. This operation changes none of those settings.

For generated documents, use [Share document](https://developer.brigg.app/reference/documents/ShareDocument) to create a link and retain its URL, or [Revoke document share](https://developer.brigg.app/reference/documents/RevokeDocumentShare) with links[].share_id to withdraw one. Metadata does not reveal existing bearer URLs. Uploaded files and collaborative text documents use their separate file and text-sharing operations.

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `content_id` | string | Yes | Opaque ID from workspace.ListBundles. Its kind distinguishes apps, websites, newsletters, documents, templates and integrations; it is not an uploaded file ID. |
| `label` | string | Yes | Human-readable name for this content or saved version. |
| `audience` | string | Yes | Widest active audience: private, workspace, link or web. Web takes precedence over link; when neither exists this equals base. |
| `base` | string | Yes | Underlying access inside Brigg: private or workspace. Share links and public-web publication add audiences without changing this base. This is not a version ID. |
| `web` | boolean | Yes | True only when deliberately published on the public web. Saving or sharing with the workspace alone does not set this flag. |
| `public_url` | string or null | Yes | Public website URL when web=true; otherwise null. This is distinct from a private bearer share link. |
| `links` | array of [object](#response-links) | Yes | Active, unexpired share-link metadata. No usable bearer URLs or tokens are returned; keep a new link's URL when ShareDocument creates it. |

### response.links[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `share_id` | string | Yes | Non-secret management ID. Pass it with this content's document_id to RevokeDocumentShare; it cannot open the content. |
| `created_at` | number | Yes | Creation timestamp in Unix milliseconds. |
| `created_by` | string | Yes | Account ID responsible for creating this item. |
| `expires_at` | number or null | Yes | Expiry in Unix milliseconds, or null when no expiry is recorded. |
| `version_id` | string | Yes | Saved content version fixed by this link. Later edits do not change what this link shares. |

## Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | The acting member must be allowed to act on this content. Private content requires its owner or an authorized workspace manager; the key's delegation grant still applies. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |

## Next steps

- [List bundles](https://developer.brigg.app/reference/workspace/ListBundles)
- [Share document](https://developer.brigg.app/reference/documents/ShareDocument)
- [Revoke document share](https://developer.brigg.app/reference/documents/RevokeDocumentShare)

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Workspace content without outward links

No web publication or active bearer links.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/documents.GetBundleSharing' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Brigg-Act-As: $BRIGG_ACT_AS" \
  --data-raw '{
  "content_id": "c_proposal"
}'
```

#### TypeScript


```typescript
const actAs = process.env.BRIGG_ACT_AS;
if (!actAs) throw new Error("Set BRIGG_ACT_AS to an approved member account ID.");

const response = await fetch("https://api.brigg.app/v1/operations/documents.GetBundleSharing", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
    "Brigg-Act-As": actAs,
  },
  body: JSON.stringify({
    "content_id": "c_proposal"
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "content_id": "c_proposal"
}
request = Request(
    "https://api.brigg.app/v1/operations/documents.GetBundleSharing",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
        "Brigg-Act-As": os.environ["BRIGG_ACT_AS"],
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "content_id": "c_proposal",
  "label": "Consulting proposal",
  "audience": "workspace",
  "base": "workspace",
  "web": false,
  "public_url": null,
  "links": []
}
```

### Private content with a live share link

The link adds access for its holders without changing the private base.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/documents.GetBundleSharing' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Brigg-Act-As: $BRIGG_ACT_AS" \
  --data-raw '{
  "content_id": "c_proposal"
}'
```

#### TypeScript


```typescript
const actAs = process.env.BRIGG_ACT_AS;
if (!actAs) throw new Error("Set BRIGG_ACT_AS to an approved member account ID.");

const response = await fetch("https://api.brigg.app/v1/operations/documents.GetBundleSharing", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
    "Brigg-Act-As": actAs,
  },
  body: JSON.stringify({
    "content_id": "c_proposal"
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "content_id": "c_proposal"
}
request = Request(
    "https://api.brigg.app/v1/operations/documents.GetBundleSharing",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
        "Brigg-Act-As": os.environ["BRIGG_ACT_AS"],
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "content_id": "c_proposal",
  "label": "Consulting proposal",
  "audience": "link",
  "base": "private",
  "web": false,
  "public_url": null,
  "links": [
    {
      "share_id": "share_proposal",
      "created_at": 1794301200000,
      "created_by": "a_alex",
      "expires_at": 1794906000000,
      "version_id": "v_proposal_3"
    }
  ]
}
```

### Published on the web

The public URL is present only while web publication is active.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/documents.GetBundleSharing' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Brigg-Act-As: $BRIGG_ACT_AS" \
  --data-raw '{
  "content_id": "c_proposal"
}'
```

#### TypeScript


```typescript
const actAs = process.env.BRIGG_ACT_AS;
if (!actAs) throw new Error("Set BRIGG_ACT_AS to an approved member account ID.");

const response = await fetch("https://api.brigg.app/v1/operations/documents.GetBundleSharing", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
    "Brigg-Act-As": actAs,
  },
  body: JSON.stringify({
    "content_id": "c_proposal"
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "content_id": "c_proposal"
}
request = Request(
    "https://api.brigg.app/v1/operations/documents.GetBundleSharing",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
        "Brigg-Act-As": os.environ["BRIGG_ACT_AS"],
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "content_id": "c_proposal",
  "label": "Consulting proposal",
  "audience": "web",
  "base": "workspace",
  "web": true,
  "public_url": "https://example.com/proposal",
  "links": []
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "content_id": {
      "type": "string",
      "minLength": 1,
      "description": "Content identity from ListBundles. For generated documents this is the document_id used by ShareDocument; it is not an uploaded or collaborative text file_id."
    }
  },
  "required": [
    "content_id"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "content_id": "c_proposal"
    }
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "content_id": {
      "type": "string",
      "description": "Opaque ID from workspace.ListBundles. Its kind distinguishes apps, websites, newsletters, documents, templates and integrations; it is not an uploaded file ID."
    },
    "label": {
      "type": "string",
      "description": "Human-readable name for this content or saved version."
    },
    "audience": {
      "type": "string",
      "description": "Widest active audience: private, workspace, link or web. Web takes precedence over link; when neither exists this equals base."
    },
    "base": {
      "type": "string",
      "description": "Underlying access inside Brigg: private or workspace. Share links and public-web publication add audiences without changing this base. This is not a version ID."
    },
    "web": {
      "type": "boolean",
      "description": "True only when deliberately published on the public web. Saving or sharing with the workspace alone does not set this flag."
    },
    "public_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public website URL when web=true; otherwise null. This is distinct from a private bearer share link."
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "share_id": {
            "type": "string",
            "description": "Non-secret management ID. Pass it with this content's document_id to RevokeDocumentShare; it cannot open the content."
          },
          "created_at": {
            "type": "number",
            "description": "Creation timestamp in Unix milliseconds."
          },
          "created_by": {
            "type": "string",
            "description": "Account ID responsible for creating this item."
          },
          "expires_at": {
            "type": [
              "number",
              "null"
            ],
            "description": "Expiry in Unix milliseconds, or null when no expiry is recorded."
          },
          "version_id": {
            "type": "string",
            "description": "Saved content version fixed by this link. Later edits do not change what this link shares."
          }
        },
        "required": [
          "share_id",
          "created_at",
          "created_by",
          "expires_at",
          "version_id"
        ],
        "additionalProperties": false
      },
      "description": "Active, unexpired share-link metadata. No usable bearer URLs or tokens are returned; keep a new link's URL when ShareDocument creates it."
    }
  },
  "required": [
    "content_id",
    "label",
    "audience",
    "base",
    "web",
    "public_url",
    "links"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "content_id": "c_proposal",
      "label": "Consulting proposal",
      "audience": "workspace",
      "base": "workspace",
      "web": false,
      "public_url": null,
      "links": []
    }
  ]
}
```

