Skip to content

Get Generation Result

Method

This API follows the REST methodology.

HTTP Method

GET: Read a completed generation's DesignSpec โ€” the document the plugin materializes into Figma.

Naming Convention

The response is proxied verbatim from the internal wf2des-api data plane, so its fields are snake_case โ€” unlike the camelCase used by the row endpoints. The shape is worker-owned.

Request and Response

Headers

Request Headers

  • Authorization
  • Accept
  • Accept-language

Response Headers

  • Content-Type

Get Result

URI

GET /api/v1/organizations/{organization_id}/projects/{project_id}/wf2des/{wf2des_id}/result

Path Parameters

Name Type Required Description
organization_id integer Required Organization ID
project_id integer Required Project ID
wf2des_id string Required wf2des ID

Response

The response is JSON (HTTP status: 200 OK).

{
  "wf2des_id": "wf2des-001",
  "spec": {
    "root": { "type": "frame", "children": [] },
    "spec_nodes_flat": []
  },
  "confidence": {
    "score": 0.82,
    "flag_count": 3
  },
  "artifact_urls": {
    "parse": "1/7/wf2des/wf2des-001/1-parse.json",
    "result": "1/7/wf2des/wf2des-001/1-result.json",
    "manifest": "1/7/wf2des/wf2des-001/1-manifest.json"
  }
}

Response Fields

Name Type Description
wf2des_id string The run this result belongs to.
spec object | null The DesignSpec the plugin materializes โ€” the assembled node tree with its component bindings.
confidence object | null The run's confidence block, including flag_count (how many nodes were flagged for review).
artifact_urls object Bare S3 keys for the run's immutable artifacts (parse, result, manifest, and spec when spilled).

Large specs are transparent to the caller. A spec over roughly 1 MB is spilled to its own S3 object at generation time and stored out of the document; this endpoint reads it back inline and returns it in the same field. The caller always sees a populated spec, never a pointer to follow.

Authentication

Authentication is performed using JSON Web Tokens (JWT) issued by Amazon Cognito. The caller must additionally hold access to the project.

Error Handling

Description Status Code Status Name
Missing authentication credentials 401 Unauthorized
Insufficient permissions 403 Forbidden
Result not found โ€” unknown wf2des_id, or the run has not produced one yet 404 Not Found
Upstream read failure (wf2des-api or S3) 500 Internal Server Error

A run that is still parsing or assembling returns 404 here โ€” the result document exists only once assemble has written its terminal blocks. Poll the row through GET โ€ฆ/wf2des/{wf2des_id} to know when it is ready.

Processing Flow

  1. Extract organization ID, project ID and wf2des_id from path parameters.
  2. Verify the user has access to the project.
  3. Proxy the read to the internal wf2des-api data plane (X-AI-Service-Token), scoped to the organization and project.
  4. The data plane loads the design_generation_result document; when spec is absent and a spilled artifact_urls.spec is present, it reads that object inline.
  5. Return the document verbatim.