# Update Statuses

PUT https://services.leadconnectorhq.com/projects/spaces/{spaceId}/statuses

Replaces the whole space status set. Send every group you want to keep — omitted groups and statuses are removed. There is no `If-Match` and no per-status route. A task that still uses a removed status `key` keeps that key until you update the task. `key` is the stable id; `label` is display text. Status `color` is any hex. Space, folder, and list `color` must be one of the 16 palette swatches. A task is complete when `properties.statusGroup` is `done`.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `projects/workspace.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `spaceId` | string | Yes | Space id |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | No | Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-04-15"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/projects/spaces/{spaceId}/statuses": {
      "put": {
        "summary": "Update Statuses",
        "operationId": "updateStatuses",
        "description": "Replaces the whole space status set. Send every group you want to keep — omitted groups and statuses are removed. There is no `If-Match` and no per-status route. A task that still uses a removed status `key` keeps that key until you update the task. `key` is the stable id; `label` is display text. Status `color` is any hex. Space, folder, and list `color` must be one of the 16 palette swatches. A task is complete when `properties.statusGroup` is `done`.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-04-15"
              ]
            }
          },
          {
            "name": "spaceId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "example": "6a102435124ecfb348bd5506",
              "description": "Space id"
            },
            "description": "Space id"
          },
          {
            "name": "locationId",
            "required": false,
            "in": "query",
            "description": "Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers.",
            "schema": {
              "example": "ve9EPM428h8b87FE9C12Kg",
              "type": "string",
              "description": "Location id. Required for APP channel (`?locationId=`). Ignored for OAuth/PIT (token location is used). Do not send in path, body, or headers."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectsUpsertStatusesBodyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsStatusGroupsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — missing scope or no access to this space, folder, list, or task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found — space, folder, list, task, comment, or recurring task missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "projects/workspace.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ProjectsUpsertStatusesBodyDto": {
        "type": "object",
        "properties": {
          "groups": {
            "description": "Complete status groups for the space (full replace — not a partial merge). Tasks that still reference a removed status key keep that key until updated; clients should migrate those tasks before removing keys.",
            "example": [
              {
                "key": "todo",
                "label": "To Do",
                "color": "#E2E8F0",
                "position": 0,
                "statuses": [
                  {
                    "key": "to_do",
                    "label": "To Do",
                    "color": "#94A3B8",
                    "position": 0
                  }
                ]
              },
              {
                "key": "done",
                "label": "Done",
                "color": "#DCFCE7",
                "position": 1,
                "statuses": [
                  {
                    "key": "complete",
                    "label": "Complete",
                    "color": "#22C55E",
                    "position": 0
                  }
                ]
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "Unique key for the group. Letters, digits, and underscores only (no spaces or special characters).",
                  "example": "to_do",
                  "pattern": "^[A-Za-z0-9_]+$"
                },
                "label": {
                  "type": "string",
                  "description": "Display label",
                  "example": "To Do"
                },
                "color": {
                  "type": "string",
                  "description": "Hex color",
                  "example": "#E2E8F0"
                },
                "position": {
                  "type": "number",
                  "description": "Sort position",
                  "default": 0,
                  "minimum": 0,
                  "example": 0
                },
                "statuses": {
                  "description": "Statuses within this group",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "description": "Unique key for the status. Letters, digits, and underscores only (no spaces or special characters).",
                        "example": "to_do",
                        "pattern": "^[A-Za-z0-9_]+$"
                      },
                      "label": {
                        "type": "string",
                        "description": "Display label (max 20 characters)",
                        "example": "To Do",
                        "maxLength": 20
                      },
                      "color": {
                        "type": "string",
                        "description": "Hex color",
                        "example": "#94A3B8"
                      },
                      "position": {
                        "type": "number",
                        "description": "Sort position",
                        "default": 0,
                        "minimum": 0,
                        "example": 0
                      }
                    },
                    "required": [
                      "key",
                      "label"
                    ],
                    "title": "StatusItemDto"
                  },
                  "example": [
                    {
                      "key": "to_do",
                      "label": "To Do",
                      "color": "#94A3B8",
                      "position": 0
                    }
                  ]
                }
              },
              "required": [
                "key",
                "label",
                "statuses"
              ],
              "title": "StatusGroupDto"
            }
          }
        },
        "required": [
          "groups"
        ],
        "title": "ProjectsUpsertStatusesBodyDto"
      },
      "ProjectsStatusGroupsResponseDto": {
        "type": "object",
        "description": "Status groups for a space (effective / after upsert)",
        "required": [
          "groups"
        ],
        "properties": {
          "groups": {
            "type": "array",
            "description": "Status groups with nested statuses (`key`, `label`, `color`, `position`)",
            "items": {
              "type": "object",
              "description": "Status group in a workflow (board column)",
              "required": [
                "key",
                "label",
                "statuses"
              ],
              "properties": {
                "key": {
                  "type": "string",
                  "description": "Stable status group key",
                  "example": "todo"
                },
                "label": {
                  "type": "string",
                  "description": "Human-readable label",
                  "example": "To Do"
                },
                "color": {
                  "type": "string",
                  "nullable": true,
                  "description": "Hex color. Not limited to the 16-swatch space/folder/list palette.",
                  "example": "#3B82F6"
                },
                "position": {
                  "type": "number",
                  "description": "Sort position",
                  "example": 0
                },
                "statuses": {
                  "type": "array",
                  "description": "Statuses within the group",
                  "items": {
                    "type": "object",
                    "description": "Single status within a group",
                    "required": [
                      "key",
                      "label"
                    ],
                    "properties": {
                      "key": {
                        "type": "string",
                        "description": "Stable status key. This is what tasks store in `properties.status`. `label` is display text.",
                        "example": "to_do"
                      },
                      "label": {
                        "type": "string",
                        "description": "Human-readable label",
                        "example": "To Do"
                      },
                      "color": {
                        "type": "string",
                        "nullable": true,
                        "description": "Hex color. Not limited to the 16-swatch space/folder/list palette.",
                        "example": "#3B82F6"
                      },
                      "position": {
                        "type": "number",
                        "description": "Sort position within the group",
                        "example": 0
                      }
                    },
                    "title": "ProjectsStatusItemDto"
                  },
                  "example": [
                    {
                      "key": "to_do",
                      "label": "To Do",
                      "color": "#94A3B8",
                      "position": 0
                    }
                  ]
                }
              },
              "example": {
                "key": "todo",
                "label": "To Do",
                "color": "#E2E8F0",
                "position": 0,
                "statuses": [
                  {
                    "key": "to_do",
                    "label": "To Do",
                    "color": "#94A3B8",
                    "position": 0
                  }
                ]
              },
              "title": "ProjectsStatusGroupDto"
            },
            "example": [
              {
                "key": "todo",
                "label": "To Do",
                "color": "#E2E8F0",
                "position": 0,
                "statuses": [
                  {
                    "key": "to_do",
                    "label": "To Do",
                    "color": "#94A3B8",
                    "position": 0
                  }
                ]
              },
              {
                "key": "done",
                "label": "Done",
                "color": "#BBF7D0",
                "position": 2,
                "statuses": [
                  {
                    "key": "completed",
                    "label": "Completed",
                    "color": "#22C55E",
                    "position": 0
                  }
                ]
              }
            ]
          }
        },
        "title": "ProjectsStatusGroupsResponseDto"
      },
      "ProjectsErrorResponseDto": {
        "type": "object",
        "description": "Error payload for non-2xx responses. Same shape on every Projects operation.\n\n`message` is a string, or a string array for validation failures.\n\n`error` is usually the HTTP reason phrase (`Bad Request`, `Unprocessable Entity`, …). Known domain values include `graph_scope_invalid` (Search list-scope failures).\n\nWhen `error` is `graph_scope_invalid`, `reason` discriminates the failure: `too_many_ids` | `non_list_type` | `duplicate_graph_scope`.",
        "required": [
          "statusCode",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 422
          },
          "message": {
            "description": "Human-readable message, or a list of validation messages",
            "oneOf": [
              {
                "type": "string",
                "example": "Task is already in the destination list"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "dueDate must be a string"
                ]
              }
            ],
            "example": null
          },
          "error": {
            "type": "string",
            "description": "HTTP reason phrase or domain code when present. Domain codes seen today: `graph_scope_invalid`. Otherwise Nest’s reason phrase.",
            "example": "graph_scope_invalid"
          },
          "reason": {
            "type": "string",
            "description": "Present when `error` is `graph_scope_invalid`. Discriminates Search list-scope failures. Allowed: `too_many_ids`, `non_list_type`, `duplicate_graph_scope`.",
            "enum": [
              "too_many_ids",
              "non_list_type",
              "duplicate_graph_scope"
            ],
            "example": "too_many_ids"
          }
        },
        "example": {
          "statusCode": 422,
          "message": "graph.id scope may not exceed 10 list IDs",
          "error": "graph_scope_invalid",
          "reason": "too_many_ids"
        },
        "title": "ProjectsErrorResponseDto"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X PUT 'https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-04-15' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "groups": [
    {
      "key": "todo",
      "label": "To Do",
      "color": "#E2E8F0",
      "position": 0,
      "statuses": [
        {
          "key": "to_do",
          "label": "To Do",
          "color": "#94A3B8",
          "position": 0
        }
      ]
    },
    {
      "key": "done",
      "label": "Done",
      "color": "#DCFCE7",
      "position": 1,
      "statuses": [
        {
          "key": "complete",
          "label": "Complete",
          "color": "#22C55E",
          "position": 0
        }
      ]
    }
  ]
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-04-15',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "groups": [
        {
          "key": "todo",
          "label": "To Do",
          "color": "#E2E8F0",
          "position": 0,
          "statuses": [
            {
              "key": "to_do",
              "label": "To Do",
              "color": "#94A3B8",
              "position": 0
            }
          ]
        },
        {
          "key": "done",
          "label": "Done",
          "color": "#DCFCE7",
          "position": 1,
          "statuses": [
            {
              "key": "complete",
              "label": "Complete",
              "color": "#22C55E",
              "position": 0
            }
          ]
        }
      ]
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/projects/spaces/{spaceId}/statuses"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-04-15"
}

payload = {
    "groups": [
        {
            "key": "todo",
            "label": "To Do",
            "color": "#E2E8F0",
            "position": 0,
            "statuses": [
                {
                    "key": "to_do",
                    "label": "To Do",
                    "color": "#94A3B8",
                    "position": 0
                }
            ]
        },
        {
            "key": "done",
            "label": "Done",
            "color": "#DCFCE7",
            "position": 1,
            "statuses": [
                {
                    "key": "complete",
                    "label": "Complete",
                    "color": "#22C55E",
                    "position": 0
                }
            ]
        }
    ]
}

response = requests.put(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-04-15',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "groups": [
    {
      "key": "todo",
      "label": "To Do",
      "color": "#E2E8F0",
      "position": 0,
      "statuses": [
        {
          "key": "to_do",
          "label": "To Do",
          "color": "#94A3B8",
          "position": 0
        }
      ]
    },
    {
      "key": "done",
      "label": "Done",
      "color": "#DCFCE7",
      "position": 1,
      "statuses": [
        {
          "key": "complete",
          "label": "Complete",
          "color": "#22C55E",
          "position": 0
        }
      ]
    }
  ]
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-04-15")
  .header("Content-Type", "application/json")
  .body("{\"groups\":[{\"key\":\"todo\",\"label\":\"To Do\",\"color\":\"#E2E8F0\",\"position\":0,\"statuses\":[{\"key\":\"to_do\",\"label\":\"To Do\",\"color\":\"#94A3B8\",\"position\":0}]},{\"key\":\"done\",\"label\":\"Done\",\"color\":\"#DCFCE7\",\"position\":1,\"statuses\":[{\"key\":\"complete\",\"label\":\"Complete\",\"color\":\"#22C55E\",\"position\":0}]}]}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses"
  payload := strings.NewReader(`{
  "groups": [
    {
      "key": "todo",
      "label": "To Do",
      "color": "#E2E8F0",
      "position": 0,
      "statuses": [
        {
          "key": "to_do",
          "label": "To Do",
          "color": "#94A3B8",
          "position": 0
        }
      ]
    },
    {
      "key": "done",
      "label": "Done",
      "color": "#DCFCE7",
      "position": 1,
      "statuses": [
        {
          "key": "complete",
          "label": "Complete",
          "color": "#22C55E",
          "position": 0
        }
      ]
    }
  ]
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-04-15")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-04-15"
request["Content-Type"] = "application/json"
request.body = '{
  "groups": [
    {
      "key": "todo",
      "label": "To Do",
      "color": "#E2E8F0",
      "position": 0,
      "statuses": [
        {
          "key": "to_do",
          "label": "To Do",
          "color": "#94A3B8",
          "position": 0
        }
      ]
    },
    {
      "key": "done",
      "label": "Done",
      "color": "#DCFCE7",
      "position": 1,
      "statuses": [
        {
          "key": "complete",
          "label": "Complete",
          "color": "#22C55E",
          "position": 0
        }
      ]
    }
  ]
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-04-15"
}

$body = '{
  "groups": [
    {
      "key": "todo",
      "label": "To Do",
      "color": "#E2E8F0",
      "position": 0,
      "statuses": [
        {
          "key": "to_do",
          "label": "To Do",
          "color": "#94A3B8",
          "position": 0
        }
      ]
    },
    {
      "key": "done",
      "label": "Done",
      "color": "#DCFCE7",
      "position": 1,
      "statuses": [
        {
          "key": "complete",
          "label": "Complete",
          "color": "#22C55E",
          "position": 0
        }
      ]
    }
  ]
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/projects/spaces/<spaceId>/statuses' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
