Skip to content

API reference

Members and invitations API

List an organization's members, change roles, remove members, invite by email, accept invitations, transfer ownership, delete an organization, and choose the active organization. These routes need a browser session.

On this page

List members

GET /v1/organizations/{organization_id}/members

  • API key: Authorization: Bearer vmy_… with preset read_only, use_existing, create_and_use, full_access.
  • Browser session: the vmyard_session cookie.
  • Who: Any member.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes

Responses

StatusDescriptionBody
200—MemberList
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404Not a member, or another organization than the API key'sProblemDetails
Request
curl "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/members" \
  -H "Authorization: Bearer $VMYARD_API_KEY"
Response 200
{
  "items": [
    {
      "email": "ada@example.com",
      "joined_at": "2026-10-12T05:51:01Z",
      "max_running_machines": 0,
      "role": "owner",
      "running_machines": 0,
      "usage_this_month": {
        "cost_micros": 0,
        "seconds": 0
      },
      "user_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
    }
  ]
}

Change a member's role

PATCH /v1/organizations/{organization_id}/members/{user_id}

An admin can't change an owner or make anyone an owner, and the only owner can't be demoted (409 last_owner).

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: Owner or Admin.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes
user_idpathstring (uuid)Yes

Request body (application/json, UpdateMemberRequest)

FieldTypeRequiredDescription
max_running_machinesinteger | nullNo0-10000, or null to remove the member's cap; absent leaves it. at most 10000.
rolenull | RoleDtoNo

Responses

StatusDescriptionBody
200The member after the change; usage_this_month is zero here, read it from the listMemberDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure, session_required, or forbidden: neither owner nor admin, or an admin changing an owner or granting the owner roleProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
409last_owner: the organization's only owner cannot be demotedProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
Request
curl -X PATCH "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/members/$USER_ID" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
{
  "email": "ada@example.com",
  "joined_at": "2026-10-12T05:51:01Z",
  "max_running_machines": 0,
  "role": "owner",
  "running_machines": 0,
  "usage_this_month": {
    "cost_micros": 0,
    "seconds": 0
  },
  "user_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
}

Remove a member

DELETE /v1/organizations/{organization_id}/members/{user_id}

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: Owner or Admin.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes
user_idpathstring (uuid)Yes

Responses

StatusDescriptionBody
200—MemberRemovedDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure, session_required, or forbidden: neither owner nor admin (anyone may remove themselves), or an admin removing an ownerProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
409last_ownerProblemDetails
Request
curl -X DELETE "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/members/$USER_ID" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF"
Response 200
{
  "api_keys_revoked": 0,
  "channels_revoked": 0,
  "tickets_revoked": 0,
  "user_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
}

List pending invitations

GET /v1/organizations/{organization_id}/invitations

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie.
  • Who: Owner or Admin.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes

Responses

StatusDescriptionBody
200—InvitationList
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403Neither owner nor admin, or an API key (session_required)ProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
Request
curl "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/invitations" \
  -b "vmyard_session=$VMYARD_SESSION"
Response 200
{
  "items": [
    {
      "created_at": "2026-10-12T05:51:01Z",
      "email": "ada@example.com",
      "expires_at": "2026-10-12T05:51:01Z",
      "id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
      "invited_by": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
      "organization_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
      "role": "owner"
    }
  ]
}

Invite a member by email

POST /v1/organizations/{organization_id}/invitations

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: Owner or Admin.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes

Request body (application/json, CreateInvitationRequest)

FieldTypeRequiredDescription
emailstringYes
roleRoleDtoYes

Responses

StatusDescriptionBody
201Emailed with a single-use link valid 7 days; an open invitation to the same address is revokedInvitationDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure, session_required, or forbidden (neither owner nor admin, or an admin inviting an owner)ProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
409already_memberProblemDetails
422Invalid request (invalid_request); field_errors names the fields.ProblemDetails
429rate_limited: 50 invitations per organization per 24 hoursProblemDetails
502email_unavailable: the email could not be sent; the invitation was revokedProblemDetails
503invitations_unavailable: email or ui_base_url is not configuredProblemDetails
Request
curl -X POST "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/invitations" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ada@example.com",
  "role": "owner"
}'
Response 201
{
  "created_at": "2026-10-12T05:51:01Z",
  "email": "ada@example.com",
  "expires_at": "2026-10-12T05:51:01Z",
  "id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "invited_by": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "organization_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "role": "owner"
}

Revoke an invitation

DELETE /v1/organizations/{organization_id}/invitations/{invitation_id}

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: Owner or Admin.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes
invitation_idpathstring (uuid)Yes

Responses

StatusDescriptionBody
204Revoked (revoking a revoked invitation changes nothing)—
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403Refused for this caller: role, key preset, CSRF token, or organization (forbidden, insufficient_scope, csrf_invalid, organization_mismatch, session_required).ProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
410invitation_closed: already acceptedProblemDetails
Request
curl -X DELETE "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/invitations/$INVITATION_ID" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF"

Preview an invitation

GET /v1/invitations

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie.
  • Who: The signed-in user.

Parameters

NameInTypeRequiredDescription
tokenquerystringYesThe token from the invitation email.

Responses

StatusDescriptionBody
200—InvitationPreviewDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
404No invitation has this tokenProblemDetails
Request
curl "$VMYARD_API_URL/v1/invitations?token=token" \
  -b "vmyard_session=$VMYARD_SESSION"
Response 200
{
  "email": "ada@example.com",
  "expires_at": "2026-10-12T05:51:01Z",
  "organization_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "organization_name": "string",
  "role": "owner",
  "state": "open"
}

Accept an invitation

POST /v1/invitations/accept

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: The signed-in user.

Request body (application/json, AcceptInvitationRequest)

FieldTypeRequiredDescription
tokenstringYes

Responses

StatusDescriptionBody
200The caller is a member with the invited role, and it is their active organizationInvitationAcceptedDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure, session_required, or invitation_email_mismatch: the caller's sign-in addresses do not include the invited oneProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
409already_memberProblemDetails
410invitation_closed: accepted, revoked, or expiredProblemDetails
Request
curl -X POST "$VMYARD_API_URL/v1/invitations/accept" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF" \
  -H "Content-Type: application/json" \
  -d '{
  "token": "string"
}'
Response 200
{
  "organization_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "role": "owner"
}

Transfer ownership

POST /v1/organizations/{organization_id}/transfer

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: Owner.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes

Request body (application/json, TransferOwnershipRequest)

FieldTypeRequiredDescription
user_idstring (uuid)YesA member who becomes the owner; the caller becomes an admin.

Responses

StatusDescriptionBody
204The member is an owner and the caller an admin—
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure, session_required, or not the ownerProblemDetails
404The caller or the new owner is not a memberProblemDetails
Request
curl -X POST "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID/transfer" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF" \
  -H "Content-Type: application/json" \
  -d '{
  "user_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
}'

Delete an organization

DELETE /v1/organizations/{organization_id}

Needs a sign-in within the last 15 minutes (403 recent_auth_required). Its machines are stopped (stop_reason: organization_deleted).

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: Owner.

Parameters

NameInTypeRequiredDescription
organization_idpathstring (uuid)Yes

Responses

StatusDescriptionBody
200—OrganizationDeletedDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure, session_required, recent_auth_required (sign in again within 15 minutes), or not the ownerProblemDetails
404Not found in this organization (resource_not_found).ProblemDetails
409subscription_active: cancel the renewing plan firstProblemDetails
Request
curl -X DELETE "$VMYARD_API_URL/v1/organizations/$ORGANIZATION_ID" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF"
Response 200
{
  "api_keys_revoked": 0,
  "channels_revoked": 0,
  "machines_stopping": 0,
  "members_removed": 0,
  "organization_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "tickets_revoked": 0
}

Choose the active organization

PUT /v1/me/active-organization

  • API key: not accepted (403 session_required).
  • Browser session: the vmyard_session cookie and the x-csrf-token header.
  • Who: The signed-in user.

Request body (application/json, ActiveOrganizationRequest)

FieldTypeRequiredDescription
organization_idstring (uuid) | nullNoAn organization the caller belongs to, or null to clear it.

Responses

StatusDescriptionBody
200—ActiveOrganizationDto
401Not signed in, or the API key is malformed, expired, or revoked (unauthenticated, invalid_api_key).ProblemDetails
403CSRF failure or session_requiredProblemDetails
404Not a member of that organizationProblemDetails
Request
curl -X PUT "$VMYARD_API_URL/v1/me/active-organization" \
  -b "vmyard_session=$VMYARD_SESSION" \
  -H "x-csrf-token: $VMYARD_CSRF" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
{
  "active_organization_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
}