Organizations
Organization management and context
List all organizations
Query Parameters
Page number (1-indexed)
11 <= valueItems per page
201 <= value <= 100Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/organizations"{
"data": [
{
"createdAt": "2019-08-24T14:15:22Z",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"meta": {
"limit": 0,
"page": 0,
"total": 0,
"totalPages": 0
}
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Validation error",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "SUPER_ADMIN_REQUIRED",
"details": {},
"error": "Forbidden",
"message": "SuperAdmin access required",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Create a new organization
Request Body
application/json
Optional description
length <= 500Organization display name
2 <= length <= 100URL-friendly slug (lowercase, hyphens, numbers)
/^[a-z0-9]+(?:-[a-z0-9]+)*$/2 <= length <= 50Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/api/v1/organizations" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "slug": "string" }'{
"createdAt": "2019-08-24T14:15:22Z",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Validation error",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "SUPER_ADMIN_REQUIRED",
"details": {},
"error": "Forbidden",
"message": "SuperAdmin access required",
"statusCode": 400
}{
"code": "CONFLICT",
"details": {},
"error": "Conflict",
"message": "Organization already exists",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Get organization by ID
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/organizations/string"{
"createdAt": "2019-08-24T14:15:22Z",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid organization UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "SUPER_ADMIN_REQUIRED",
"details": {},
"error": "Forbidden",
"message": "SuperAdmin access required",
"statusCode": 400
}{
"code": "ORGANIZATION_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Organization not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Update an organization
Path Parameters
Request Body
application/json
Optional description
length <= 500Organization display name
2 <= length <= 100URL-friendly slug (lowercase, hyphens, numbers)
/^[a-z0-9]+(?:-[a-z0-9]+)*$/2 <= length <= 50Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://loading/api/v1/organizations/string" \ -H "Content-Type: application/json" \ -d '{}'{
"createdAt": "2019-08-24T14:15:22Z",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"slug": "string",
"updatedAt": "2019-08-24T14:15:22Z"
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Validation error",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "SUPER_ADMIN_REQUIRED",
"details": {},
"error": "Forbidden",
"message": "SuperAdmin access required",
"statusCode": 400
}{
"code": "ORGANIZATION_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Organization not found",
"statusCode": 400
}{
"code": "CONFLICT",
"details": {},
"error": "Conflict",
"message": "Organization already exists",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Delete an organization
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://loading/api/v1/organizations/string"{
"message": "string"
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid organization UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "SUPER_ADMIN_REQUIRED",
"details": {},
"error": "Forbidden",
"message": "SuperAdmin access required",
"statusCode": 400
}{
"code": "ORGANIZATION_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Organization not found",
"statusCode": 400
}{
"code": "CONFLICT",
"details": {},
"error": "Conflict",
"message": "Organization cannot be deleted while related records exist",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}List organization members
Path Parameters
Query Parameters
Page number (1-indexed)
11 <= valueItems per page
201 <= value <= 100Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/organizations/string/members"{
"data": [
{
"createdAt": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
"role": "ORG_ADMIN",
"updatedAt": "2019-08-24T14:15:22Z",
"user": {
"createdAt": "2019-08-24T14:15:22Z",
"email": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"role": "ADMIN",
"updatedAt": "2019-08-24T14:15:22Z"
},
"userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b"
}
],
"meta": {
"limit": 0,
"page": 0,
"total": 0,
"totalPages": 0
}
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid organization UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Update member role
Path Parameters
Request Body
application/json
"ORG_ADMIN" | "OPERATOR" | "VIEWER"Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://loading/api/v1/organizations/string/members/string" \ -H "Content-Type: application/json" \ -d '{ "role": "ORG_ADMIN" }'{
"createdAt": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
"role": "ORG_ADMIN",
"updatedAt": "2019-08-24T14:15:22Z",
"user": {
"createdAt": "2019-08-24T14:15:22Z",
"email": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"role": "ADMIN",
"updatedAt": "2019-08-24T14:15:22Z"
},
"userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b"
}{
"code": "BAD_REQUEST",
"details": {},
"error": "Bad Request",
"message": "Validation error or invalid UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "MEMBER_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Member not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Remove member from organization
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://loading/api/v1/organizations/string/members/string"{
"message": "string"
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden",
"statusCode": 400
}{
"code": "MEMBER_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Member not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}