POST /data-sources/{id}/publish
Bulk-creates status page components for the specified field child monitors. The status page must belong to the same organization.

Authentication

Bearer Token (hu_api_key)

Path Parameters

id string required path

Request Body required

application/json
status_page_id string REQUIRED
Target status page ID
group_id string | null
Optional component group ID
field_ids string[] REQUIRED
Field IDs whose child monitors should be added as components
Array of:

Responses

200 Components created
application/json
data object
created_component_ids string[]
Array of:
404 Data source or status page not found
curl -X POST 'https://happyuptime.com/api/v1/data-sources/string/publish' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "status_page_id": "sp_abc123",  "field_ids": [    "fid1",    "fid2"  ]}'
const response = await fetch('https://happyuptime.com/api/v1/data-sources/string/publish', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "status_page_id": "sp_abc123",    "field_ids": [      "fid1",      "fid2"    ]  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://happyuptime.com/api/v1/data-sources/string/publish', headers=headers, json={  "status_page_id": "sp_abc123",  "field_ids": [    "fid1",    "fid2"  ]})print(response.json())
200 Response
{  "data": {    "created_component_ids": [      "<string>"    ]  }}