Skip to navigation

Create a project

Creates a project in the account. name is required. The response carries webhook_secret once. Store it: it signs the webhook deliveries of this project and is not shown again unless you rotate it.

A new project has no keys. Mint one with POST /v1/keys and the new project_id.

Rules:

  • routing sets defaults for every request made with this project’s keys. See the ProjectWrite schema.
  • webhook_url must be an https URL that resolves to a public address.
  • Unknown fields return 400, also inside routing. A misspelled lock or only would otherwise be ignored.
  • Send Idempotency-Key so a retry cannot create a second project. A retry by the same API key with the same Idempotency-Key and body returns the first response with Idempotent-Replayed: true and without webhook_secret: Meadow never saves a one-time secret. If you lost the first response, rotate the secret with rotate_webhook_secret.

Scope: admin.

Authentication

AuthorizationBearer

A Meadow API key, sent as Authorization: Bearer mdw_.... The header x-api-key: mdw_... is accepted in its place.

Headers

Idempotency-KeystringOptionalformat: "^[ -~]+$"1-255 characters

Makes a retry safe. A repeat with the same key and the same body returns the result of the first call instead of starting again. The same key with a different body returns 409. On POST /v1/keys, POST /v1/projects and POST /v1/images a value is scoped to the API key that sent it: another key that sends the same value starts its own request. The sandbox and exec routes scope it to the API key too. On the exec route the header only has an effect with background: true. See Idempotency in the introduction for how long a value is kept.

The key is 1 to 255 bytes of printable ASCII. A blank, longer, or non-ASCII key, or the header sent twice, returns 400. A UUID works well.

Request

At most 1 MiB.
namestringOptional
A name for people. Required on create. Must not be empty. It need not be unique.
webhook_urlstring or nullOptionalformat: "uri"

Where to send sandbox events for sandboxes that set no webhook_url of their own. Must be https and resolve to a public address. null removes it.

max_sandboxesinteger or nullOptional>=0

The most sandboxes of this project that may be alive at once, whichever key made them. Null or left out means no cap. It counts the same states as max_sandboxes on a key, and a create past it returns 403 project_sandbox_limit_exceeded. While a project has a cap, its sandbox creates are admitted one at a time, which is a few database statements each. It counts sandboxes, not dollars.

routingobjectOptional
Defaults for every request made with this project's keys. On update it is replaced as a whole.

Response headers

x-request-idstringOptional

Meadow’s id for this request, req_ and 24 hex characters. Every response carries it, including errors, streams and unknown routes. Every error in the Error schema repeats it as request_id. Quote it when you report a problem.

Idempotent-ReplayedenumOptional

true when this response is the saved result of an earlier request with the same Idempotency-Key. Absent on a first response. Sent by POST /v1/keys, POST /v1/projects, POST /v1/images, POST /v1/sandboxes and a background POST /v1/sandboxes/{sandbox_id}/exec. On the two sandbox routes the body is the sandbox or the command as it is now.

Allowed values:

Response

Created. webhook_secret is shown only here. A replay of this response (Idempotent-Replayed: true) does not carry webhook_secret.

namestring
A name for people. Required on create. Must not be empty. It need not be unique.
idstring
The project id.
restrictedboolean

When true, a member or viewer sees the project only after addProjectMember. Owners, admins and keys are not affected.

created_atdatetime
When the project was created.
webhook_urlstring or nullOptionalformat: "uri"

Where to send sandbox events for sandboxes that set no webhook_url of their own. Must be https and resolve to a public address. null removes it.

max_sandboxesinteger or nullOptional>=0

The most sandboxes of this project that may be alive at once, whichever key made them. Null or left out means no cap. It counts the same states as max_sandboxes on a key, and a create past it returns 403 project_sandbox_limit_exceeded. While a project has a cap, its sandbox creates are admitted one at a time, which is a few database statements each. It counts sandboxes, not dollars.

routingobjectOptional
Defaults for every request made with this project's keys. On update it is replaced as a whole.
webhook_secretstringOptional

The secret that signs webhook deliveries, starting with whsec_. Returned on create and when rotate_webhook_secret is true. Absent otherwise.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
413
Content Too Large Error
429
Too Many Requests Error
500
Internal Server Error