Servers

Servers are the foundation of your deployment infrastructure. They represent the remote machines where your projects are deployed and run. On this page, we will dive into the different server endpoints you can use to manage servers programmatically.

The server model

The server model contains all the information about your servers, including their network configuration and connection details.

Properties

  • Name
    id
    Type
    integer
    Description

    Unique identifier for the server.

  • Name
    server_type
    Type
    integer
    Description

    The type of server. 0 = App Server, 1 = Database Server, 2 = Cache Server, 3 = Meilisearch Server.

  • Name
    name
    Type
    string
    Description

    The display name for the server.

  • Name
    public_ip
    Type
    string
    Description

    The public IP address of the server.

  • Name
    private_ip
    Type
    string
    Description

    The private IP address of the server.

  • Name
    ssh_port
    Type
    integer
    Description

    The SSH port used to connect to the server.

  • Name
    nat_port
    Type
    integer
    Description

    The NAT port used to connect to the server. Default is 22.

  • Name
    timezone
    Type
    string
    Description

    The timezone of the server.

  • Name
    operating_system
    Type
    string
    Description

    The operating system of the server.

  • Name
    connection_status
    Type
    integer
    Description

    The connection status of the server. 0 = Disconnected, 1 = Connected.

  • Name
    server_status
    Type
    integer
    Description

    The status of the server. 0 = Installing, 1 = Provisioning, 10 = Provisioned.

  • Name
    notes
    Type
    string
    Description

    Any additional notes about the server.

  • Name
    queue_limit
    Type
    integer
    Description

    The maximum number of projects at the same time that can be deployed to the server.

  • Name
    monitoring_enabled
    Type
    boolean
    Description

    Whether monitoring is enabled for the server.

  • Name
    projects_count
    Type
    integer
    Description

    The number of projects deployed to the server.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the server was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the server was last updated.

Important Note

Currently, you can only initialize a server on the Depfloy dashboard. Initializing a server via the API is not yet supported. This will be available in the future.


GET/api/v1/servers

List all servers

This endpoint allows you to retrieve a paginated list of all your servers.

Request

GET
/api/v1/servers
curl -G https://app.depfloy.com/api/v1/servers \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"

Response

{
    "current_page": 1,
    "data": [
        {
            "id": 48390,
            "server_type": 0,
            "name": "andreo-galaxy",
            "ssh_port": 22,
            "nat_port": null,
            "public_ip": "142.131.127.100",
            "private_ip": null,
            "timezone": "Europe/Istanbul",
            "operating_system": null,
            "connection_status": 1,
            "server_status": 10,
            "notes": null,
            "created_at": "2025-12-11 12:49:50",
            "updated_at": "2025-12-11 14:27:44",
            "queue_limit": 1,
            "monitoring_enabled": 1,
            "projects_count": 10
        },
        // ... more servers
    ],
    "per_page": 10,
    "total_pages": 5,
    "total_items": 5,
}

GET/api/v1/servers/:id

Retrieve a server

This endpoint allows you to retrieve a server by providing the server id.

Request

GET
/api/v1/servers/1
curl https://app.depfloy.com/api/v1/servers/183009 \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json"
  -H "Content-Type: application/json"

Response

{
  "data": {
    "id": 1,
    "name": "production-server",
    "public_ip": "203.0.113.50",
    "private_ip": "10.0.0.1",
    "ssh_port": 22,
    // ... more properties
  }
}

PUT/api/v1/servers/:id

Update a server

This endpoint allows you to update a server's information.

Attributes for updating a server

  • Name
    name
    Type
    string
    Description

    The display name for the server.

  • Name
    public_ip
    Type
    string
    Description

    The public IP address of the server.

  • Name
    private_ip
    Type
    string
    Description

    The private IP address of the server.

  • Name
    ssh_port
    Type
    integer
    Description

    The SSH port used to connect to the server.

  • Name
    nat_port
    Type
    integer
    Description

    The NAT port used to connect to the server.

  • Name
    timezone
    Type
    string
    Description

    The timezone of the server.

  • Name
    notes
    Type
    string
    Description

    Any additional notes about the server.

  • Name
    queue_limit
    Type
    integer
    Description

    The maximum number of projects at the same time that can be deployed to the server. Only available for business plan users.

Request

PUT
/api/v1/servers/183009
curl -X PUT https://app.depfloy.com/api/v1/servers/183009 \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production-server-updated",
    "public_ip": "203.0.113.50",
    "private_ip": "10.0.0.2",
    "ssh_port": 22
  }'

Response

{
    "message": "Server successfully updated.",
    "status": "success",
    "server_id": "183009"
}

DELETE/api/v1/servers/:id

Delete a server

This endpoint allows you to delete a server from your account. Note: All projects will be deleted along with the server.

Request

DELETE
/api/v1/servers/183009
curl -X DELETE https://app.depfloy.com/api/v1/servers/183009 \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json"
  -H "Content-Type: application/json"

Response

{
  "status": "success",
  "message": "Server deleted successfully",
  "server_id": "183009"
}

POST/api/v1/servers/:id/reboot

Reboot a server

This endpoint allows you to reboot a server. The request will be queued and the server will be rebooted.

Request

POST
/api/v1/servers/183009/reboot
curl -X POST https://app.depfloy.com/api/v1/servers/183009/reboot \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"

Response

{
  "status": "success",
  "message": "Server reboot has been queued.",
  "server_id": "183009"
}

Was this page helpful?