Skip to main content

Environments

Base URLs

  • REST API: https://api.metabind.ai/app/v1
  • GraphQL API: https://api.metabind.ai/graphql
  • CDN: https://cdn.metabind.ai

URL Structure

REST API Path Pattern

All REST API endpoints follow this pattern:
https://api.metabind.ai/app/v1/organizations/{organizationId}/projects/{projectId}/[resource]
Example paths:
ResourcePath
List components/app/v1/organizations/org123/projects/proj456/components
Get content/app/v1/organizations/org123/projects/proj456/content/cont789
Upload asset/app/v1/organizations/org123/projects/proj456/assets
Create package/app/v1/organizations/org123/projects/proj456/packages

CDN Asset URLs

Assets are served from the CDN with this pattern:
https://cdn.metabind.ai/{organizationId}/{projectId}/assets/{assetId}/{filename}

API Versioning

The API uses semantic versioning in the URL path (e.g., /app/v1/).
VersionStatusDescription
v1CurrentInitial release with core functionality

Versioning Policy

  • Breaking changes are introduced in new major versions (v2, v3, etc.)
  • Backward-compatible changes may be added to existing versions
  • Deprecated features will be announced with a migration timeline
  • Old versions will be supported for at least 12 months after a new major version

Response Format

All successful responses follow a consistent format:
{
  "data": {
    // Response data
  },
  "meta": {
    "requestId": "unique-request-identifier",
    "timestamp": "2024-03-21T10:00:00Z"
  }
}

Paginated Responses

List endpoints include pagination information:
{
  "data": [
    { "id": "item1", "name": "First Item" },
    { "id": "item2", "name": "Second Item" }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 42,
    "pages": 3,
    "lastKey": "encoded-pagination-key"
  },
  "meta": {
    "requestId": "req-123",
    "timestamp": "2024-03-21T10:00:00Z"
  }
}
FieldDescription
pageCurrent page number
limitItems per page
totalTotal number of items
pagesTotal number of pages
lastKeyCursor for next page (use in subsequent request)

Pagination Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber20Items per page (max: 100)
lastKeystring-Pagination cursor from previous response

Request Headers

Required Headers

x-api-key: YOUR_API_KEY
Content-Type: application/json

Optional Headers

HeaderDescription
Accept-LanguagePreferred response language
X-Request-IDCustom request identifier for tracing

Configuring Your Application

Environment Variables

METABIND_API_URL=https://api.metabind.ai/app/v1
METABIND_CDN_URL=https://cdn.metabind.ai

JavaScript Example

const config = {
  apiUrl: process.env.METABIND_API_URL || 'https://api.metabind.ai/app/v1',
  cdnUrl: process.env.METABIND_CDN_URL || 'https://cdn.metabind.ai',
  apiKey: process.env.METABIND_API_KEY
};

class MetabindClient {
  constructor(config) {
    this.apiUrl = config.apiUrl;
    this.cdnUrl = config.cdnUrl;
    this.apiKey = config.apiKey;
  }

  async getContent(orgId, projectId, contentId) {
    const url = `${this.apiUrl}/organizations/${orgId}/projects/${projectId}/content/${contentId}`;
    const response = await fetch(url, {
      headers: {
        'x-api-key': this.apiKey,
        'Content-Type': 'application/json'
      }
    });
    return response.json();
  }
}

Health Check

GET https://api.metabind.ai/health
Response:
{
  "status": "healthy",
  "version": "1.0.0",
  "timestamp": "2024-03-21T10:00:00Z"
}