# POST /php/domains/move

First published 14 Oct 2026 (release 0.2.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the php group.

Queue a job to move domains to a PHP version or the server default

- Who may call it: administrator
- Token scope, any of: settings, all
- Answers: 202 Accepted

Select domains by name in domains, by the php_version, follows_default, q, or owner filters, or by setting all to true. The domains field accepts up to 5000 names. A nonempty q can contain up to 200 characters and excludes U+0000 through U+001F.

The to field must name an installed, visible PHP version or use the value default. The value default makes the selected domains follow the server's default PHP version. Returns 400 for a missing or invalid selection or destination.

Returns 202 with the php-move job. The job moves domains one at a time and reports a result for each domain.

## As a command

- [urbestack-php-move](https://urbestack.com/docs/commands/urbestack-php-move.md): Moves selected domains to a different PHP version or changes whether they follow the server default.

## Request body

JSON, the type [PhpDomainsMove](https://urbestack.com/docs/api/types/PhpDomainsMove.md).

- `to` (string, matching ^(?:[5-9]\.[0-9]|default)$, required): Installed PHP version available for customers to select, in major.minor format, or default to make the domains follow the server's default PHP version.
- `all` (boolean): Whether to select every domain from the unfiltered list.
- `domains` (array of string, up to 253 characters): Domain names to select explicitly.
- `follows_default` (boolean): Whether to select every domain that follows the server's default PHP version.
- `owner` (Username): Owner username used to restrict the selection to that owner's domains.
- `php_version` (string, matching ^[5-9]\.[0-9]$): PHP version in major.minor format used to select every domain running that version.
- `q` (string, up to 200 characters): Text to match within the domain name or the owner's username.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/php/domains/move" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "all": true,
    "domains": [
      "text"
    ],
    "follows_default": true,
    "owner": "alice",
    "php_version": "8.4",
    "q": "text",
    "to": "text"
  }'
```

Response, 202 Accepted:

```
{
  "job": {
    "created_at": "2026-09-09T10:15:00Z",
    "created_by": 1,
    "created_by_name": "text",
    "dismissed_at": "text",
    "finished_at": "2026-09-09T10:15:04Z",
    "id": 1,
    "lane": "short",
    "log": "",
    "params": {},
    "progress": 100,
    "result": {},
    "started_at": "2026-09-09T10:15:01Z",
    "status": "queued",
    "type": "rebuild",
    "usual_seconds": 1
  }
}
```

## Errors

- 400: A new job is queued or running
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid <what>: 
- 400: Invalid PHP version, expected e.g. 8.2
- 400: Invalid domain name
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Job parameters must be an object
- 400: Name the domains, give the filter that picks them (php_version, follows_default, q, owner), or all
- 400: PHP <to> is hidden from new choices on this server
- 400: PHP <to> is not installed on this server
- 400: Unknown PHP version '
- 400: Unknown PHP version '<v>'
- 400: Unknown PHP version '<version>'
- 400: Unknown job type
- 400: Username '<value>' is reserved
- 400: domains is a list of up to 5000 names
- 400: q is a text of up to 200 characters
- 400: to is a PHP version, or default
- 401: Authentication required
- 404: User '<user>' not found
