This is a development version of the documentation. Content may change without notice.
Voke Documentation
ReferenceREST API

Organizations

Organization management and context

List all organizations

GET
/api/v1/organizations

Query Parameters

page?number

Page number (1-indexed)

Default1
Range1 <= value
limit?number

Items per page

Default20
Range1 <= value <= 100

Response 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

POST
/api/v1/organizations

Request Body

application/json

description?string

Optional description

Lengthlength <= 500
name*string

Organization display name

Length2 <= length <= 100
slug*string

URL-friendly slug (lowercase, hyphens, numbers)

Match/^[a-z0-9]+(?:-[a-z0-9]+)*$/
Length2 <= length <= 50

Response 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

GET
/api/v1/organizations/{id}

Path Parameters

id*string

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

PATCH
/api/v1/organizations/{id}

Path Parameters

id*string

Request Body

application/json

description?string

Optional description

Lengthlength <= 500
name?string

Organization display name

Length2 <= length <= 100
slug?string

URL-friendly slug (lowercase, hyphens, numbers)

Match/^[a-z0-9]+(?:-[a-z0-9]+)*$/
Length2 <= length <= 50

Response 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

DELETE
/api/v1/organizations/{id}

Path Parameters

id*string

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

GET
/api/v1/organizations/{orgId}/members

Path Parameters

orgId*string

Query Parameters

page?number

Page number (1-indexed)

Default1
Range1 <= value
limit?number

Items per page

Default20
Range1 <= value <= 100

Response 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

PATCH
/api/v1/organizations/{orgId}/members/{memberId}

Path Parameters

orgId*string
memberId*string

Request Body

application/json

role*string
Value in"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

DELETE
/api/v1/organizations/{orgId}/members/{memberId}

Path Parameters

orgId*string
memberId*string

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
}