Users & Organizations Endpoints¶
User account and organization management.
Overview¶
Users¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /users/ |
List users |
| POST | /users/ |
Create user |
| GET | /users/me |
Get current user |
| PATCH | /users/me |
Update current user |
| GET | /users/{id} |
Get user by ID |
| PATCH | /users/{id} |
Update user |
| DELETE | /users/{id} |
Delete user |
Organizations¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /organizations/ |
List organizations |
| POST | /organizations/ |
Create organization |
| GET | /organizations/{id} |
Get organization |
API Reference¶
Sartiq Backend Server - Users 0.1.0¶
users¶
GET /api/v1/users/¶
Read Users
Description
Retrieve users.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
limit |
query | integer | 100 | No | |
search |
query | No | |||
skip |
query | integer | 0 | No |
Responses
{
"id": "31ff41de-d325-4e07-a2f9-1965eda49662",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"id": "c87000bc-cc21-41a2-a7e2-b1082e171ec6",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
],
"count": 0
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"data": {
"items": {
"$ref": "#/components/schemas/UserPublic"
},
"type": "array",
"title": "Data"
},
"count": {
"type": "integer",
"title": "Count"
}
},
"type": "object",
"required": [
"data",
"count"
],
"title": "UsersPublic"
}
POST /api/v1/users/¶
Create User
Description
Create new user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
{
"email": "derp@meme.org",
"password": "string",
"full_name": null,
"is_superuser": true,
"role_id": null,
"rework_available": 0,
"is_active": true
}
Schema of the request body
{
"properties": {
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"password": {
"type": "string",
"maxLength": 40,
"minLength": 8,
"title": "Password"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"role_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Role Id"
},
"rework_available": {
"type": "integer",
"title": "Rework Available",
"default": 2
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
}
},
"type": "object",
"required": [
"email",
"password"
],
"title": "UserCreate"
}
Responses
{
"id": "9c0e410c-40c6-4efb-8526-be85c709b640",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/RolePublic"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
GET /api/v1/users/me¶
Read User Me
Description
Get current user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
{
"id": "fe2d2cab-0aad-4763-be5c-95755893ad39",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/RolePublic"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
PATCH /api/v1/users/me¶
Update User Me
Description
Update own user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
Responses
{
"id": "6b450b8e-b2ae-40fa-8bcf-6e6cb6c863f3",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/RolePublic"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
PATCH /api/v1/users/me/password¶
Update Password Me
Description
Update own password.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
{
"properties": {
"current_password": {
"type": "string",
"maxLength": 40,
"minLength": 8,
"title": "Current Password"
},
"new_password": {
"type": "string",
"maxLength": 40,
"minLength": 8,
"title": "New Password"
}
},
"type": "object",
"required": [
"current_password",
"new_password"
],
"title": "UpdatePassword"
}
Responses
POST /api/v1/users/signup¶
Register User
Description
Create new user without the need to be logged in.
Request body
{
"id": "077a49bc-89bc-4c44-a7cd-a0f53d3c21e3",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"password": "string",
"full_name": null
}
Schema of the request body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"maxLength": 255,
"format": "email",
"title": "Email"
},
"password": {
"type": "string",
"maxLength": 40,
"minLength": 8,
"title": "Password"
},
"full_name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Full Name"
}
},
"type": "object",
"required": [
"email",
"password"
],
"title": "UserRegister"
}
Responses
{
"id": "de4c7ffe-08a7-4a20-a76e-2abc1d43d1e8",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/RolePublic"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
GET /api/v1/users/{user_id}¶
Read User By Id
Description
Get a specific user by id.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Responses
{
"id": "841ef50b-fd39-4f94-ab30-d9ad09623f53",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/RolePublic"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
PATCH /api/v1/users/{user_id}¶
Update User
Description
Update a user.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Request body
{
"email": null,
"full_name": null,
"password": null,
"is_superuser": null,
"role_id": null,
"is_active": null,
"rework_available": null
}
Schema of the request body
{
"properties": {
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"password": {
"anyOf": [
{
"type": "string",
"maxLength": 40,
"minLength": 8
},
{
"type": "null"
}
],
"title": "Password"
},
"is_superuser": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Is Superuser"
},
"role_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Role Id"
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Is Active"
},
"rework_available": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Rework Available"
}
},
"type": "object",
"title": "UserUpdate"
}
Responses
{
"id": "5c429b24-ee25-4228-afac-d137241b456c",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0,
"role": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"role": {
"anyOf": [
{
"$ref": "#/components/schemas/RolePublic"
},
{
"type": "null"
}
]
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
organizations¶
POST /api/v1/organizations/¶
Create Organization
Description
Create a new organization.
The current user becomes the owner and is automatically added as a member. Avatar image should be uploaded via /uploads/presigned-url first.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
{
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"title": "Name"
},
"avatar_image": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/MediaInput"
},
{
"type": "null"
}
],
"title": "Avatar Image",
"description": "Avatar image URL (presigned URL from /uploads/presigned-url)"
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 1000
},
{
"type": "null"
}
],
"title": "Description"
},
"rework_available": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Rework Available"
}
},
"type": "object",
"required": [
"name"
],
"title": "OrganizationCreate",
"description": "Schema for creating an organization."
}
Responses
{
"id": "1f7c1fa7-4fc7-40b8-af48-792cd074854f",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"name": "string",
"avatar_image_url": null,
"avatar_image_media": null,
"description": null,
"rework_available": 0,
"owner_id": "936a3959-47c2-4b44-b376-fa7b4eead8b3"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"name": {
"type": "string",
"title": "Name"
},
"avatar_image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar Image Url"
},
"avatar_image_media": {
"anyOf": [
{
"$ref": "#/components/schemas/MediaResourcePublic"
},
{
"type": "null"
}
]
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
}
},
"type": "object",
"required": [
"id",
"created_at",
"updated_at",
"name",
"description",
"rework_available",
"owner_id"
],
"title": "OrganizationPublic",
"description": "Public response schema for an organization."
}
GET /api/v1/organizations/¶
Read Organizations
Description
List organizations the current user is a member of.
Superusers can see all organizations.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
limit |
query | integer | 100 | No | |
search |
query | No | |||
skip |
query | integer | 0 | No |
Responses
{
"id": "e767e6c7-7890-4325-9433-2fcc114e864c",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"id": "52851306-d5c8-4464-b981-ccd1ed95394b",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"name": "string",
"avatar_image_url": null,
"avatar_image_media": null,
"description": null,
"rework_available": 0,
"owner_id": "49ac7e44-7416-4b74-bc53-d4ba5007d775"
}
],
"count": 0
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"data": {
"items": {
"$ref": "#/components/schemas/OrganizationPublic"
},
"type": "array",
"title": "Data"
},
"count": {
"type": "integer",
"title": "Count"
}
},
"type": "object",
"required": [
"data",
"count"
],
"title": "OrganizationsPublic",
"description": "Response schema for a list of organizations."
}
GET /api/v1/organizations/{organization_id}¶
Read Organization
Description
Get an organization by ID.
Only members or superusers can view the organization.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Responses
{
"id": "8292b080-8da4-4c31-a07b-6aa9474fdc21",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"name": "string",
"avatar_image_url": null,
"avatar_image_media": null,
"description": null,
"rework_available": 0,
"owner_id": "fd4235fc-9d4e-466d-b457-516e66ea4566"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"name": {
"type": "string",
"title": "Name"
},
"avatar_image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar Image Url"
},
"avatar_image_media": {
"anyOf": [
{
"$ref": "#/components/schemas/MediaResourcePublic"
},
{
"type": "null"
}
]
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
}
},
"type": "object",
"required": [
"id",
"created_at",
"updated_at",
"name",
"description",
"rework_available",
"owner_id"
],
"title": "OrganizationPublic",
"description": "Public response schema for an organization."
}
PUT /api/v1/organizations/{organization_id}¶
Update Organization
Description
Update an organization.
Only the owner or superusers can update. If avatar_image is provided, it should be a presigned URL from /uploads/presigned-url.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Request body
{
"name": null,
"avatar_image": null,
"description": null,
"rework_available": null,
"owner_id": null
}
Schema of the request body
{
"properties": {
"name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar_image": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/components/schemas/MediaInput"
},
{
"type": "null"
}
],
"title": "Avatar Image",
"description": "Avatar image URL (presigned URL from /uploads/presigned-url)"
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 1000
},
{
"type": "null"
}
],
"title": "Description"
},
"rework_available": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Rework Available"
},
"owner_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Owner Id",
"description": "New owner user ID for ownership transfer"
}
},
"type": "object",
"title": "OrganizationUpdate",
"description": "Schema for updating an organization. All fields are optional."
}
Responses
{
"id": "34532bfb-3445-4517-9fdb-64b5ed84cca2",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"name": "string",
"avatar_image_url": null,
"avatar_image_media": null,
"description": null,
"rework_available": 0,
"owner_id": "fb298798-87cf-4ec1-b675-c100f598642c"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"name": {
"type": "string",
"title": "Name"
},
"avatar_image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar Image Url"
},
"avatar_image_media": {
"anyOf": [
{
"$ref": "#/components/schemas/MediaResourcePublic"
},
{
"type": "null"
}
]
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Description"
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
},
"owner_id": {
"type": "string",
"format": "uuid",
"title": "Owner Id"
}
},
"type": "object",
"required": [
"id",
"created_at",
"updated_at",
"name",
"description",
"rework_available",
"owner_id"
],
"title": "OrganizationPublic",
"description": "Public response schema for an organization."
}
DELETE /api/v1/organizations/{organization_id}¶
Delete Organization
Description
Delete an organization.
Only the owner or superusers can delete. All memberships are automatically removed via cascade.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Responses
GET /api/v1/organizations/{organization_id}/members¶
Read Organization Members
Description
List all members of an organization.
Only members can view the member list.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
limit |
query | integer | 100 | No | |
organization_id |
path | string | No | ||
skip |
query | integer | 0 | No |
Responses
{
"id": "d7cea875-21b0-4af7-9f86-ff88171f483f",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"user_id": "a0940e21-a3a3-479f-9213-e235a53f30ec",
"joined_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null
}
],
"count": 0
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"data": {
"items": {
"$ref": "#/components/schemas/OrganizationMemberPublic"
},
"type": "array",
"title": "Data"
},
"count": {
"type": "integer",
"title": "Count"
}
},
"type": "object",
"required": [
"data",
"count"
],
"title": "OrganizationMembersPublic",
"description": "Response schema for a list of organization members."
}
POST /api/v1/organizations/{organization_id}/members¶
Add Organization Member
Description
Add a member to an organization.
Only the owner or superusers can add members.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Request body
Responses
{
"id": "743d756d-f63c-4754-814c-910bd4a45da9",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"user_id": "11c28b56-a903-4e82-951b-f77917787f88",
"joined_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null
}
],
"count": 0
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"data": {
"items": {
"$ref": "#/components/schemas/OrganizationMemberPublic"
},
"type": "array",
"title": "Data"
},
"count": {
"type": "integer",
"title": "Count"
}
},
"type": "object",
"required": [
"data",
"count"
],
"title": "OrganizationMembersPublic",
"description": "Response schema for a list of organization members."
}
DELETE /api/v1/organizations/{organization_id}/members/{user_id}¶
Remove Organization Member
Description
Remove a member from an organization.
- Owner or superusers can remove any member
- Users can remove themselves from an organization
The owner cannot be removed from the organization.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No | ||
user_id |
path | string | No |
Responses
POST /api/v1/organizations/{organization_id}/migrate-resources¶
Migrate User Resources Endpoint
Description
Migrate user's personal resources to organization.
Migrates resources owned by the specified source user from personal (organization_id = NULL) to the specified organization. All selected resources are migrated atomically (all-or-nothing) in a single transaction.
Requirements: - Only superusers can perform migrations (admin-only operation) - Source user must be a member of the target organization - Only personal resources (organization_id IS NULL) are migrated - Only resources owned by the source user are migrated
Use Cases: - One-time production migration from single-user accounts to multi-user organizations - Admin-initiated resource transfers between user accounts and organizations
Security: - Restricted to superusers only (production data migration tool) - Source user must be organization member (prevents accidental cross-org transfers) - Transaction ensures atomicity (no partial migrations on failure)
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Request body
{
"user_id": "baa07309-c9fb-405d-b818-881fd070e391",
"migrate_products": true,
"migrate_subjects": true,
"migrate_styles": true,
"migrate_generations": true,
"migrate_shootings": true,
"migrate_shot_types": true,
"migrate_stylists": true,
"migrate_background_presets": true,
"migrate_resolution_presets": true,
"migrate_product_type_shot_types": true,
"migrate_external_integrations": true,
"migrate_shooting_guidelines": true,
"migrate_export_configurations": true
}
Schema of the request body
{
"properties": {
"user_id": {
"type": "string",
"format": "uuid",
"title": "User Id",
"description": "Source user whose resources will be migrated"
},
"migrate_products": {
"type": "boolean",
"title": "Migrate Products",
"description": "Migrate personal products",
"default": false
},
"migrate_subjects": {
"type": "boolean",
"title": "Migrate Subjects",
"description": "Migrate personal subjects",
"default": false
},
"migrate_styles": {
"type": "boolean",
"title": "Migrate Styles",
"description": "Migrate personal styles",
"default": false
},
"migrate_generations": {
"type": "boolean",
"title": "Migrate Generations",
"description": "Migrate personal generations",
"default": false
},
"migrate_shootings": {
"type": "boolean",
"title": "Migrate Shootings",
"description": "Migrate personal shootings",
"default": false
},
"migrate_shot_types": {
"type": "boolean",
"title": "Migrate Shot Types",
"description": "Migrate personal shot types",
"default": false
},
"migrate_stylists": {
"type": "boolean",
"title": "Migrate Stylists",
"description": "Migrate personal stylists",
"default": false
},
"migrate_background_presets": {
"type": "boolean",
"title": "Migrate Background Presets",
"description": "Migrate personal background presets",
"default": false
},
"migrate_resolution_presets": {
"type": "boolean",
"title": "Migrate Resolution Presets",
"description": "Migrate personal resolution presets",
"default": false
},
"migrate_product_type_shot_types": {
"type": "boolean",
"title": "Migrate Product Type Shot Types",
"description": "Migrate personal product type shot type mappings",
"default": false
},
"migrate_external_integrations": {
"type": "boolean",
"title": "Migrate External Integrations",
"description": "Migrate personal external integrations",
"default": false
},
"migrate_shooting_guidelines": {
"type": "boolean",
"title": "Migrate Shooting Guidelines",
"description": "Migrate personal shooting guidelines",
"default": false
},
"migrate_export_configurations": {
"type": "boolean",
"title": "Migrate Export Configurations",
"description": "Migrate export configurations (personal → organization)",
"default": false
}
},
"type": "object",
"required": [
"user_id"
],
"title": "ResourceMigrationRequest",
"description": "Request schema for migrating personal resources to organization."
}
Responses
{
"id": "37e813e3-6a59-41a3-93b6-e68cb116bacf",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"message": "string",
"organization_id": "aed99c9e-9483-4e39-ae1d-4d699247a017",
"migrated_counts": {
"products": 0,
"subjects": 0,
"styles": 0,
"generations": 0,
"shootings": 0,
"shot_types": 0,
"stylists": 0,
"background_presets": 0,
"resolution_presets": 0,
"product_type_shot_types": 0,
"external_integrations": 0,
"shooting_guidelines": 0,
"export_configurations": 0
},
"total_migrated": 0
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"message": {
"type": "string",
"title": "Message",
"description": "Success message"
},
"organization_id": {
"type": "string",
"format": "uuid",
"title": "Organization Id",
"description": "Target organization ID"
},
"migrated_counts": {
"$ref": "#/components/schemas/ResourceMigrationCounts",
"description": "Counts of migrated resources per type"
},
"total_migrated": {
"type": "integer",
"title": "Total Migrated",
"description": "Total number of resources migrated across all types"
}
},
"type": "object",
"required": [
"message",
"organization_id",
"migrated_counts",
"total_migrated"
],
"title": "ResourceMigrationResponse",
"description": "Response schema for resource migration."
}
Schemas¶
AddMemberRequest¶
| Name | Type | Description |
|---|---|---|
user_id |
string(uuid) |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
MediaInput¶
| Name | Type | Description |
|---|---|---|
alt_text |
||
caption |
||
color_profile |
||
dominant_color |
||
duration |
||
height |
||
media_resource_id |
||
protected |
boolean | |
url |
||
width |
MediaResourcePublic¶
| Name | Type | Description |
|---|---|---|
alt_text |
||
aspect_ratio |
||
caption |
||
color_profile |
||
content_hash |
string | |
created_at |
string(date-time) | |
dominant_color |
||
duration |
||
extension |
string | |
file_size |
integer | |
height |
||
id |
string(uuid) | |
orientation |
||
protected |
boolean | |
resource_type |
MediaResourceType | |
url |
string | |
width |
MediaResourceType¶
Type: string
Message¶
| Name | Type | Description |
|---|---|---|
message |
string |
OrganizationCreate¶
| Name | Type | Description |
|---|---|---|
avatar_image |
Avatar image URL (presigned URL from /uploads/presigned-url) | |
description |
||
name |
string | |
rework_available |
OrganizationMemberPublic¶
| Name | Type | Description |
|---|---|---|
email |
string(email) | |
full_name |
||
joined_at |
string(date-time) | |
user_id |
string(uuid) |
OrganizationMembersPublic¶
| Name | Type | Description |
|---|---|---|
count |
integer | |
created_at |
string(date-time) | |
data |
Array<OrganizationMemberPublic> | |
id |
string(uuid) | |
updated_at |
string(date-time) |
OrganizationPublic¶
| Name | Type | Description |
|---|---|---|
avatar_image_media |
||
avatar_image_url |
||
created_at |
string(date-time) | |
description |
||
id |
string(uuid) | |
name |
string | |
owner_id |
string(uuid) | |
rework_available |
integer | |
updated_at |
string(date-time) |
OrganizationsPublic¶
| Name | Type | Description |
|---|---|---|
count |
integer | |
created_at |
string(date-time) | |
data |
Array<OrganizationPublic> | |
id |
string(uuid) | |
updated_at |
string(date-time) |
OrganizationUpdate¶
| Name | Type | Description |
|---|---|---|
avatar_image |
Avatar image URL (presigned URL from /uploads/presigned-url) | |
description |
||
name |
||
owner_id |
New owner user ID for ownership transfer | |
rework_available |
ResourceMigrationCounts¶
| Name | Type | Description |
|---|---|---|
background_presets |
integer | |
export_configurations |
integer | |
external_integrations |
integer | |
generations |
integer | |
product_type_shot_types |
integer | |
products |
integer | |
resolution_presets |
integer | |
shooting_guidelines |
integer | |
shootings |
integer | |
shot_types |
integer | |
styles |
integer | |
stylists |
integer | |
subjects |
integer |
ResourceMigrationRequest¶
| Name | Type | Description |
|---|---|---|
migrate_background_presets |
boolean | Migrate personal background presets |
migrate_export_configurations |
boolean | Migrate export configurations (personal → organization) |
migrate_external_integrations |
boolean | Migrate personal external integrations |
migrate_generations |
boolean | Migrate personal generations |
migrate_product_type_shot_types |
boolean | Migrate personal product type shot type mappings |
migrate_products |
boolean | Migrate personal products |
migrate_resolution_presets |
boolean | Migrate personal resolution presets |
migrate_shooting_guidelines |
boolean | Migrate personal shooting guidelines |
migrate_shootings |
boolean | Migrate personal shootings |
migrate_shot_types |
boolean | Migrate personal shot types |
migrate_styles |
boolean | Migrate personal styles |
migrate_stylists |
boolean | Migrate personal stylists |
migrate_subjects |
boolean | Migrate personal subjects |
user_id |
string(uuid) | Source user whose resources will be migrated |
ResourceMigrationResponse¶
| Name | Type | Description |
|---|---|---|
created_at |
string(date-time) | |
id |
string(uuid) | |
message |
string | Success message |
migrated_counts |
ResourceMigrationCounts | Counts of migrated resources per type |
organization_id |
string(uuid) | Target organization ID |
total_migrated |
integer | Total number of resources migrated across all types |
updated_at |
string(date-time) |
RoleName¶
Type: string
RolePublic¶
| Name | Type | Description |
|---|---|---|
description |
||
id |
string(uuid) | |
name |
RoleName |
UpdatePassword¶
| Name | Type | Description |
|---|---|---|
current_password |
string | |
new_password |
string |
UserCreate¶
| Name | Type | Description |
|---|---|---|
email |
string(email) | |
full_name |
||
is_active |
boolean | |
is_superuser |
boolean | |
password |
string | |
rework_available |
integer | |
role_id |
UserPublic¶
| Name | Type | Description |
|---|---|---|
created_at |
string(date-time) | |
email |
string(email) | |
full_name |
||
id |
string(uuid) | |
is_active |
boolean | |
is_superuser |
boolean | |
rework_available |
integer | |
role |
||
updated_at |
string(date-time) |
UserRegister¶
| Name | Type | Description |
|---|---|---|
created_at |
string(date-time) | |
email |
string(email) | |
full_name |
||
id |
string(uuid) | |
password |
string | |
updated_at |
string(date-time) |
UsersPublic¶
| Name | Type | Description |
|---|---|---|
count |
integer | |
created_at |
string(date-time) | |
data |
Array<UserPublic> | |
id |
string(uuid) | |
updated_at |
string(date-time) |
UserUpdate¶
| Name | Type | Description |
|---|---|---|
email |
||
full_name |
||
is_active |
||
is_superuser |
||
password |
||
rework_available |
||
role_id |
UserUpdateMe¶
| Name | Type | Description |
|---|---|---|
email |
||
full_name |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |