Back

    Buyamia Directory API

    v1.0

    Authentication

    The Directory API uses API Key authentication for machine-to-machine access. Every request must include a valid API key in the X-API-Key HTTP header.

    GET /v1/businesses HTTP/1.1
    Host: rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-api
    X-API-Key: bym_live_a1b2c3d4e5f6...
    Content-Type: application/json

    API Key Format

    API keys are 48-character random strings prefixed with bym_. The key prefix (first 8 characters) is stored for identification, while the full key is hashed with SHA-256 before storage.

    PropertyValue
    Header nameX-API-Key
    Key length48 characters
    Key formatbym_ + 44 random alphanumeric characters
    Hash algorithmSHA-256
    StorageOnly the hash is stored; the raw key is shown once at creation

    Permission Scopes

    Each API key has a set of permission scopes that determine which endpoints it can access. Request only the scopes you need.

    ScopeDescriptionEndpoints
    businesses.readRead business dataGET /v1/businesses/*
    businesses.writeCreate/update businessesPOST/PUT /v1/businesses/*
    products.readRead product dataGET /v1/products/*
    products.writeCreate/update productsPOST/PUT /v1/products/*
    categories.readRead categoriesGET /v1/categories/*, GET /v1/product-categories
    regions.readRead regions and countriesGET /v1/regions/*, GET /v1/countries
    rfq.writeCreate and manage RFQsPOST/PUT /v1/rfq/*
    rfq.readRead RFQs and quotesGET /v1/rfq/*
    quotes.writeSubmit supplier quotesPOST /v1/rfq/:id/quotes
    searchKeyword, semantic & hybrid searchGET /v1/search, /v1/semantic-search, /v1/hybrid-search
    agent.queryAI Agent Gateway accessPOST agent-gateway
    webhooks.manageManage webhook subscriptions/v1/webhooks/*

    Rate Limiting

    Each API key has a configurable rate limit (default: 60 requests per minute). When the limit is exceeded, the API returns a 429 Too Many Requests response.

    Rate Limit Error Responsejson
    {
      "error": "Rate limit exceeded. Try again in 45 seconds.",
      "data": null
    }

    Authentication Errors

    StatusErrorCause
    401Missing API keyNo X-API-Key header provided
    401Invalid API keyKey not found or has been deactivated
    401API key expiredKey has passed its expires_at date
    403Insufficient permissionsKey does not have the required scope for this endpoint
    Last updated on February 23, 2026