Skip to main content
POST
/
projects
/
{project_id}
/
services
/
{service_id}
/
forkService
Fork a Service
curl --request POST \
  --url https://console.cloud.timescale.com/public/api/v1/projects/{project_id}/services/{service_id}/forkService \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "my-production-db-fork",
  "cpu_millis": "1000",
  "memory_gbs": "4",
  "fork_strategy": "LAST_SNAPSHOT",
  "target_time": "2024-01-01T00:00:00Z",
  "environment_tag": "DEV"
}'
{
  "service_id": "<string>",
  "project_id": "<string>",
  "name": "<string>",
  "region_code": "us-east-1",
  "service_type": "TIMESCALEDB",
  "created": "2023-11-07T05:31:56Z",
  "initial_password": "a-very-secure-initial-password",
  "paused": true,
  "status": "QUEUED",
  "resources": [
    {
      "id": "<string>",
      "spec": {
        "cpu_millis": 123,
        "memory_gbs": 123,
        "volume_type": "<string>"
      }
    }
  ],
  "metadata": {
    "environment": "<string>"
  },
  "endpoint": {
    "host": "my-service.com",
    "port": 8080
  },
  "vpcEndpoint": {},
  "forked_from": {
    "project_id": "asda1b2c3",
    "service_id": "bbss422fg",
    "is_standby": false
  },
  "ha_replicas": {
    "sync_replica_count": 1,
    "replica_count": 1
  },
  "connection_pooler": {
    "endpoint": {
      "host": "my-service.com",
      "port": 8080
    }
  },
  "read_replica_sets": [
    {
      "id": "alb8jicdpr",
      "name": "reporting-replica-1",
      "status": "active",
      "nodes": 2,
      "cpu_millis": 250,
      "memory_gbs": 1,
      "metadata": {
        "environment": "<string>"
      },
      "endpoint": {
        "host": "my-service.com",
        "port": 8080
      },
      "connection_pooler": {
        "endpoint": {
          "host": "my-service.com",
          "port": 8080
        }
      }
    }
  ]
}

Path Parameters

project_id
string
required

The unique identifier of the project.

Example:

"rp1pz7uyae"

service_id
string
required

The unique identifier of the service.

Example:

"d1k5vk7hf2"

Body

application/json

Create a fork of an existing service. Service type, region code, and storage are always inherited from the parent service. HA replica count is always set to 0 for forked services.

fork_strategy
enum<string>
required

Strategy for creating the fork. This field is required.

Available options:
LAST_SNAPSHOT,
NOW,
PITR
name
string

A human-readable name for the forked service. If not provided, will use parent service name with "-fork" suffix.

Example:

"my-production-db-fork"

cpu_millis
string

The initial CPU allocation in milli-cores, or 'shared' for a shared-resource service. If not provided, will inherit from parent service.

Example:

"1000"

memory_gbs
string

The initial memory allocation in gigabytes, or 'shared' for a shared-resource service. If not provided, will inherit from parent service.

Example:

"4"

target_time
string<date-time>

Target time for point-in-time recovery. Required when fork_strategy is PITR.

Example:

"2024-01-01T00:00:00Z"

environment_tag
enum<string>

The environment tag for the forked service, 'DEV' by default.

Available options:
DEV,
PROD

Response

Fork request accepted. The response contains the details of the new service being created.

service_id
string

The unique identifier for the service.

project_id
string

The project this service belongs to.

name
string

The name of the service.

region_code
string

The cloud region where the service is hosted.

Example:

"us-east-1"

service_type
enum<string>

The type of the service.

Available options:
TIMESCALEDB,
POSTGRES,
VECTOR
created
string<date-time>

Creation timestamp

initial_password
string<password>

The initial password for the service.

Example:

"a-very-secure-initial-password"

paused
boolean

Whether the service is paused

status
enum<string>

Current status of the service

Available options:
QUEUED,
DELETING,
CONFIGURING,
READY,
DELETED,
UNSTABLE,
PAUSING,
PAUSED,
RESUMING,
UPGRADING,
OPTIMIZING
resources
object[]

List of resources allocated to the service

metadata
object

Additional metadata for the service

endpoint
object
vpcEndpoint
object | null

VPC endpoint configuration if available

forked_from
object
ha_replicas
object
connection_pooler
object
read_replica_sets
object[]