# Health API

Check whether the Factory API deployment is serving requests.

## Check that the Factory API is up

`GET /api/health`

Returns 200 while this deployment serves requests, with the commit it was built from, the region it serves, and the client address it saw. It reads no credential.

No authentication required.

```bash
curl 'https://api.factory.ai/api/health'
```

**Response:** `200` - Response for status 200

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok"
      ]
    },
    "debugVersion": {
      "type": "integer",
      "description": "Build marker for diagnostics; carries no other meaning"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Server time"
    },
    "deploySha": {
      "type": "string",
      "nullable": true,
      "description": "Git commit the deployment was built from, or null outside a Vercel deployment"
    },
    "region": {
      "type": "string",
      "enum": [
        "global",
        "eu"
      ],
      "description": "Data-residency region this deployment serves"
    },
    "clientIp": {
      "type": "string",
      "nullable": true,
      "description": "The `x-real-ip` header the request reached the deployment with, or null without one"
    }
  },
  "required": [
    "status",
    "debugVersion",
    "timestamp",
    "deploySha",
    "region",
    "clientIp"
  ]
}
```

**Response:** `500` - Response for status 500

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `default` - Response for status default

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```
