Project API reference
A project: where sandboxes, storage, addresses and keys sit, each in one. Every organization has a default project, where a call that names none acts.
Base URL: https://api.withruntime.com. Authentication, idempotency and errors work the same way for every product.
Its states: active, deleted.
Endpoints#
| Method | Path | Description |
|---|---|---|
GET |
/v2/projects |
List projects |
POST |
/v2/projects/{id}:update |
update |
DELETE |
/v2/projects/{id} |
Delete a project |
List projects#
GET /v2/projects
Lists the organization's projects, the default first, then by name.
Its action, for a key's grant: projects:list.
Query:
| Field | Type | Required | Description |
|---|---|---|---|
cursor |
string | No | Where the page starts: a page's next. |
limit |
integer | No | The most items the page holds. At least 1. At most 200. Default: 50. |
Returns a page: items, each a Project, and next, where the next page starts, none on the last.
Examples:
Terminalcurl -X GET "https://api.withruntime.com/v2/projects" \ -H "Authorization: Bearer $RUNTIME_API_KEY"TypeScriptimport { Runtime } from "withruntime";const runtime = new Runtime(); // RUNTIME_API_KEY from the environmentconst result = await runtime.projects.list();Pythonfrom withruntime import Runtimeruntime = Runtime() # RUNTIME_API_KEY from the environmentresult = runtime.projects.list()rubyrequire "withruntime"kit = Withruntime::Generated::Kit.new # RUNTIME_API_KEY from the environmentresult = kit.projects.listTerminalruntime projects listupdate#
POST /v2/projects/{id}:update
Renames a project; what is in it stays as it is. A name another project has returns 409.
Its action, for a key's grant: projects:update.
Path: id.
Body: a Rename.
Returns a Project.
Examples:
Terminalcurl -X POST "https://api.withruntime.com/v2/projects/PROJECT_ID:update" \ -H "Authorization: Bearer $RUNTIME_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "example" }'TypeScriptimport { Runtime } from "withruntime";const runtime = new Runtime(); // RUNTIME_API_KEY from the environmentconst result = await runtime.projects.update("PROJECT_ID", { name: "example" });Pythonfrom withruntime import Runtimeruntime = Runtime() # RUNTIME_API_KEY from the environmentresult = runtime.projects.update("PROJECT_ID", name="example")rubyrequire "withruntime"kit = Withruntime::Generated::Kit.new # RUNTIME_API_KEY from the environmentresult = kit.projects.update("PROJECT_ID", name: "example")Terminalruntime projects update PROJECT_ID --name exampleDelete a project#
DELETE /v2/projects/{id}
Deletes a project and frees its name, with the grants, keys and invitations held to it. The caller needs grants:delete as well, as the grants go with it. The default project, or one that still holds a sandbox, storage or an address, returns 409. Deleted again, it returns 404.
Its action, for a key's grant: projects:delete.
Path: id.
Returns a Project.
Examples:
Terminalcurl -X DELETE "https://api.withruntime.com/v2/projects/PROJECT_ID" \ -H "Authorization: Bearer $RUNTIME_API_KEY"TypeScriptimport { Runtime } from "withruntime";const runtime = new Runtime(); // RUNTIME_API_KEY from the environmentconst result = await runtime.projects.delete("PROJECT_ID");Pythonfrom withruntime import Runtimeruntime = Runtime() # RUNTIME_API_KEY from the environmentresult = runtime.projects.delete("PROJECT_ID")rubyrequire "withruntime"kit = Withruntime::Generated::Kit.new # RUNTIME_API_KEY from the environmentresult = kit.projects.delete("PROJECT_ID")Terminalruntime projects delete PROJECT_IDObjects#
Project
A project: where sandboxes, storage, addresses and keys sit.
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Its ID. |
object |
one of project |
Yes | Always project. |
name |
string | Yes | Its name, unique in the organization. |
default |
boolean | Yes | Whether it is the organization's default project, where a call that names none acts. |
createdAt |
string (RFC 3339) | Yes | When it was made. |
state |
one of active, deleted |
Yes | active; deleted once deleted: a delete's answer. |
deletedAt |
string (RFC 3339) | No | When it was deleted: a delete's answer, its state deleted. |
Rename
A new name; everything else stays as it is.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Its name. At least 1 character. At most 64 characters. |