Skip to content
NewNexus 2.0 is here, and it’s open source. Read the launch post

API reference

Design systems

Nexus Design's design systems: the tokens and notes designs are made, served and checked with.

View as Markdown

List design systems

get/v1/design-systems

The organization's design systems for Nexus Design: the built-in @nexus/brand (brand v5.0) first, then its own by name, and the default new designs use.

chat.useEvery memberTry it in the API Explorer

Responses

200The design systemsapplication/json

  • designSystemsarray of DesignSystemrequired
    • idstringrequired

      ds_…; the built-in is ds_nexus_brand

    • namestringrequired

      @nexus/brand, or the organization's own name (acme, @acme/web)

    • builtInbooleanrequired

      Compiled into Gateway: it cannot be changed or deleted

    • isDefaultbooleanrequired

      The organization's default: new designs use it

    • sourcestringrequired

      Where it came from, in words

    • variableCountintegerrequired
    • componentCountintegerrequired
    • updatedAtstring (date-time)

      Unset for the built-in

  • defaultIdstringrequired

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/design-systems" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Save design system

post/v1/design-systems

Create the named design system, or replace its tokens, notes, components and source (what nexus design-system sync sends). Tokens come from css and from files: CSS custom properties (:root, @theme, [data-theme], .dark, .light), a Tailwind config's literal theme, and tokens.json. Only custom properties are stored. 400 design_system_empty when none are found, 400 design_system_limit past 50 per organization. Audited as design_system.saved, with counts and never the tokens.

org.settingsOwner, AdminTry it in the API Explorer

Parameters

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body · application/json

  • namestringrequired

    Lowercase; @nexus/ and ds_ are reserved

    pattern ^(@[a-z0-9][a-z0-9._-]{0,30}/)?[a-z0-9][a-z0-9._-]{0,63}$

  • cssstring

    CSS custom properties

  • filesarray of DesignSourceFile

    At most 4 MiB together

    at most 40 items

    • pathstringrequired

      Relative to the synced folder; the name says how it is read

    • textstringrequired
  • notesstring

    Markdown for the model

    max length 65536

  • componentsarray of string

    at most 500 items

  • sourcestring

    max length 500

  • makeDefaultboolean

    Make it the organization's default too

Responses

200Replacedapplication/json

  • designSystemDesignSystemrequired

    A design system for Nexus Design, as the organization lists it.

    • idstringrequired

      ds_…; the built-in is ds_nexus_brand

    • namestringrequired

      @nexus/brand, or the organization's own name (acme, @acme/web)

    • builtInbooleanrequired

      Compiled into Gateway: it cannot be changed or deleted

    • isDefaultbooleanrequired

      The organization's default: new designs use it

    • sourcestringrequired

      Where it came from, in words

    • variableCountintegerrequired
    • componentCountintegerrequired
    • updatedAtstring (date-time)

      Unset for the built-in

  • createdbooleanrequired

    False when it replaced one of the same name

  • readarray of stringrequired

    What each file gave, in words

201Createdapplication/json

  • designSystemDesignSystemrequired

    A design system for Nexus Design, as the organization lists it.

    • idstringrequired

      ds_…; the built-in is ds_nexus_brand

    • namestringrequired

      @nexus/brand, or the organization's own name (acme, @acme/web)

    • builtInbooleanrequired

      Compiled into Gateway: it cannot be changed or deleted

    • isDefaultbooleanrequired

      The organization's default: new designs use it

    • sourcestringrequired

      Where it came from, in words

    • variableCountintegerrequired
    • componentCountintegerrequired
    • updatedAtstring (date-time)

      Unset for the built-in

  • createdbooleanrequired

    False when it replaced one of the same name

  • readarray of stringrequired

    What each file gave, in words

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/design-systems" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform"
  }'

Get design system

get/v1/design-systems/{id}

A design system: its tokens as CSS and as a map of variables, its notes and its components. 404 design_system_not_found.

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The design system's id (ds_…; the built-in is ds_nexus_brand), or its name when it has no /

Responses

200The design systemapplication/json

  • idstringrequired

    ds_…; the built-in is ds_nexus_brand

  • namestringrequired

    @nexus/brand, or the organization's own name (acme, @acme/web)

  • builtInbooleanrequired

    Compiled into Gateway: it cannot be changed or deleted

  • isDefaultbooleanrequired

    The organization's default: new designs use it

  • sourcestringrequired

    Where it came from, in words

  • variableCountintegerrequired
  • componentCountintegerrequired
  • updatedAtstring (date-time)

    Unset for the built-in

  • cssstringrequired

    The tokens as CSS: selector { --name: value; } blocks and nothing else

  • variablesarray of DesignVariablerequired
    • namestringrequired

      --nx-page

    • valuestringrequired
    • selectorstringrequired

      :root, or a theme such as [data-theme="light"]

    • kind"color" | "length" | "font" | "other"required
  • notesstringrequired

    Markdown for the model

  • componentsarray of stringrequired

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/design-systems/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Delete design system

DEL/v1/design-systems/{id}

Delete a design system. When it was the default, the built-in is the default again; pages that link it are served without its tokens. 400 design_system_built_in for @nexus/brand. Audited as design_system.deleted.

org.settingsOwner, AdminTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The design system's id (ds_…; the built-in is ds_nexus_brand), or its name when it has no /

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Responses

200Deletedapplication/json

  • idstringrequired
  • deletedbooleanrequired
  • defaultIdstringrequired

    The default now

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X DELETE "$NEXUS_URL/v1/design-systems/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Set default design system

post/v1/design-systems/{id}/default

Make a design system the organization's default for new designs (the built-in too). Audited as design_system.default_set, with the default before and after.

org.settingsOwner, AdminTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The design system's id (ds_…; the built-in is ds_nexus_brand), or its name when it has no /

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Responses

200The new defaultapplication/json

  • idstringrequired

    ds_…; the built-in is ds_nexus_brand

  • namestringrequired

    @nexus/brand, or the organization's own name (acme, @acme/web)

  • builtInbooleanrequired

    Compiled into Gateway: it cannot be changed or deleted

  • isDefaultbooleanrequired

    The organization's default: new designs use it

  • sourcestringrequired

    Where it came from, in words

  • variableCountintegerrequired
  • componentCountintegerrequired
  • updatedAtstring (date-time)

    Unset for the built-in

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/design-systems/<id>/default" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"