# Run API reference

Source: `@socra/run-api@0.4.0` (RunContract).

Build-provider-neutral workloads, deployments, and revisions.

## API surface

Base URL: `https://run.socra.cloud`

## Workloads

A stable runnable service or finite job.

### Resource schema

- `id` custom, required
- `project_id` custom, required
- `name` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `kind` "service" | "job", required
- `port` integer | null, required
- `variables` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `active_revision_id` string | null, required
- `url` string | null, required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "service",
        "job"
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "active_revision_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^rev_[0-9a-z]+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "name",
    "kind",
    "port",
    "variables",
    "secrets",
    "release_command",
    "active_revision_id",
    "url",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Create workload

`POST /v1/workloads`

#### Request body

- `project_id` custom, required
- `name` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `kind` "service" | "job" (default: "service"), optional
- `port` integer | null (default: 3000), optional
- `variables` object (default: {}), optional
- `secrets` object, optional
- `release_command` string[] | null (default: null), optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "project_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "kind": {
      "default": "service",
      "type": "string",
      "enum": [
        "service",
        "job"
      ]
    },
    "port": {
      "default": 3000,
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "release_command": {
      "default": null,
      "anyOf": [
        {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "project_id",
    "name"
  ]
}
```

#### Response

- `id` custom, required
- `project_id` custom, required
- `name` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `kind` "service" | "job", required
- `port` integer | null, required
- `variables` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `active_revision_id` string | null, required
- `url` string | null, required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "service",
        "job"
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "active_revision_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^rev_[0-9a-z]+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "name",
    "kind",
    "port",
    "variables",
    "secrets",
    "release_command",
    "active_revision_id",
    "url",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### List workloads

`GET /v1/workloads`

#### Query parameters

- `limit` integer (min: 1; max: 100), optional
- `after` string, optional
- `project_id` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    },
    "project_id": {}
  },
  "required": [
    "project_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `project_id` custom, required
  - `name` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
  - `kind` "service" | "job", required
  - `port` integer | null, required
  - `variables` object (default: {}), required
  - `secrets` object (default: {}), required
  - `release_command` string[] | null, required
  - `active_revision_id` string | null, required
  - `url` string | null, required
  - `created_at` custom, required
  - `updated_at` custom, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "project_id": {},
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 63,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "service",
              "job"
            ]
          },
          "port": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "variables": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "secrets": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            },
            "additionalProperties": {
              "anyOf": [
                {},
                {}
              ]
            }
          },
          "release_command": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "active_revision_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^rev_[0-9a-z]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {},
          "updated_at": {}
        },
        "required": [
          "id",
          "project_id",
          "name",
          "kind",
          "port",
          "variables",
          "secrets",
          "release_command",
          "active_revision_id",
          "url",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get workload

`GET /v1/workloads/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `name` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `kind` "service" | "job", required
- `port` integer | null, required
- `variables` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `active_revision_id` string | null, required
- `url` string | null, required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "service",
        "job"
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "active_revision_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^rev_[0-9a-z]+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "name",
    "kind",
    "port",
    "variables",
    "secrets",
    "release_command",
    "active_revision_id",
    "url",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Update workload

`PATCH /v1/workloads/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Request body

- `kind` "service" | "job", optional
- `port` integer | null, optional
- `variables` object (default: {}), optional
- `secrets` object, optional
- `release_command` string[] | null, optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "service",
        "job"
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "release_command": {
      "anyOf": [
        {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
```

#### Response

- `id` custom, required
- `project_id` custom, required
- `name` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `kind` "service" | "job", required
- `port` integer | null, required
- `variables` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `active_revision_id` string | null, required
- `url` string | null, required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "service",
        "job"
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "active_revision_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^rev_[0-9a-z]+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "name",
    "kind",
    "port",
    "variables",
    "secrets",
    "release_command",
    "active_revision_id",
    "url",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Delete workload

`DELETE /v1/workloads/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

No response body.

## Deployments

A request to reconcile an immutable image into a workload.

### Resource schema

- `id` custom, required
- `project_id` custom, required
- `workload_id` custom, required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `url` string | null, required
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required
- `revision_id` string | null, required
- `error` string | null, required
- `logs` string, required
- `created_at` custom, required
- `updated_at` custom, required
- `started_at` custom | null, required
- `finished_at` custom | null, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "workload_id": {},
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logs": {
      "type": "string"
    },
    "created_at": {},
    "updated_at": {},
    "started_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    },
    "finished_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "project_id",
    "workload_id",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "url",
    "status",
    "revision_id",
    "error",
    "logs",
    "created_at",
    "updated_at",
    "started_at",
    "finished_at"
  ],
  "additionalProperties": false
}
```

### Create deployment

`POST /v1/deployments`

#### Request body

- `project_id` custom, required
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "project_id": {},
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    }
  },
  "required": [
    "project_id",
    "workload",
    "image"
  ]
}
```

#### Response

- `id` custom, required
- `project_id` custom, required
- `workload_id` custom, required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `url` string | null, required
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required
- `revision_id` string | null, required
- `error` string | null, required
- `logs` string, required
- `created_at` custom, required
- `updated_at` custom, required
- `started_at` custom | null, required
- `finished_at` custom | null, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "workload_id": {},
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logs": {
      "type": "string"
    },
    "created_at": {},
    "updated_at": {},
    "started_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    },
    "finished_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "project_id",
    "workload_id",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "url",
    "status",
    "revision_id",
    "error",
    "logs",
    "created_at",
    "updated_at",
    "started_at",
    "finished_at"
  ],
  "additionalProperties": false
}
```

### List deployments

`GET /v1/deployments`

#### Query parameters

- `limit` integer (min: 1; max: 100), optional
- `after` string, optional
- `project_id` custom, required
- `workload_id` custom, optional
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    },
    "project_id": {},
    "workload_id": {},
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    }
  },
  "required": [
    "project_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `project_id` custom, required
  - `workload_id` custom, required
  - `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
  - `variables` object (default: {}), required
  - `secret_references` object (default: {}), required
  - `secrets` object (default: {}), required
  - `release_command` string[] | null, required
  - `url` string | null, required
  - `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required
  - `revision_id` string | null, required
  - `error` string | null, required
  - `logs` string, required
  - `created_at` custom, required
  - `updated_at` custom, required
  - `started_at` custom | null, required
  - `finished_at` custom | null, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "project_id": {},
          "workload_id": {},
          "image": {
            "type": "string",
            "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
          },
          "variables": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "secret_references": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            },
            "additionalProperties": {
              "anyOf": [
                {},
                {}
              ]
            }
          },
          "secrets": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            },
            "additionalProperties": {}
          },
          "release_command": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "revision_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "logs": {
            "type": "string"
          },
          "created_at": {},
          "updated_at": {},
          "started_at": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "project_id",
          "workload_id",
          "image",
          "variables",
          "secret_references",
          "secrets",
          "release_command",
          "url",
          "status",
          "revision_id",
          "error",
          "logs",
          "created_at",
          "updated_at",
          "started_at",
          "finished_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get deployment

`GET /v1/deployments/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `workload_id` custom, required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `url` string | null, required
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required
- `revision_id` string | null, required
- `error` string | null, required
- `logs` string, required
- `created_at` custom, required
- `updated_at` custom, required
- `started_at` custom | null, required
- `finished_at` custom | null, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "workload_id": {},
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logs": {
      "type": "string"
    },
    "created_at": {},
    "updated_at": {},
    "started_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    },
    "finished_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "project_id",
    "workload_id",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "url",
    "status",
    "revision_id",
    "error",
    "logs",
    "created_at",
    "updated_at",
    "started_at",
    "finished_at"
  ],
  "additionalProperties": false
}
```

### Get deployment logs

`GET /v1/deployments/{id}/logs`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `data` string, required
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    }
  },
  "required": [
    "data",
    "status"
  ],
  "additionalProperties": false
}
```

### Get deployment events

`GET /v1/deployments/{id}/events`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `data` object[], required
  - `type` "queued" | "started" | "succeeded" | "failed" | "cancelled", required
  - `at` custom, required
  - `message` string, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "queued",
              "started",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "at": {},
          "message": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "at",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}
```

### Get deployment health

`GET /v1/deployments/{id}/health`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `status` "pending" | "deploying" | "healthy" | "unhealthy" | "stopped", required
- `url` string | null, required
- `revision_id` string | null, required
- `checked_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "deploying",
        "healthy",
        "unhealthy",
        "stopped"
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "checked_at": {}
  },
  "required": [
    "status",
    "url",
    "revision_id",
    "checked_at"
  ],
  "additionalProperties": false
}
```

### Cancel deployment

`POST /v1/deployments/{id}/cancel`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `workload_id` custom, required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `url` string | null, required
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required
- `revision_id` string | null, required
- `error` string | null, required
- `logs` string, required
- `created_at` custom, required
- `updated_at` custom, required
- `started_at` custom | null, required
- `finished_at` custom | null, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "workload_id": {},
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logs": {
      "type": "string"
    },
    "created_at": {},
    "updated_at": {},
    "started_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    },
    "finished_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "project_id",
    "workload_id",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "url",
    "status",
    "revision_id",
    "error",
    "logs",
    "created_at",
    "updated_at",
    "started_at",
    "finished_at"
  ],
  "additionalProperties": false
}
```

## Revisions

An immutable successful workload configuration.

### Resource schema

- `id` custom, required
- `project_id` custom, required
- `deployment_id` custom, required
- `workload_id` custom, required
- `number` integer (greater than: 0; max: 9007199254740991), required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `created_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "deployment_id": {},
    "workload_id": {},
    "number": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {}
  },
  "required": [
    "id",
    "project_id",
    "deployment_id",
    "workload_id",
    "number",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "created_at"
  ],
  "additionalProperties": false
}
```

### List revisions

`GET /v1/revisions`

#### Query parameters

- `limit` integer (min: 1; max: 100), optional
- `after` string, optional
- `project_id` custom, required
- `workload_id` custom, optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    },
    "project_id": {},
    "workload_id": {}
  },
  "required": [
    "project_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `project_id` custom, required
  - `deployment_id` custom, required
  - `workload_id` custom, required
  - `number` integer (greater than: 0; max: 9007199254740991), required
  - `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
  - `variables` object (default: {}), required
  - `secret_references` object (default: {}), required
  - `secrets` object (default: {}), required
  - `release_command` string[] | null, required
  - `created_at` custom, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "project_id": {},
          "deployment_id": {},
          "workload_id": {},
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "image": {
            "type": "string",
            "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
          },
          "variables": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "secret_references": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            },
            "additionalProperties": {
              "anyOf": [
                {},
                {}
              ]
            }
          },
          "secrets": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            },
            "additionalProperties": {}
          },
          "release_command": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {}
        },
        "required": [
          "id",
          "project_id",
          "deployment_id",
          "workload_id",
          "number",
          "image",
          "variables",
          "secret_references",
          "secrets",
          "release_command",
          "created_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get revision

`GET /v1/revisions/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `deployment_id` custom, required
- `workload_id` custom, required
- `number` integer (greater than: 0; max: 9007199254740991), required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `created_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "deployment_id": {},
    "workload_id": {},
    "number": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {}
  },
  "required": [
    "id",
    "project_id",
    "deployment_id",
    "workload_id",
    "number",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "created_at"
  ],
  "additionalProperties": false
}
```

### Roll back to revision

`POST /v1/revisions/{id}/rollback`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `workload_id` custom, required
- `image` string (pattern: ^[^\s@]+@sha256:[0-9a-f]{64}$), required
- `variables` object (default: {}), required
- `secret_references` object (default: {}), required
- `secrets` object (default: {}), required
- `release_command` string[] | null, required
- `url` string | null, required
- `status` "queued" | "running" | "succeeded" | "failed" | "cancelled", required
- `revision_id` string | null, required
- `error` string | null, required
- `logs` string, required
- `created_at` custom, required
- `updated_at` custom, required
- `started_at` custom | null, required
- `finished_at` custom | null, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "workload_id": {},
    "image": {
      "type": "string",
      "pattern": "^[^\\s@]+@sha256:[0-9a-f]{64}$"
    },
    "variables": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "secret_references": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {
        "anyOf": [
          {},
          {}
        ]
      }
    },
    "secrets": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Z_][A-Z0-9_]*$"
      },
      "additionalProperties": {}
    },
    "release_command": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "cancelled"
      ]
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logs": {
      "type": "string"
    },
    "created_at": {},
    "updated_at": {},
    "started_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    },
    "finished_at": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "project_id",
    "workload_id",
    "image",
    "variables",
    "secret_references",
    "secrets",
    "release_command",
    "url",
    "status",
    "revision_id",
    "error",
    "logs",
    "created_at",
    "updated_at",
    "started_at",
    "finished_at"
  ],
  "additionalProperties": false
}
```

## Routes

A Run ingress rule connecting one claimed Hostname to a service workload.

### Resource schema

- `id` custom, required
- `project_id` custom, required
- `hostname_id` custom, required
- `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), required
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "hostname_id": {},
    "hostname": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "hostname_id",
    "hostname",
    "workload",
    "status",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Create route

`POST /v1/routes`

#### Request body

- `project_id` custom, required
- `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), required
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "project_id": {},
    "hostname": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    }
  },
  "required": [
    "project_id",
    "hostname",
    "workload"
  ]
}
```

#### Response

- `id` custom, required
- `project_id` custom, required
- `hostname_id` custom, required
- `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), required
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "hostname_id": {},
    "hostname": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "hostname_id",
    "hostname",
    "workload",
    "status",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### List routes

`GET /v1/routes`

#### Query parameters

- `limit` integer (min: 1; max: 100), optional
- `after` string, optional
- `project_id` custom, required
- `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), optional
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), optional
- `status` "active" | "disabled", optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string"
    },
    "project_id": {},
    "hostname": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    }
  },
  "required": [
    "project_id"
  ]
}
```

#### Response

- `data` object[], required
  - `id` custom, required
  - `project_id` custom, required
  - `hostname_id` custom, required
  - `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), required
  - `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
  - `status` "active" | "disabled", required
  - `created_at` custom, required
  - `updated_at` custom, required
- `has_more` boolean, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {},
          "project_id": {},
          "hostname_id": {},
          "hostname": {
            "type": "string",
            "minLength": 3,
            "maxLength": 253,
            "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
          },
          "workload": {
            "type": "string",
            "minLength": 1,
            "maxLength": 63,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "created_at": {},
          "updated_at": {}
        },
        "required": [
          "id",
          "project_id",
          "hostname_id",
          "hostname",
          "workload",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      }
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "has_more"
  ],
  "additionalProperties": false
}
```

### Get route

`GET /v1/routes/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

- `id` custom, required
- `project_id` custom, required
- `hostname_id` custom, required
- `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), required
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "hostname_id": {},
    "hostname": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "hostname_id",
    "hostname",
    "workload",
    "status",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Update route

`PATCH /v1/routes/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Request body

- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), optional
- `status` "active" | "disabled", optional

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    }
  }
}
```

#### Response

- `id` custom, required
- `project_id` custom, required
- `hostname_id` custom, required
- `hostname` string (min length: 3; max length: 253; pattern: ^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$), required
- `workload` string (min length: 1; max length: 63; pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$), required
- `status` "active" | "disabled", required
- `created_at` custom, required
- `updated_at` custom, required

JSON Schema:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {},
    "project_id": {},
    "hostname_id": {},
    "hostname": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
    },
    "workload": {
      "type": "string",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "created_at": {},
    "updated_at": {}
  },
  "required": [
    "id",
    "project_id",
    "hostname_id",
    "hostname",
    "workload",
    "status",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
```

### Delete route

`DELETE /v1/routes/{id}`

#### Path parameters

- `id` custom, required

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
```


#### Response

No response body.

---

Company: Socra — Multiply Your Judgment
Canonical URL: https://cloud.socra.com/docs/run/reference/api
