Laravel Commands API
The Commands API from Laravel — 5 operation(s) for commands.
The Commands API from Laravel — 5 operation(s) for commands.
openapi: 3.1.0
info:
title: Laravel Cloud Applications Commands API
version: 0.0.1
servers:
- url: https://cloud.laravel.com/api
security:
- http: []
tags:
- name: Commands
paths:
/environments/{environment}/commands:
get:
operationId: public.environments.commands.index
description: Get a list of all commands for the given environment.
summary: List commands
tags:
- Commands
parameters:
- name: environment
in: path
required: true
description: The environment identifier
schema:
type: string
- name: filter[status]
in: query
schema:
type: string
- name: filter[command]
in: query
schema:
type: string
- name: include
in: query
schema:
type: array
items:
type: string
enum:
- environment
- deployment
- initiator
explode: false
responses:
'200':
description: Paginated set of `CommandResource`
content:
application/vnd.api+json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/CommandResource'
links:
type: object
properties:
first:
type: string
last:
type: string
prev:
type: string
next:
type: string
meta:
type: object
properties:
current_page:
type: integer
minimum: 1
from:
type:
- integer
- 'null'
minimum: 1
last_page:
type: integer
minimum: 1
links:
type: array
description: Generated paginator links.
items:
type: object
properties:
url:
type:
- string
- 'null'
label:
type: string
active:
type: boolean
required:
- url
- label
- active
path:
type:
- string
- 'null'
description: Base path for paginator generated URLs.
per_page:
type: integer
description: Number of items shown per page.
minimum: 0
to:
type:
- integer
- 'null'
description: Number of the last item in the slice.
minimum: 1
total:
type: integer
description: Total number of items being paginated.
minimum: 0
required:
- current_page
- from
- last_page
- links
- path
- per_page
- to
- total
included:
type: array
items:
anyOf:
- $ref: '#/components/schemas/EnvironmentResource'
- $ref: '#/components/schemas/DeploymentResource'
- $ref: '#/components/schemas/UserResource'
required:
- data
- links
- meta
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
post:
operationId: public.environments.commands.store
description: Run a command on the given environment.
summary: Run command
tags:
- Commands
parameters:
- name: environment
in: path
required: true
description: The environment identifier
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCommandRequest'
responses:
'200':
description: '`CommandResource`'
content:
application/vnd.api+json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/CommandResource'
included:
type: array
items:
anyOf:
- $ref: '#/components/schemas/EnvironmentResource'
- $ref: '#/components/schemas/DeploymentResource'
- $ref: '#/components/schemas/UserResource'
required:
- data
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
'422':
$ref: '#/components/responses/ValidationException'
/commands/{command}:
get:
operationId: public.commands.show
description: Get the details of a specific command.
summary: Get command
tags:
- Commands
parameters:
- name: command
in: path
required: true
description: The command identifier
schema:
type: string
- name: include
in: query
schema:
type: array
items:
type: string
enum:
- environment
- deployment
- initiator
explode: false
responses:
'200':
description: '`CommandResource`'
content:
application/vnd.api+json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/CommandResource'
included:
type: array
items:
anyOf:
- $ref: '#/components/schemas/EnvironmentResource'
- $ref: '#/components/schemas/DeploymentResource'
- $ref: '#/components/schemas/UserResource'
required:
- data
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
/orgs/{organization}/servers/{server}/sites/{site}/commands:
get:
operationId: organizations.servers.sites.commands.index
description: 'List all command runs for the site.
Processing mode: <small><code>sync</code></small>'
summary: List commands
tags:
- Commands
parameters:
- name: organization
in: path
required: true
description: The organization slug
schema:
type: string
- name: server
in: path
required: true
description: The server ID
schema:
type: integer
- name: site
in: path
required: true
description: The site ID
schema:
type: integer
- name: page[size]
in: query
description: The number of results that will be returned per page.
schema:
type: integer
default: 30
- name: page[cursor]
in: query
description: The cursor to start the pagination from.
schema:
type: string
- name: filter[user_id]
in: query
description: The user ID of the command initiator.
schema:
type: string
examples:
- 1
- name: filter[status]
in: query
description: The status of the command.
schema:
type: string
examples:
- finished
- name: filter[command]
in: query
description: The command it ran.
schema:
type: string
examples:
- git status
- name: sort
in: query
schema:
type: array
items:
type: string
enum:
- status
- -status
- created_at
- -created_at
- updated_at
- -updated_at
explode: false
responses:
'200':
description: Paginated set of `CommandResource`
content:
application/vnd.api+json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/CommandResource_2'
links:
type: object
properties:
first:
type: string
last:
type: string
prev:
type: string
next:
type: string
meta:
type: object
properties:
path:
type:
- string
- 'null'
description: Base path for paginator generated URLs.
per_page:
type: integer
description: Number of items shown per page.
minimum: 0
next_cursor:
type:
- string
- 'null'
description: The "cursor" that points to the next set of items.
prev_cursor:
type:
- string
- 'null'
description: The "cursor" that points to the previous set of items.
required:
- path
- per_page
- next_cursor
- prev_cursor
included:
type: array
items:
$ref: '#/components/schemas/UserResource_2'
required:
- data
- links
- meta
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
security:
- oauth2:
- server:view
x-permissions:
- server:view
x-mint:
metadata:
noindex: true
x-processingMode: sync
post:
operationId: organizations.servers.sites.commands.store
description: 'Run a command on the site.
Processing mode: <small><code>async</code></small>'
summary: Create command
tags:
- Commands
parameters:
- name: organization
in: path
required: true
description: The organization slug
schema:
type: string
- name: server
in: path
required: true
description: The server ID
schema:
type: integer
- name: site
in: path
required: true
description: The site ID
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RunSiteCommandRequest'
responses:
'202':
description: The command has been queued for execution.
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
'422':
$ref: '#/components/responses/ValidationException'
security:
- oauth2:
- site:manage-commands
x-permissions:
- site:manage-commands
x-mint:
metadata:
noindex: true
x-processingMode: async
/orgs/{organization}/servers/{server}/sites/{site}/commands/{command}:
get:
operationId: organizations.servers.sites.commands.show
description: 'Get a specific command run.
Processing mode: <small><code>sync</code></small>'
summary: Get command
tags:
- Commands
parameters:
- name: organization
in: path
required: true
description: The organization slug
schema:
type: string
- name: server
in: path
required: true
description: The server ID
schema:
type: integer
- name: site
in: path
required: true
description: The site ID
schema:
type: integer
- name: command
in: path
required: true
description: The command ID
schema:
type: integer
responses:
'200':
description: '`CommandResource`'
content:
application/vnd.api+json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/CommandResource_2'
included:
type: array
items:
$ref: '#/components/schemas/UserResource_2'
required:
- data
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
security:
- oauth2:
- server:view
x-permissions:
- server:view
x-mint:
metadata:
noindex: true
x-processingMode: sync
delete:
operationId: organizations.servers.sites.commands.destroy
description: 'Delete a command history.
Processing mode: <small><code>sync</code></small>'
summary: Delete command
tags:
- Commands
parameters:
- name: organization
in: path
required: true
description: The organization slug
schema:
type: string
- name: server
in: path
required: true
description: The server ID
schema:
type: integer
- name: site
in: path
required: true
description: The site ID
schema:
type: integer
- name: command
in: path
required: true
description: The command ID
schema:
type: integer
responses:
'202':
description: ''
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
security:
- oauth2:
- site:manage-commands
x-permissions:
- site:manage-commands
x-mint:
metadata:
noindex: true
x-processingMode: sync
/orgs/{organization}/servers/{server}/sites/{site}/commands/{command}/output:
get:
operationId: organizations.servers.sites.commands.output.show
description: 'Get the output of a specific command run.
Processing mode: <small><code>sync</code></small>'
summary: Get command output
tags:
- Commands
parameters:
- name: organization
in: path
required: true
description: The organization slug
schema:
type: string
- name: server
in: path
required: true
description: The server ID
schema:
type: integer
- name: site
in: path
required: true
description: The site ID
schema:
type: integer
- name: command
in: path
required: true
description: The command ID
schema:
type: integer
responses:
'200':
description: '`CommandOutputResource`'
content:
application/vnd.api+json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/CommandOutputResource'
required:
- data
'404':
$ref: '#/components/responses/ModelNotFoundException'
'403':
$ref: '#/components/responses/AuthorizationException'
security:
- oauth2:
- server:view
x-permissions:
- server:view
x-mint:
metadata:
noindex: true
x-processingMode: sync
components:
schemas:
CommandResource_2:
type: object
properties:
id:
type: string
type:
type: string
enum:
- commands
attributes:
type: object
properties:
command:
type: string
description: The command that ran.
examples:
- nvm use 22
status:
description: The status of the command.
examples:
- finished
$ref: '#/components/schemas/CommandStatus_2'
exit_code:
type:
- integer
- 'null'
description: The exit code of the command. Null while the command is still running or if it never produced one (e.g. an SSH failure or timeout).
examples:
- 0
error_output:
type:
- string
- 'null'
description: The failure detail when the command did not succeed. Null when the command succeeded or has not finished.
examples:
- Tunnel exited with a non-zero code [1].
duration:
type: string
description: The duration of the command in human-readable format.
examples:
- 5m
user_id:
type: integer
description: The ID of the user who initiated the command.
examples:
- 1
created_at:
type: string
format: date-time
description: The date and time the command was created.
examples:
- '2025-07-29T09:00:00Z'
updated_at:
type: string
format: date-time
description: The date and time the command was last updated.
examples:
- '2025-07-29T09:00:00Z'
required:
- command
- status
- exit_code
- error_output
- duration
- user_id
- created_at
- updated_at
relationships:
type: object
properties:
user:
type: object
description: The user who initiated the command.
properties:
data:
anyOf:
- $ref: '#/components/schemas/UserResourceIdentifier'
- type: 'null'
required:
- data
links:
type: object
properties:
self:
description: A link to the resource itself
$ref: '#/components/schemas/Link'
required:
- self
required:
- id
- type
- links
title: CommandResource
CommandStatus_2:
type: string
enum:
- waiting
- running
- finished
- timeout
- failed
title: CommandStatus
Link:
type: object
properties:
href:
type: string
format: uri
rel:
type: string
describedby:
type: string
title:
type: string
type:
type: string
hreflang:
anyOf:
- type: string
- type: array
items:
type: string
meta:
type: object
required:
- href
title: Link
CommandResource:
type: object
properties:
id:
type: string
type:
type: string
enum:
- commands
attributes:
type: object
properties:
command:
type: string
output:
type:
- string
- 'null'
status:
$ref: '#/components/schemas/CommandStatus'
exit_code:
anyOf:
- $ref: '#/components/schemas/ExitCode'
- type: 'null'
failure_reason:
type:
- string
- 'null'
started_at:
type:
- string
- 'null'
format: date-time
finished_at:
type:
- string
- 'null'
format: date-time
created_at:
type:
- string
- 'null'
format: date-time
required:
- command
- output
- status
- exit_code
- failure_reason
- started_at
- finished_at
- created_at
relationships:
type: object
properties:
environment:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/EnvironmentResourceIdentifier'
- type: 'null'
required:
- data
deployment:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/DeploymentResourceIdentifier'
- type: 'null'
required:
- data
initiator:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/UserResourceIdentifier'
- type: 'null'
required:
- data
links:
type: object
properties:
self:
$ref: '#/components/schemas/Link'
required:
- self
required:
- id
- type
- links
title: CommandResource
BranchResourceIdentifier:
type: object
properties:
type:
type: string
enum:
- branches
id:
type: string
required:
- type
- id
title: BranchResourceIdentifier
UserResourceIdentifier:
type: object
properties:
type:
type: string
enum:
- users
id:
type: string
required:
- type
- id
title: UserResourceIdentifier
ApplicationResourceIdentifier:
type: object
properties:
type:
type: string
enum:
- applications
id:
type: string
required:
- type
- id
title: ApplicationResourceIdentifier
FilesystemResourceIdentifier:
type: object
properties:
type:
type: string
enum:
- filesystems
id:
type: string
required:
- type
- id
title: FilesystemResourceIdentifier
ExitCode:
type: integer
enum:
- 0
- 1
title: ExitCode
CommandOutputResource:
type: object
properties:
id:
type: string
type:
type: string
enum:
- commandOutputs
attributes:
type: object
properties:
output:
type: string
description: The output of the command execution.
examples:
- Now using node v22.0.0 (npm v10.5.1)
required:
- output
links:
type: object
properties:
self:
description: A link to the resource itself
$ref: '#/components/schemas/Link'
required:
- self
required:
- id
- type
- links
title: CommandOutputResource
EnvironmentResource:
type: object
properties:
id:
type: string
type:
type: string
enum:
- environments
attributes:
type: object
properties:
name:
type: string
slug:
type: string
status:
$ref: '#/components/schemas/EnvironmentStatus'
created_from_automation:
type: boolean
vanity_domain:
type: string
php_major_version:
type: string
enum:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
build_command:
type:
- string
- 'null'
node_version:
$ref: '#/components/schemas/NodeVersion'
deploy_command:
type:
- string
- 'null'
uses_octane:
type: boolean
uses_hibernation:
type: boolean
hibernation_wake_up_interval:
type:
- integer
- 'null'
uses_push_to_deploy:
type: boolean
uses_deploy_hook:
type: boolean
? ''
: anyOf:
- type: object
properties:
environment_variables:
type: array
items:
type: object
properties:
key:
type: string
value:
type: string
required:
- key
- value
required:
- environment_variables
- type: array
items:
type: string
minItems: 0
maxItems: 0
additionalItems: false
network_settings:
type: object
properties:
cache:
type: object
properties:
strategy:
type: string
required:
- strategy
response_headers:
type: object
properties:
frame:
type: string
content_type:
type: string
hsts:
type: object
properties:
max_age:
type: integer
include_subdomains:
type: boolean
preload:
type: boolean
required:
- max_age
- include_subdomains
- preload
required:
- frame
- content_type
- hsts
firewall:
type: object
properties:
bot_categories:
type: array
items:
$ref: '#/components/schemas/BotControlCategory'
rate_limit:
type: object
properties:
level:
$ref: '#/components/schemas/RateLimitLevel'
per_minute:
$ref: '#/components/schemas/RateLimitPerMinute'
4xx:
type: boolean
'429':
type: boolean
required:
- level
- per_minute
- 4xx
- '429'
under_attack_mode_started_at:
type: string
block_path:
type: boolean
required:
- bot_categories
- rate_limit
- under_attack_mode_started_at
- block_path
content_converter:
type: boolean
required:
- cache
- response_headers
- firewall
- content_converter
created_at:
type:
- string
- 'null'
format: date-time
required:
- name
- slug
- status
- created_from_automation
- vanity_domain
- php_major_version
- build_command
- node_version
- deploy_command
- uses_octane
- uses_hibernation
- hibernation_wake_up_interval
- uses_push_to_deploy
- uses_deploy_hook
- null
- network_settings
- created_at
relationships:
type: object
properties:
application:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/ApplicationResourceIdentifier'
- type: 'null'
required:
- data
branch:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/BranchResourceIdentifier'
- type: 'null'
required:
- data
deployments:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/DeploymentResourceIdentifier'
required:
- data
currentDeployment:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/DeploymentResourceIdentifier'
- type: 'null'
required:
- data
domains:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/DomainResourceIdentifier'
required:
- data
primaryDomain:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/DomainResourceIdentifier'
- type: 'null'
required:
- data
instances:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/InstanceResourceIdentifier'
required:
- data
database:
type: object
properties:
data:
anyOf:
- $ref: '#/components/schemas/DatabaseSchemaResourceIdentifier'
- type: 'null'
required:
- data
cache:
# --- truncated at 32 KB (42 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/laravel/refs/heads/main/openapi/laravel-commands-api-openapi.yml