Skip to content

API overview

Mayadyn is a cloud orchestrator with a REST API. A workspace (called a tenant in the API and in some field names) connects its Oracle Cloud (OCI) and Google Cloud (GCP) accounts as connections, then creates VMs and apps in them. Changes to cloud state run as background operations.

Base URL https://console.mayadyn.com/v1
OIDC issuer https://id.mayadyn.com (see OIDC issuer)
MCP endpoint https://console.mayadyn.com/mcp (see MCP server)
Format JSON in and out (Content-Type: application/json)
Versioning The version is the path prefix /v1. There is no version header.
  • A request that has a body must send Content-Type: application/json (anything that starts with it). Otherwise: 415 invalid_input “send the body as application/json”.
  • Bodies are limited to 1 MiB (1,048,576 bytes). Larger: 413 invalid_input “request body is too large”.
  • Unknown fields are rejected: 400 invalid_input “invalid JSON body: json: unknown field …”. Send only the documented fields.
  • An endpoint that expects a body and gets none: 400 invalid_input “request body is required”.
  • Endpoints documented as “no body” never read one.
  • Single objects are returned as-is. Lists are always wrapped as {"items": [...]} so fields can be added later; an empty list is {"items": []}.
  • Times are RFC 3339 (2026-11-30T09:12:44.512Z). Ids are UUIDs, except audit entry ids (integers) and release numbers (integers per app).
  • 204 No Content responses have no body.
  • Every response carries X-Request-Id (16 hex characters). Quote it when reporting a problem; 500 internal errors also put it in their hint.
  • /v1/* responses carry Cache-Control: no-store. All responses carry X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: same-origin and a restrictive Content-Security-Policy.
  • Errors use one envelope: {"code", "message", "hint"?, "operation_id"?}. See Errors.
  • An unknown path under /v1 returns 404 not_found “no such endpoint”.

Full detail: Authentication.

Method How Workspace CSRF header
API token Authorization: Bearer myd_… the token’s own workspace not needed
Session (console) session cookie from /v1/auth/login X-Mayadyn-Tenant: <slug or id> per request X-Mayadyn-CSRF: 1 on every non-GET/HEAD
  • If an Authorization header is present, the cookie is ignored. An Authorization header that does not start with Bearer is 401.
  • Workspace routes (everything except account routes) need a workspace: a session without X-Mayadyn-Tenant gets 400 tenant_required.
  • Sign-in, sign-up, email verification and MFA completion always need X-Mayadyn-CSRF: 1, even without a cookie.
Scope Grants
read read everything in the workspace (or project)
write create, start, stop VMs; sync and verify connections; create, deploy, roll back apps; set app secrets
destroy delete VMs and apps; with admin, delete connections
admin connections (create, replace credentials), members, projects, tokens, workspace rules
Role Scopes
owner read, write, destroy, admin (plus owner-only actions: managing owners, workspace SSO)
admin read, write, destroy, admin
operator read, write
viewer read

A token’s effective scopes are the intersection of the scopes it was given and its creator’s current role.

Every connection, VM, app and operation belongs to a project. Each workspace has a default project. A token can be limited to one project (project_id at creation): it then sees and acts only on that project’s connections, resources, apps, operations and tokens, and cannot list members, read the audit log, or manage projects. See Projects.

Most lists return everything visible to the caller. Two are bounded:

Endpoint Parameters Default Max Order
GET /v1/operations limit 50 200 newest first
GET /v1/audit limit, before=<entry id> 100 500 newest first (id descending)

A limit that is missing, zero, negative, non-numeric or above the maximum falls back to the default (it is not clamped to the maximum). Only the audit log has a cursor (before). GET /v1/apps/{ref}/releases returns the latest 50 releases.

Operations, idempotency, dry runs, waiting

Section titled “Operations, idempotency, dry runs, waiting”

Calls that change cloud state (POST /v1/vms, VM start/stop/delete, connection sync, app deploy/rollback/delete) do not call the cloud during the request. They validate, record an operation and return it with 202 Accepted and a Location: /v1/operations/{id} header. Details: Operations.

Option Where Meaning
Idempotency-Key: <string> header Retrying with the same key returns the same operation. Keys are per project, at most 200 characters; the same key for a different request is 409 conflict.
?dry_run=true query Validate and return what would happen; nothing is written. Accepts true/false/1/0/t/f and similar boolean spellings.
?wait=30s query Wait up to this long for the operation to finish before answering (30s, 1m, or a number of seconds; capped at 60 s). A finished operation is returned with 200.

Exceeding a limit returns 429 rate_limited. The request-rate limits (the first four rows) also send Retry-After (seconds).

Limit Key Applies to
3000 requests / minute client IP everything under /v1, /mcp, /.well-known/*
10 requests / minute client IP /v1/auth/signup, /login, /verify, /mfa, /providers, /oidc/*, /sso/*
600 requests / minute caller (token id, else user id, else IP) all other /v1 endpoints
600 requests / minute bearer token /mcp (tool calls also count against the token’s /v1 budget)
10 sign-in attempts / 15 min account + IP POST /v1/auth/login (no Retry-After)
100 failed sign-ins / 15 min account POST /v1/auth/login (no Retry-After)
30 invitations / hour workspace POST /v1/members (no Retry-After)
5 verification emails / hour user POST /v1/auth/verify/resend (no Retry-After)
200 pending + running operations workspace (project for project tokens) every call that creates an operation (no Retry-After)
10 wrong second-factor codes user locks two-step sign-in for 15 minutes
Page Covers
Authentication tokens, sessions, headers, scopes, roles, MFA/SSO rules
Errors error envelope, every code, provider codes
Operations operation object, lifecycle, idempotency, /v1/operations
Sign-in and account /v1/auth/*, /v1/me, /v1/tenants, /v1/invitations
Workspace /v1/tenant
Members /v1/members
Projects /v1/projects
API tokens /v1/tokens
Catalog /v1/catalog
Connections /v1/connections and credential formats
VMs /v1/vms
Resources /v1/resources
Apps /v1/apps
Audit log /v1/audit and audit actions
Workspace single sign-on /v1/tenant/sso
MCP server /mcp tools
OIDC issuer /.well-known/*, connection tokens
Wire types every wire type

Other paths:

  • GET /healthz (no auth, no rate limit): 200 {"status":"ok"}, or 503 unavailable “database unreachable”.
  • /agent/v1/* is reserved for Mayadyn’s own app host agents; it is not part of the public API.

Create a token in the console (an API token cannot be created without first signing in; see API tokens). Then:

Terminal window
export MAYADYN=https://console.mayadyn.com
export TOKEN=myd_... # scopes: read, write, admin
# 1. Who am I?
curl -s "$MAYADYN/v1/me" -H "Authorization: Bearer $TOKEN"
# 2. Add a keyless GCP connection (no key is stored).
curl -s -X POST "$MAYADYN/v1/connections" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"provider": "gcp",
"name": "gcp-dammam",
"default_region": "me-central2",
"credentials": {
"type": "mayadyn_federated",
"project_id": "acme-prod-482916",
"workload_provider": "projects/123456789012/locations/global/workloadIdentityPools/mayadyn/providers/mayadyn-oidc",
"service_account": "mayadyn-vms@acme-prod-482916.iam.gserviceaccount.com"
}
}'
# -> 201, "status": "error" until the account owner runs the setup steps:
curl -s "$MAYADYN/v1/connections/gcp-dammam/setup" -H "Authorization: Bearer $TOKEN"
# ...run the steps in GCP, then:
curl -s -X POST "$MAYADYN/v1/connections/gcp-dammam/verify" -H "Authorization: Bearer $TOKEN"
# -> "status": "active"
# 3. Check the VM first, then create it.
curl -s -X POST "$MAYADYN/v1/vms?dry_run=true" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"connection":"gcp-dammam","name":"web-1","size":"small","image":"ubuntu-24.04",
"ssh_public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... me@laptop"}'
KEY=$(uuidgen)
curl -s -i -X POST "$MAYADYN/v1/vms" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-H "Idempotency-Key: $KEY" \
-d '{"connection":"gcp-dammam","name":"web-1","size":"small","image":"ubuntu-24.04",
"ssh_public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... me@laptop"}'
# -> 202 Accepted, Location: /v1/operations/5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f
# 4. Poll the operation (each call waits up to 60 s).
curl -s "$MAYADYN/v1/operations/5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f?wait=60s" \
-H "Authorization: Bearer $TOKEN"
# repeat while "status" is "pending" or "running"; then read resource_id:
curl -s "$MAYADYN/v1/resources/3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7" -H "Authorization: Bearer $TOKEN"

If step 3 times out on the network, repeat it with the same Idempotency-Key: you get the same operation back, never a second VM.

Related guides: Connect Oracle Cloud, Connect Google Cloud, Apps, Troubleshooting.