Skip to main content
GET
/
routes
/
from-upload
Route Discovery
curl --request GET \
  --url https://api.superseeded.ai/v1/routes/from-upload
{
  "routes": [
    {
      "id": "verify-pot-sizes",
      "name": "Verify Pot Sizes",
      "description": "Classify pot sizes and plant specifications into Growth Equivalent Hierarchy categories",
      "endpoint": "/v1/verify/pot-sizes",
      "method": "POST",
      "requires_auth": true,
      "accepted_file_types": [
        ".json",
        ".xlsx",
        ".xls",
        ".pdf",
        ".txt",
        ".png",
        ".jpg",
        ".jpeg",
        ".gif",
        ".webp"
      ],
      "category": "enrichment"
    }
  ],
  "version": "1.0"
}

Overview

The route discovery endpoint returns a list of available API routes that can be called after a file upload completes. This allows integrations (like the WordPress plugin) to dynamically discover what processing options are available.
This endpoint is public and does not require authentication. This allows clients to discover available routes before the user authenticates.

Request

curl https://api.superseeded.ai/v1/routes/from-upload
No request body or authentication is required.

Response

routes
array
required
List of available post-upload processing routes
version
string
required
API version for the route schema (currently 1.0)

Example Response

{
  "routes": [
    {
      "id": "verify-pot-sizes",
      "name": "Verify Pot Sizes",
      "description": "Classify pot sizes and plant specifications into Growth Equivalent Hierarchy categories",
      "endpoint": "/v1/verify/pot-sizes",
      "method": "POST",
      "requires_auth": true,
      "accepted_file_types": [".json", ".xlsx", ".xls", ".pdf", ".txt", ".png", ".jpg", ".jpeg", ".gif", ".webp"],
      "category": "enrichment"
    }
  ],
  "version": "1.0"
}

Usage

WordPress Plugin

The WordPress plugin uses this endpoint to populate the “Post-Upload Processing” settings field. Routes are cached for 1 hour using WordPress transients.
$response = wp_remote_get('https://api.superseeded.ai/v1/routes/from-upload');
$body = json_decode(wp_remote_retrieve_body($response), true);
$routes = $body['routes'];

JavaScript

Frontend integrations can fetch available routes to build dynamic UIs:
fetch('https://api.superseeded.ai/v1/routes/from-upload')
  .then(response => response.json())
  .then(data => {
    data.routes.forEach(route => {
      console.log(`${route.name}: ${route.description}`);
    });
  });

Calling Discovered Routes

After discovering routes, call them with the file URL and delegation token:
// For each enabled route
const response = await fetch(apiBaseUrl + route.endpoint, {
  method: route.method,
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + delegationToken  // if requires_auth is true
  },
  body: JSON.stringify({ file_url: uploadedFileUrl })
});

Caching Recommendations

  • Cache duration: Routes rarely change, so cache for 1-24 hours
  • Cache invalidation: Provide a manual refresh option for administrators
  • Fallback: If the endpoint is unreachable, use a hardcoded default route list

Response

200 - application/json

List of available post-upload processing routes

routes
object[]

List of available post-upload processing routes

version
string

API version for the route schema

Example:

"1.0"