get-components

List your website's component schemas

Returns every custom component (content-type schema) of a website, with its field definitions. Built-in presets are not included.

Authentication

An API key, sent as the x-api-key header or the api_key query parameter.

Query parameters

ParameterTypeRequiredDescription
websiteIdUUIDYesWebsite to read
statestringNoFilter by draft, active or archived
api_keystringNoAlternative to the x-api-key header

Response 200 OK

[
  {
    "id": "03c9bec6-771c-44b2-bfd0-8fd125b5d16a",
    "name": "post",
    "displayName": "Post",
    "description": null,
    "category": "Custom",
    "tags": [],
    "fields": [
      { "name": "title", "type": "string", "required": false },
      { "name": "content", "type": "richtext", "required": false }
    ],
    "titleField": null,
    "resolvedTitleField": "title",
    "routeSlugField": null,
    "slugFields": ["title"],
    "icon": null,
    "source": "custom",
    "state": "active",
    "version": 6
  }
]

Example

curl "$MEDIAN_API_URL/components?websiteId=$WEBSITE_ID&state=active" \
  -H "x-api-key: $MEDIAN_API_KEY"

Errors

StatusCause
400Missing or invalid websiteId
401Missing or invalid API key
403API key has no organization