Skip to main content
POST
/
instances
/
{instance}
/
background-processes
Create background process
curl --request POST \
  --url https://app.laravel.cloud/api/instances/{instance}/background-processes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "worker",
  "processes": 5,
  "command": "php artisan my:command",
  "config": {
    "connection": "redis",
    "queue": "default,emails",
    "tries": 3,
    "backoff": 30,
    "sleep": 3,
    "rest": 0,
    "timeout": 60,
    "force": false
  }
}'
{
  "data": {
    "id": "<string>",
    "type": "<string>",
    "attributes": {
      "type": "<string>",
      "processes": "<string>",
      "command": "<string>",
      "config": "<string>",
      "strategy_type": "<string>",
      "strategy_threshold": "<string>",
      "created_at": "<string>"
    },
    "relationships": {
      "instance": {
        "data": {
          "type": "instances",
          "id": "<string>"
        }
      }
    }
  }
}

Authorizations

Authorization
string
header
required

The Bearer Token generated on the Cloud UI.

Path Parameters

instance
string
required

The instance identifier

Body

application/json
type
enum<string>
required
Available options:
worker,
custom
processes
integer
required
Required range: 1 <= x <= 10
command
string

Custom command to run. Required when type is 'custom'. Not applicable for 'worker' type.

Example:

"php artisan my:command"

config
object

Response

BackgroundProcessResource

data
object
required