Skip to content
Subako Docs
Esc
navigateopen⌘Jpreview

POST /v1/workspaces/{workspace_id}/members

POST/v1/workspaces/{workspace_id}/members
Authorization
AuthorizationBearer token · headerrequired
Path parameters
workspace_idstring<uuid>required
Workspace id
Header parameters
Idempotency-Keystring
Retry the same operation with this key to return its saved receipt. Scoped by the operation's authenticated caller or resource. A different input under the same key returns 409. Receipts are retained for at least 7 days after completion, then removed by an hourly sweep. After removal the key can execute again. Fresh-only secrets are never included in a replay.
min length 1 · max length 255
Request body
requiredapplication/json
roleWorkspaceRoleBodyrequired
Mirrors `WorkspaceRole`'s spellings rather than deriving serde on the domain type: renaming a domain variant must not silently change the wire.
Allowed:adminmember
user_idstring<uuid>required
Responses
201Added.
created_atstring<date-time>required
display_namestring | nullrequired
primary_emailstring | nullrequired
roleWorkspaceRoleBodyrequired
Mirrors `WorkspaceRole`'s spellings rather than deriving serde on the domain type: renaming a domain variant must not silently change the wire.
Allowed:adminmember
user_idstring<uuid>required
400Malformed body, path parameter, or the user is not a member of the workspace's organization.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403Caller lacks workspace.members.manage.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such workspace, or the caller cannot see it.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
409Idempotency-Key was already used for a different request. The user is already a workspace member.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://api.us.cloud.subako.ai/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/members" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "role": "admin",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}'
Response
{
  "created_at": "2019-08-24T14:15:22Z",
  "display_name": "string",
  "primary_email": "string",
  "role": "admin",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}