# Add a status service (https://notert.io/docs/api/reference/add-a-status-service)

`POST /api/v1/status/services`

Adds a health check: an address Notert checks every minute, the name visitors see and the application it belongs to, added when the workspace has none by that name. It stays hidden from visitors until its first check passes. An address already checked is ALREADY_ADDED.

Access: A token with status:write.

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | No | A key of your own for this call, such as a UUID, sent again with a call made again after its answer was lost, so it stores and sends once and answers what the first stored. The same key with other words names another record. Send it or an id in the body, not both. At least 1 character. At most 255 characters. |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | uuid | No | An id of your own, a UUID, so a call sent again after its answer was lost answers the service it added rather than adding a second. Or send an Idempotency-Key header instead, not both. |
| `url` | string | Yes | The health check address to read every minute, such as api.example.com/health. Visitors never see it. At least 1 character. At most 2000 characters. |
| `name` | string | Yes | The name visitors see, at most 60 characters. At least 1 character. At most 60 characters. |
| `application` | string | Yes | The application it belongs to, by name, at most 60 characters. One by that name is added when the workspace has none. At least 1 character. At most 60 characters. |

## Response 201

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The service's id. |
| `name` | string | The application's or the service's name. |
| `url` | string | The address the service's check reads. |
| `phase` | string | Where the service's check stands: paused; over limit (past what the workspace's plan checks); checking (no check yet); hidden (checked, not yet shown to visitors); changing (its latest check differs from what visitors see); or steady. One of: `paused`, `over limit`, `checking`, `hidden`, `changing`, `steady`. |
| `state` | string or null | What visitors see of the service: operational, degraded or down. Null while nothing is shown. One of: `operational`, `degraded`, `down`. |
| `since` | date-time or null | Since when visitors have seen that state. Null while nothing is shown. |
| `problem` | string or null | Why the service's check fails, such as status (an unexpected status code), slow, timeout or unreachable. Null while it passes. One of: `status`, `slow`, `reported degraded`, `reported down`, `timeout`, `not found`, `refused`, `certificate`, `private`, `port`, `blocked`, `unreachable`, `redirects`, `not configured`. |
| `lastCheck` | object or null | The service's latest check. Null before its first. |
| `lastCheck.at` | date-time | When the check ran. |
| `lastCheck.httpStatus` | integer or null | The status code the check was answered with. Null when nothing answered. |
| `lastCheck.latencyMs` | integer or null | How long the answer took, in milliseconds. Null when nothing answered. |
| `application` | string | The name of the application the service belongs to. |

## Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `BAD_REQUEST` | Input validation failed. |
| 400 | `IDEMPOTENCY_KEY_REFUSED` | Send an Idempotency-Key of 1 to 255 visible characters, or an id of your own in the body, not both. |
| 401 | `UNAUTHORIZED` | Send a valid API token as a Bearer token. |
| 403 | `FORBIDDEN` | The teammate who holds this API token's secret can't change health checks. Only an owner or admin can. |
| 403 | `HOLDER_NOT_ALLOWED` | The teammate who holds this API token's secret can't do this in the workspace now. A teammate who can should roll it in the workspace's settings. |
| 403 | `INSUFFICIENT_SCOPE` | This API token can't add, edit, pause or resume your health checks. Create one that may in the workspace's settings. |
| 403 | `NETWORK_NOT_ALLOWED` | This API token works only from the networks it was made for. Call from one of them, or create a token for this one in the workspace's settings. |
| 403 | `NO_SEAT` | This workspace's plan has no seat for you. |
| 403 | `WORKSPACE_SUSPENDED` | This workspace is suspended. |
| 404 | `NOT_FOUND` | Not Found. |
| 409 | `ALREADY_ADDED` | Another service checks that address already. |
| 409 | `CHANGED_MEANWHILE` | Something changed meanwhile. Try again. |
| 409 | `LIMIT_REACHED` | The workspace's plan checks no more services. data.limit says how many it checks. Its data holds `limit`. |
| 429 | `TOO_MANY_REQUESTS` | Too Many Requests. Its data holds `retryAfter`. |

## Example request

```sh
curl -X POST https://app.notert.io/api/v1/status/services \
  -H "Authorization: Bearer $NOTERT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "5b7d9f1a-3c5e-4a7b-9d1f-3a5c7e9b1d24",
  "url": "api.example.com/health",
  "name": "API",
  "application": "Acme"
}'
```

## Example response 201

```json
{
  "id": "5b7d9f1a-3c5e-4a7b-9d1f-3a5c7e9b1d24",
  "name": "API",
  "url": "https://api.example.com/health",
  "phase": "steady",
  "state": "operational",
  "since": "2026-11-10T14:05:00.000Z",
  "problem": null,
  "lastCheck": {
    "at": "2026-11-21T09:30:00.000Z",
    "httpStatus": 200,
    "latencyMs": 84
  },
  "application": "Acme"
}
```
