> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Resolved Content

> Get content with all dependencies resolved and ready for rendering

Retrieves everything needed to render a content item, including its compiled code, assets, and all resolved package dependencies. This is the format used by client SDKs to render content.

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="id" type="string" required>
  Content ID
</ParamField>

## Response

<ResponseField name="content" type="string">
  The compiled BindJS code for this content, ready for execution
</ResponseField>

<ResponseField name="package" type="object">
  The main package containing the components used by this content

  <Expandable title="properties">
    <ResponseField name="version" type="string">Package version</ResponseField>
    <ResponseField name="components" type="object">Map of component names to compiled JavaScript code</ResponseField>
    <ResponseField name="assets" type="object">Map of component names to their asset arrays</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="dependencies" type="object">
  Map of dependency identifiers to their resolved content
</ResponseField>

### Example Response

```json theme={null}
{
  "content": "const body = () => { const props = {title: 'Getting Started', subtitle: 'Your complete guide', heroImage: 'asset124', author: 'Jane Doe', components: [...]}; return ArticleLayout(props); }",
  "package": {
    "version": "1.0.0",
    "components": {
      "ArticleLayout": "const body = (props, children) => { return VStack([Header(props), ...children]); }",
      "ArticleParagraph": "const body = (props) => { return Text(props.text); }",
      "ArticleHeading": "const body = (props) => { return Text(props.text).font(.headline); }",
      "ArticleImage": "const body = (props) => { return Image(props.image); }"
    },
    "assets": {
      "ArticleLayout": [
        { "name": "hero-image", "url": "https://cdn.metabind.ai/assets/hero-image.jpg" }
      ],
      "ArticleImage": [
        { "name": "dashboard-screenshot", "url": "https://cdn.metabind.ai/assets/dashboard.png" }
      ]
    }
  },
  "dependencies": {
    "shared-ui@2.0.0": {
      "components": {
        "Button": "const body = (props, children) => { ... }",
        "Card": "const body = (props, children) => { ... }"
      },
      "assets": {}
    }
  }
}
```

## Use Cases

### Mobile SDK Integration

The resolved format is optimized for client SDKs:

```swift theme={null}
// iOS Swift example
let resolved = try await metabind.getResolvedContent(id: "cont123")

// Execute content code
let contentCode = resolved.content

// Access package components
let articleLayout = resolved.package.components["ArticleLayout"]

// Access dependency components
let button = resolved.dependencies["shared-ui@2.0.0"]?.components["Button"]
```

### Web Rendering

```javascript theme={null}
const resolved = await metabind.getResolvedContent('cont123');

// Execute content code with package context
const componentCode = resolved.content;
const packageComponents = resolved.package.components;

// Render with all dependencies available
const renderer = new BindJSRenderer(packageComponents, resolved.dependencies);
renderer.render(componentCode);
```

<Note>
  When accessed with API keys, returns the latest published version. For optimization scenarios where packages are cached locally, use the standard `/content/{id}` endpoint to fetch just the content with the `compiled` field.
</Note>

## Error Responses

### Content Not Found

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Content not found"
  }
}
```

### Not Published

When accessed via API key, only published content is returned:

```json theme={null}
{
  "error": {
    "code": "NOT_PUBLISHED",
    "message": "Content is not published"
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/resolved" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/cont123/resolved',
    {
      headers: {
        'Authorization': 'Bearer YOUR_JWT'
      }
    }
  );

  const resolved = await response.json();

  console.log(`Content ready to render`);
  console.log(`Package version: ${resolved.package.version}`);
  console.log(`Components: ${Object.keys(resolved.package.components).join(', ')}`);
  console.log(`Dependencies: ${Object.keys(resolved.dependencies).join(', ')}`);
  ```
</CodeGroup>
