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": "8efc5b79-3b3d-4c8d-b486-446b41da4b0b",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"id": "a02d1085-b4ec-4f56-8252-5c26c4762857",
"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,
"deleted_at": 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": "59f0ef9f-d53a-43ba-ac4b-d395395fe407",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "7973399b-3613-4242-987a-7f90a7432674",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "4891f003-2148-4845-b53b-07b2b4dde2b1",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "2ae624c6-b1aa-4ce1-91c1-dc87eef5f16e",
"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": "e7ac5cf4-7f40-4076-98f3-c9ce5732b58c",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "cd60fb79-b523-4c32-89da-70ec145162cb",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "302d08dd-1bfa-4297-9827-9310c2373a71",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
DELETE /api/v1/users/{user_id}¶
Delete User
Description
Soft-delete a user (admin only).
A superuser cannot delete their own account or the bootstrap superuser.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Responses
POST /api/v1/users/{user_id}/restore¶
Restore User
Description
Restore a soft-deleted user (admin only).
The email scrubbed on delete is not recovered; reassign it afterwards via the update endpoint.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
user_id |
path | string | No |
Responses
{
"id": "4324db75-2c20-40bb-8ba7-7a6a1af67948",
"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,
"deleted_at": 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"
}
]
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "aab68db7-41cf-464b-9452-eb428b54a05c",
"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": "7d67730e-6985-450a-892c-d5de1939d25c",
"deleted_at": 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"
},
"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"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "923e3ae8-eb4f-4ec0-8e98-68370b78b354",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"id": "67a596f0-48d6-4a83-b3d7-e49ae7681de3",
"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": "9ca13e3e-0c62-4d1b-be9c-21a6d12faf05",
"deleted_at": 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/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": "117f820e-3f1e-46e3-bc24-7526b9f248af",
"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": "e44eac27-2250-42a7-b044-e43b35d766ff",
"deleted_at": 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"
},
"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"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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": "ff3d3484-8481-44ad-8373-1323e990ee15",
"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": "6d3ae180-cdde-46be-b0e6-c145ceaa2be8",
"deleted_at": 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"
},
"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"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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
Soft-delete an organization. Only the owner or superusers can delete.
Memberships and org-scoped resources are intentionally retained (soft-delete hides the org; it does not cascade). The avatar media is detached later by the soft-delete cleanup job, not here.
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}/name¶
Read Organization Name
Description
Get an organization's display name.
Members and superusers can read it, and so can the machine AGENT role WITHOUT being a member: the agent host keys every per-organization directory by UUID and has no other way to label them for its operators. That is the whole reason this endpoint is split out of read_organization — the disclosure is the name and nothing else.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Responses
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
}
},
"type": "object",
"required": [
"id",
"name"
],
"title": "OrganizationNamePublic",
"description": "Id + display name only — the minimum needed to label an organization.\n\nSeparate from OrganizationPublic because the AGENT role may read this one:\nthe agent host stores per-org data under the organization UUID and needs a\nhuman label for its operator UI. Everything else on an organization (owner,\nrework balance, avatar, timestamps) stays behind the member-only endpoint.\n\nSQLModel, not app.models.base.BaseModel: the latter carries created_at and\nupdated_at, which would silently widen this response past its two fields."
}
POST /api/v1/organizations/{organization_id}/restore¶
Restore Organization
Description
Restore a soft-deleted organization. Only the owner or superusers can restore.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
path | string | No |
Responses
{
"id": "b14bc4db-8094-4805-a14a-ba47b3af75af",
"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": "ed73e611-2e0e-4ec3-bacb-12652040935b",
"deleted_at": 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"
},
"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"
},
"deleted_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Deleted At"
}
},
"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/{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": "eed8362e-0353-4f11-a937-ac84662b54ac",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"user_id": "c52df91b-0d65-4399-88fc-5de1c0db91bd",
"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": "bb8b46e1-ead1-4cc2-89dd-c328582f240d",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"data": [
{
"user_id": "48007a7b-66d5-40f1-bc2c-527932ac7db6",
"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": "6d66ae79-b87c-4b8b-b66d-a84d02a9f404",
"migrate_products": true,
"migrate_subjects": 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
}
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_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
}
},
"type": "object",
"required": [
"user_id"
],
"title": "ResourceMigrationRequest",
"description": "Request schema for migrating personal resources to organization."
}
Responses
{
"id": "42599326-f47e-44bd-9542-8d5e15a7cca2",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"message": "string",
"organization_id": "66760c1a-3fcf-4016-8a52-0cc408f983a3",
"migrated_counts": {
"products": 0,
"subjects": 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
},
"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) |
OrganizationNamePublic¶
| Name | Type | Description |
|---|---|---|
id |
string(uuid) | |
name |
string |
OrganizationPublic¶
| Name | Type | Description |
|---|---|---|
avatar_image_media |
||
avatar_image_url |
||
created_at |
string(date-time) | |
deleted_at |
||
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 | |
external_integrations |
integer | |
generations |
integer | |
product_type_shot_types |
integer | |
products |
integer | |
resolution_presets |
integer | |
shooting_guidelines |
integer | |
shootings |
integer | |
shot_types |
integer | |
stylists |
integer | |
subjects |
integer |
ResourceMigrationRequest¶
| Name | Type | Description |
|---|---|---|
migrate_background_presets |
boolean | Migrate personal background presets |
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_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) | |
deleted_at |
||
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 |