openapi: 3.1.0
info:
title: Den Admin Members API
description: 'OpenAPI spec for the Den control plane API.
Authentication:
- Use `Authorization: Bearer <session-token>` for user-authenticated routes that require a Den session.
- Use `x-api-key: <den-api-key>` for API-key-authenticated routes that accept organization API keys.
- Public routes like health and documentation do not require authentication.
Swagger tip: use the security schemes in the Authorize dialog to set either `bearerAuth` or `denApiKey` before trying protected endpoints.'
version: dev
servers:
- url: https://api.openworklabs.com
tags:
- name: Members
description: Organization member management routes.
paths:
/v1/members/{memberId}/role:
post:
operationId: postV1MembersByMemberIdRole
tags:
- Members
summary: Update member role
description: Changes the role assigned to a specific organization member.
responses:
'200':
description: Member role updated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
'400':
description: The member role update request was invalid.
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidRequestError'
'401':
description: The caller must be signed in to update member roles.
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: Only workspace owners can update member roles.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: The member or organization could not be found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
parameters:
- in: path
name: memberId
schema:
format: typeid
type: string
minLength: 29
maxLength: 29
pattern: ^om_.*
required: true
description: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
role:
type: string
minLength: 1
maxLength: 64
required:
- role
/v1/members/{memberId}/transfer-ownership:
post:
operationId: postV1MembersByMemberIdTransferOwnership
tags:
- Members
summary: Transfer workspace ownership
description: Transfers the protected workspace owner role to another active organization member. Workspace admins may use this endpoint only to recover an organization that has no active owner.
responses:
'200':
description: Workspace ownership transferred successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
'400':
description: The ownership transfer request was invalid.
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidRequestError'
'401':
description: The caller must be signed in to transfer ownership.
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: Only workspace owners can transfer ownership.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: The target member or organization could not be found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
parameters:
- in: path
name: memberId
schema:
format: typeid
type: string
minLength: 29
maxLength: 29
pattern: ^om_.*
required: true
description: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
/v1/members/{memberId}:
delete:
operationId: deleteV1MembersByMemberId
tags:
- Members
summary: Remove organization member
description: Removes a member from an organization while protecting the owner role from deletion.
responses:
'204':
description: Member removed successfully.
'400':
description: The member removal request was invalid.
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidRequestError'
'401':
description: The caller must be signed in to remove organization members.
content:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedError'
'403':
description: Only workspace owners and admins can remove members.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: The member or organization could not be found.
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundError'
parameters:
- in: path
name: memberId
schema:
format: typeid
type: string
minLength: 29
maxLength: 29
pattern: ^om_.*
required: true
description: Den TypeID with 'om_' prefix and a 26-character base32 suffix.
components:
schemas:
InvalidRequestError:
type: object
properties:
error:
type: string
const: invalid_request
details:
type: array
items:
type: object
properties:
message:
type: string
path:
type: array
items:
anyOf:
- type: string
- type: number
required:
- message
additionalProperties: {}
required:
- error
- details
NotFoundError:
type: object
properties:
error:
type: string
message:
type: string
required:
- error
ForbiddenError:
type: object
properties:
error:
type: string
enum:
- forbidden
- reauth
reason:
type: string
message:
type: string
required:
- error
SuccessResponse:
type: object
properties:
success:
type: boolean
const: true
required:
- success
UnauthorizedError:
type: object
properties:
error:
type: string
const: unauthorized
required:
- error
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: session-token
description: 'Session token passed as `Authorization: Bearer <session-token>` for user-authenticated Den routes.'
denApiKey:
type: apiKey
in: header
name: x-api-key
description: Organization API key passed as the `x-api-key` header for API-key-authenticated Den routes.