> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kodostatus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign Services

> Replace all service assignments for a status page

## Path Parameters

<ParamField path="id" type="string" required>
  The status page ID
</ParamField>

## Body Parameters

<ParamField body="service_ids" type="string[]" required>
  Array of service IDs to assign. The order of IDs determines display order on the page. This replaces all existing assignments.
</ParamField>

<Note>
  This is a **replace** operation. Pass the complete list of services you want on the page. Any previously assigned services not in the array will be removed.
</Note>

<Info>
  A single status page can have a maximum of **200** services assigned. The `service_ids` array must not contain duplicate entries.
</Info>

## Response

Returns a success confirmation.

## Common Errors

| Status | Message                                                        | Description                                       |
| ------ | -------------------------------------------------------------- | ------------------------------------------------- |
| 400    | `Cannot assign more than 200 services to a single status page` | Service limit exceeded                            |
| 404    | `Status page not found`                                        | The ID does not match a page in your organization |

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://kodostatus.com/api/v1/status-pages/sp_abc123/services" \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "service_ids": [
        "svc_abc123",
        "svc_def456",
        "svc_ghi789"
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://kodostatus.com/api/v1/status-pages/sp_abc123/services',
    {
      method: 'PUT',
      headers: {
        'X-API-Key': process.env.KODO_API_KEY,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        service_ids: ['svc_abc123', 'svc_def456', 'svc_ghi789']
      })
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true
  }
  ```
</ResponseExample>
