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
| Parameter | Type | Required | Description |
|---|---|---|---|
websiteId | UUID | Yes | Website to read |
state | string | No | Filter by draft, active or archived |
api_key | string | No | Alternative 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
| Status | Cause |
|---|---|
400 | Missing or invalid websiteId |
401 | Missing or invalid API key |
403 | API key has no organization |