.do

APIs.as

Tenant-specific API endpoints

APIs.as

APIs.as provides tenant-specific API endpoints for accessing your namespace resources and data.

Overview

While APIs.do provides access to platform primitives and integrations, APIs.as gives you a dedicated endpoint for your specific tenant/namespace.

URL Formats

All of these URLs are equivalent and access the same tenant-specific API:

# Standard format
https://apis.do/startups.studio/apis

# Tenant-specific subdomain
https://apis.as/startups.studio

# Custom tenant API subdomain
https://api.startups.studio

# Tenant path
https://startups.studio/api

Quick Start

# Get your tenant API info
curl -H "Authorization: Bearer $API_KEY" \
  https://apis.as/startups.studio

# Access tenant resources
curl -H "Authorization: Bearer $API_KEY" \
  https://apis.as/startups.studio/businesses

# Use custom subdomain
curl -H "Authorization: Bearer $API_KEY" \
  https://api.startups.studio/businesses

Response Format

Tenant-specific API responses follow the same HATEOAS format as APIs.do:

{
  "$id": "https://apis.as/startups.studio",
  "$context": "https://platform.do",
  "$type": "https://schema.org.ai/TenantAPI",
  "api": {
    "version": "1.0.0",
    "tenant": "startups.studio",
    "endpoint": "https://apis.as/startups.studio",
    "documentation": "https://docs.platform.do/api",
    "status": "https://status.platform.do"
  },
  "links": {
    "tenant": {
      "self": "https://apis.as/startups.studio",
      "portal": "https://startups.studio",
      "dashboard": "https://startups.studio/dashboard"
    },
    "resources": {
      "businesses": "https://apis.as/startups.studio/businesses",
      "teams": "https://apis.as/startups.studio/teams",
      "agents": "https://apis.as/startups.studio/agents",
      "workflows": "https://apis.as/startups.studio/workflows",
      "functions": "https://apis.as/startups.studio/functions",
      "databases": "https://apis.as/startups.studio/databases"
    },
    "integrations": {
      "github": "https://apis.as/startups.studio/github",
      "stripe": "https://apis.as/startups.studio/stripe",
      "slack": "https://apis.as/startups.studio/slack"
    },
    "docs": {
      "api": "https://docs.platform.do/api",
      "guides": "https://docs.platform.do/guides",
      "tenant": "https://docs.startups.studio"
    }
  },
  "readme": [
    "# Startups.Studio API",
    "Tenant-specific API for startups.studio namespace.",
    "",
    "Access your businesses, teams, agents, workflows, and integrations",
    "through this dedicated endpoint with tenant-scoped authentication."
  ],
  "data": {
    "tenant": "startups.studio",
    "name": "Startups Studio",
    "description": "Startup acceleration and business automation platform",
    "plan": "business",
    "created": "2024-01-15",
    "resources": {
      "businesses": 12,
      "teams": 8,
      "agents": 24,
      "workflows": 45,
      "functions": 89
    }
  },
  "user": {
    "$id": "https://apis.as/startups.studio/users/jane-doe",
    "name": "Jane Doe",
    "email": "[email protected]",
    "role": "admin",
    "permissions": ["read", "write", "delete", "admin"],
    "links": {
      "resource": {
        "self": "https://apis.as/startups.studio/users/jane-doe"
      },
      "related": {
        "businesses": "https://apis.as/startups.studio/users/jane-doe/businesses",
        "workflows": "https://apis.as/startups.studio/users/jane-doe/workflows"
      }
    }
  },
  "meta": {
    "created": "2024-01-15T10:00:00Z",
    "updated": "2024-11-12T08:30:00Z",
    "version": 5,
    "etag": "x1y2z3a4b5c6"
  }
}

URL Aliases

Choose the format that best fits your use case:

1. Platform Path

  • Use case: Discovering tenant APIs from platform
  • Example: https://apis.do/startups.studio/apis

2. Tenant Subdomain

  • Use case: Direct tenant access with short URL
  • Example: https://apis.as/startups.studio

3. Custom API Subdomain

https://api.[tenant]
  • Use case: Custom branded API endpoint
  • Example: https://api.startups.studio

4. Tenant Path

https://[tenant]/api
  • Use case: API as part of tenant portal
  • Example: https://startups.studio/api

Tenant Scope

All requests to APIs.as are automatically scoped to your tenant:

Authentication

Tenant-specific API keys automatically scope to your tenant:

# Tenant-scoped API key
export TENANT_API_KEY="tenant_sk_..."

# Access your tenant
curl -H "Authorization: Bearer $TENANT_API_KEY" \
  https://apis.as/startups.studio/businesses

# Works with any URL format
curl -H "Authorization: Bearer $TENANT_API_KEY" \
  https://api.startups.studio/businesses

Examples

TypeScript SDK

import { $ } from 'sdk.do'

// Initialize with tenant
const api = $('startups.studio')

// Access tenant resources
const businesses = await api.businesses.list()
const agents = await api.agents.list()
const workflows = await api.workflows.list()

// Create tenant-scoped resources
const business = await api.businesses.create({
  name: 'Acme Inc',
  industry: 'Technology'
})

// Access integrations with tenant scope
const repos = await api.github.repos.list()
const customers = await api.stripe.customers.list()

REST API

# List businesses in tenant
curl https://apis.as/startups.studio/businesses

# Get specific business
curl https://apis.as/startups.studio/businesses/acme-inc

# Create workflow
curl -X POST https://apis.as/startups.studio/workflows \
  -H "Content-Type: application/json" \
  -d '{
    "name": "onboarding-flow",
    "description": "Automated customer onboarding"
  }'

# Access GitHub integration (tenant-scoped)
curl https://apis.as/startups.studio/github/repos

Multi-Tenant Applications

If you're building applications that serve multiple tenants:

import { $ } from 'sdk.do'

// Dynamic tenant selection
const getTenantAPI = (tenant: string) => $(tenant)

// Access different tenants
const startups = getTenantAPI('startups.studio')
const enterprise = getTenantAPI('enterprise.co')

// Each API is tenant-scoped
const startupsBusinesses = await startups.businesses.list()
const enterpriseBusinesses = await enterprise.businesses.list()

Comparison

FeatureAPIs.doAPIs.as
ScopePlatform-wideTenant-specific
Base URLhttps://apis.dohttps://apis.as/[tenant]
ResourcesAll primitives & integrationsTenant-scoped resources
AuthenticationPlatform API keyTenant API key
Use CasePlatform operationsTenant operations
AliasesN/A4 URL formats

See Also