API Docs

The Reel in Motion (RIM) API follows the REST architecture and is designed with predictable resource-oriented URLs, form-encoded request bodies, and JSON-encoded responses. Standard HTTP response codes, authentication, and verbs are employed to ensure ease of use and consistency.


Authentication

All API calls, apart from the login and registration, require an authentication token. You can provide this token in the header of your request as follows:


const response = await fetch(args.url, {
    headers: {
        Authorization: Token YOUR_TOKEN,
    },
    method: 'GET',
    body: JSON.stringify({
        ...YOUR_DATA
    })
});

How do I obtain a token?

To obtain a token you first need to either register or login an Account.

You can do this via the API as well.


Account

The account contains all the info associated with the current token used. It houses all relationships between projects, assets, tasks, etc. It is the main object used to interact with the API.

GET/api/account
{
    uuid: string;

    email: string;
    dateJoined: string;

    name: string;
    position: string;
    profileImage: string | null;

    isActive: boolean;
    isVerified: boolean;
    token: string;

    projects: Project['uuid'][];

    assets: Asset['uuid'][];
    tasks: Task['uuid'][];
    comments: Comment['uuid'][];

    lastSeen: string;

    subscribed: {
        assets: Asset['uuid'][];
        tasks: Task['uuid'][];
    };

    uploadedSize: number;

    isSubscribedToEmails: boolean;

    subscription: null | {
        plan: string;
        amount: number;

        isActive: boolean;
        isCancelled: boolean;

        createdOn: number;
        cancelledOn: number | null;
        expiresOn: number;
    };
}

Login

If you already have an account, you can login instead:

POST/api/account/login
{
    {
        email: string,
        password: string
    }
}

Register

To obtain an account, you can register by simply providing the following:

POST/api/account/register
{
    email: string;
    name: string;
    password: string;
    passwordAgain: string;
}

Get Account

You can retrieve all of your account details by making a request to:

GET/api/account

Edit Account

Editing your account details by making a PATCH call to the API endpoint:

PATCH/api/account
{
    uuid: string;
    name?: string;
    position?: string;
    profileImage?: File
}

Logout

Calling the logout endpoints expires the token. After this, the token can no longer be used to authenticate. You will need to login again to get a new token.

POST/api/account/logout

Project

Projects are the main way to organize all your resources. Each project can have its own organization, workflows, and permissions.

GET/api/project/:uuid
{
    uuid: string;
    dateCreated: string;

    creator: Account['uuid'];

    name: string;
    description: string;
    thumbnail: string | null;

    members: Account['uuid'][];

    tags: Tag['uuid'][];
}

Create Project

Once your account is set up, you can begin a new project for your assets and tasks. To create a new project, simply utilize the following API call:

POST/api/project
{
    name: string;
    description: string;
    thumbnail: File;
}

Edit Project

PATCH/api/project
{
    uuid: string;
    name?: string;
    description?: string;
    thumbnail?: File
}

Get Project

You can get the details of a project by its UUID.

GET/api/project/:uuid

List Projects

Alternatively, you can retrieve all the projects you are currently associated with:

GET/api/projects

Delete Project

Warning: This cannot be undone.

Deleting a project will delete the project along with any associate data such as assets, comments, tasks, etc.

DELETE/api/project/:uuid

Invitation

To bring your friends into your project, you need to create an invitation.

An invitation object contains the following:

GET/api/invitation/:uuid
{
    uuid: string;

    project: {
        uuid: Project['uuid'];
        name: string;
        thumbnail: string;
    };

    sender: Account['uuid'];
    email: string;
    receiver: Account['uuid'] | null;

    dateCreated: string;

    dateAccepted: string;
    dateRejected: string;

    isAccepted: boolean;
}

Send Invitation

To send an invitation to a project all you need is the following:

POST/api/invitation
{
    project: Project['uuid'];
    emails: string[];
}

Handle invitation

You can accept or decline an invitation by sending a PATCH request to the following URL:

Once accepted, you can refetch your projects list. You will see the newly accepted project in the received list of projects.

PATCH/api/invitation/:uuid
{
    isAccepted: boolean
}

Alert

Alerts are a way to notify users when certain events occur.

For example, you can create a tag called critical and set up an alert for it.

Whenever a task with the critical tag is created, an alert will be sent out to all users subscribed to that alert.

Moreover, alerts possess the capability to call an external resource by including a URL parameter when creating or modifying an alert. When an alert is triggered, a POST request will be made to the specified URL, with the alert data being sent in the request body.

If you require forwarding additional information with the alert, you can provide it in the "extra" field.

GET/alert/:uuid
{
    uuid: string;

    dateCreated: string;
    dateUpdated: string;

    project: Project['uuid'];
    creator: Account['uuid'];

    name: string;
    description: string;
    behavior: 'ALL' | 'ANY';

    assets: Asset['uuid'][];
    tasks: Task['uuid'][];
    tags: Tag['uuid'][];
    receivers: Account['uuid'][];

    url: string | null;
    extra: string | null;

    sentOn: string | null;
    isRecurring: boolean;
}

Create Alert

POST/api/alert
{
    name: string;
    description?: string;

    assets?: Asset['uuid'][];
    tasks?: Task['uuid'][];
    tags?: Tag['uuid'][];
    receivers?: Account['uuid'][];

    url?: string;
    extra?: string;
}

Edit Alert

PATCH/api/alert/:uuid
{
    uuid: Alert['uuid']

    name?: string;
    description?: string;

    assets?: Asset['uuid'][];
    tasks?: Task['uuid'][];
    tags?: Tag['uuid'][];
    receivers?: Account['uuid'][];

    url?: string;
    extra?: string;
}

Get Alert

GET/api/alert/:uuid

List Alerts

GET/api/alerts

You can also search for alerts by adding the following parameters:

{
    project: Project['uuid'];
    creator?: Account['uuid'];

    name?: string;
    description?: string;

    asset?: Asset['uuid'];
    task?: Task['uuid'];
    tag?: Tag['uuid'];
    receiver?: Account['uuid'];

    group?: Group['uuid'];
    tagValue?: string;
}

For example, here is a url for searching by tag:

/api/alerts?tag=TAG_UUID

Delete Alert

DELETE/api/alert/:uuid

Asset

An asset is a representation of every version of a file or group of files. Files are not associated with assets directly but through commits, where each commit represents a single version of an asset.

GET/api/asset/:uuid
{
    uuid: string;
    dateCreated: string;

    children: Asset['uuid'][];
    parents: Asset['uuid'][];

    project: Project['uuid'];

    creator: Account['uuid'];
    owner: Account['uuid'] | null;

    name: string;
    description: string;
    path: string | null;

    primaryImage: Image['uuid'] | null;

    commits: Commit['uuid'][];
    comments: Comment['uuid'][];
    tasks: Task['uuid'][];
    tags: Tag['uuid'][];
}

Create Asset

To create an asset from a single file provide the following:

POST/api/asset
{
    project: Project['uuid'];

    name: Asset['name'];
    description: Asset['description'];

    file: File;
    path: string | null;

    thumbnails: File[];
}

Alternatively you can create an asset from a list of files:

POST/api/asset
{
    project: Project['uuid'];

    name: Asset['name'];
    description: Asset['description'];

    files: File[];

    thumbnails: File[];
}

Or you can group a list of assets into a new asset:

POST/api/asset
{
    project: Project['uuid'];

    name: Asset['name'];
    description: Asset['description'];

    children: Asset['uuid'][];
}

Edit Asset

To edit asset details such as name and description, you can make a patch call.

Note that if you are looking to provide a new version for an asset, you should make a commit instead:

Create commit
PATCH/api/asset/:uuid
{
    uuid: string;

    children?: Asset['uuid'][];
    parents?: Asset['uuid'][];

    name?: string;
    description?: string;
    path?: string | null;

    primaryImage?: Image['uuid'] | null;
}

Get Asset

Get all fields of an asset:

GET/api/asset/:uuid

List Assets

Alternatively, you can retrieve all the assets for a given project:

GET/api/assets?project=:uuid

You can also search for assets by adding the following parameters:

{
    project: Project['uuid'];
    page?: number;
    perPage?: number;
    creator?: Account['uuid'];
    tagKey?: Tag['key'];
    tagValue?: Tag['value'];
    name?: Asset['name'];
}

For example, here is a url for searching by name:

/api/assets?project=PROJECT_UUID&name=ASSET_NAME

Delete Asset

Warning: This cannot be undone.

Deleting an asset will also delete an associated data such as the commits & comments.

DELETE/api/asset/:uuid

Commit

A commit is a representation of a single version of an asset. Commits are created when an asset is uploaded or when an asset is updated. Commits are not editable, but assets are. Assets can be updated by creating a new commit.

GET/api/commit/:uuid
{
    uuid: string;
    dateCreated: string;

    project: Project['uuid'];
    creator: Account['uuid'];

    asset: Asset['uuid'];
    comments: Comment['uuid'][];

    name: string;
    description: string;
    version: number;

    thumbnails: Image[];

    fileName: string;
    type: string;
    size: number;
    url: string;

    preview?: string;
}

Create Commit

POST/api/commit
{
    asset: Asset['uuid'];

    name: string;
    description: string;

    file: File;
}

Edit Commit

PATCH/api/commit/:uuid
{
    uuid: string;

    name?: string;
    description?: string;
}

Get Commit

GET/api/commit/:uuid

List Commits

GET/api/commits?asset=:uuid

You can also search for assets by adding the following parameters:

{
    project?: Project['uuid'];
    asset?: Asset['uuid'];
    creator?: Account['uuid'];
    name?: Commit['name'];

    page?: number;
    perPage?: number;
}

For example, here is a url for searching by asset and commit name:

/api/commits?asset=ASSET_UUID&name=COMMIT_NAME

Delete Commit

Warning: This cannot be undone.

DELETE/api/commit/:uuid

Comment

A comment can be attachd to either an asset, commit, or a task.

GET/api/comment/:uuid
{
    uuid: string;
    ref: string | null;

    dateCreated: string;
    dateUpdated: string;

    project: Project['uuid'];
    creator: Account['uuid'];

    parent: Comment['uuid'] | null;
    children: Comment['uuid'][];

    asset: Asset['uuid'] | null;
    commit: Commit['uuid'] | null;
    task: Task['uuid'];
    report: Report['uuid'];

    text: string;
    images: Image[];
    video: string | null;

    reviewOf?: Image['uuid'] | null;
    annotations: {
        timestamp: number;

        width: number;
        height: number;

        drawings: Vector2[]
    }
}

Create Comment

POST/api/comment
{
    asset?: Asset['uuid'];
    task?: Task['uuid'];
    commit?: Commit['uuid'];

    parent?: Comment['uuid'];

    image?: File;
    text: string;
}

Edit Comment

PATCH/api/comment/:uuid
{
    uuid: Comment['uuid']

    text: string;
}

Get Comment

GET/api/comment/:uuid

List Comments

GET/api/comments

You can also search for comments by adding the following parameters:

{
        project: Project['uuid'];

        account?: Account['uuid'];
        asset?: Asset['uuid'];
        commit?: Commit['uuid'];
        task?: Task['uuid'];

        text?: string;

        page?: number;
        perPage?: number;
}

For example, here is a url for searching by asset & task:

/api/comments?asset=ASSET_UUID&task=TASK_UUID

Delete Comment

DELETE/api/comment/:uuid

Group

A TagGroup is a vital component in RIM. It facilitates the organization and categorization of assets and tasks, ensuring efficiency. It functions as a collection of unique tags, enabling easy grouping and retrieval.

Each TagGroup is associated with a specific project and can either have a predefined set of options or remain empty to accommodate any tag value.

For instance, if the group is named department and the options are left empty, you can add tags with values like R&D, Marketing, etc. However, if you want to restrict the options to specific values, you can add options such as R&D, Marketing, etc. to the group.

GET/group/:uuid
{
    uuid: string;

    dateCreated: string;
    dateUpdated: string;

    project: Project['uuid'];

    name: string;
    description: string;

    color: string
    options: {
        uuid: string;
        value: string;
        icon?: keyof typeof icons;
        isDefault: boolean;
    }[]
}

Create Group

POST/api/group
{
    name: string;
    description?: string;
    options?: {
        uuid: string;
        value: string;
        icon?: keyof typeof icons;
        isDefault: boolean;
    }[]
}

Edit Group

PATCH/api/group/:uuid
{
    uuid: Group['uuid']

    name?: string;
    description?: string;

    color?: string;
    options?: {
        uuid: string;
        value: string;
        icon?: keyof typeof icons;
        isDefault: boolean;
    }[]
}

Get Group

GET/api/group/:uuid

List Groups

GET/api/groups

You can also search for groups by adding the following parameters:

{
    project: Project['uuid'];
    creator: Account['uuid'];

    name?: string;
    description?: string;
    color?: string;

    asset?: Asset['uuid'];
    task?: Task['uuid'];
}

For example, here is a url for searching by task:

/api/groups?task=TASK_UUID

Delete Group

DELETE/api/group/:uuid

Image

When creating assets, comments, or tasks, you can add images to each of them.

These images may include asset thumbnails, review images, or other visual resources.

By accessing these images directly, it's possible to cross-reference the uploaded media and attach them to other relevant resources.

GET/api/image/:uuid
{
    uuid: string;

    project: Project['uuid'];

    dateCreated: string;
    dateUpdated: string;

    name: string;
    url: string;
    thumbnails: string

    commit?: Commit['uuid'] | null;
    comment?: Comment['uuid'] | null;

    size: {
        width: number
        height: number
    }
}

Create Image

Images are generated automatically when required, instead of being created directly. When you upload an asset that includes a thumbnail, an image instance is automatically created for that thumbnail.


Get Image

GET/api/image/:uuid

List Images

GET/api/images

You can also search for imagesby adding the following parameters:

{
    project?: Project['uuid'];

    asset?: Asset['uuid'];
    commit?: Commit['uuid'];
    comment?: Comment['uuid'];
}

For example, here is a url for searching by asset:

/api/images?asset=ASSET_UUID

Delete Image

DELETE/api/image/:uuid

Task

GET/task/:uuid
{
    uuid: string;
    dateCreated: string;
    dateUpdated: string;
    dateFinished: string | null;

    project: Project['uuid'];
    creator: Account['uuid'];

    name: string;
    description: string;
    color: string;
    status: (
        'backlog' |
        'not started' |
        'in progress' |
        'finished' |
        'awaiting approval' |
        'cancelled'
    );

    checklist: {
        description: string;
        isDone: boolean
    }[];

    startDate: string;
    duration: number;

    bid: number;

    assigned: Account['uuid'] | null;

    nextTask: Task['uuid'] | null;

    assets: Asset['uuid'][];
    tags: Tag['uuid'][];
    comments: Comment['uuid'][];

    primaryImage: string | null;

    history: TaskHistory;
}

Create Task

POST/api/task
{
    project: Project['uuid'];

    name: string;
    description: string;

    // ISO date string:
    startDate?: string;

    // ISO date string:
    duration?: string;

    assigned?: Account['uuid'];
    previousTasks?: Task['uuid'][];

    assets?: Asset['uuid'][];
    tags?: Tag['uuid'][];
}

Edit Task

PATCH/api/task/:uuid
{
    uuid: Task['uuid']

    name?: string;
    description?: string;

    // ISO date string:
    startDate?: string;

    // ISO date string:
    duration?: string;

    assigned?: Account['uuid'];
    previousTasks?: Task['uuid'][];

    assets?: Asset['uuid'][];
    tags?: Tag['uuid'][];
}

Get Task

GET/api/task/:uuid

List Tasks

GET/api/tasks

You can also search for tasks by adding the following parameters:

{
    project?: Project['uuid'];

    asset?: Asset['uuid'];
    creator?: Account['uuid'];

    tagKey?: Tag['key'];
    tagValue?: Tag['value'];

    name?: Task['name'];

    page?: number;
    perPage?: number;
}

For example, here is a url for searching by asset:

/api/tasks?asset=ASSET_UUID

Delete Task

DELETE/api/task/:uuid

Tag

Tags help you organize the assets and elements of your project.

Each `Tag` is distinct and can contain specific information such as a text value, color, or additional settings.

Tags can be created, modified, and associated with various items, simplifying the process of filtering, searching, and organizing data within the system.

Additionally, tags can include descriptions to provide better understanding and context.

Tags consist of a group and a value. For instance, you can add a tag with the group "department" and the value "R&D".

GET/tag/:uuid
{
    uuid: string;
    ref: string | null;

    dateCreated: string;
    dateUpdated: string;

    project: Project['uuid'];
    group: Group['uuid'];

    alerts: Alert['uuid'][];

    // Edit this array to attach a tag the assets:
    assets: Asset['uuid'][];

    // Edit this array to attach a tag the tasks:
    tasks: Task['uuid'][];

    value: string;
    description: string;
    color: string

    options: {
        color: string;
        icon: string;
    };
}

Create Tag

POST/api/tag
{
    asset: Asset['uuid'];

    name: string;
    description: string;

    file: File;
}

Edit Tag

PATCH/api/tag/:uuid
{
    uuid: Tag['uuid']

    text: string;
}

Get Tag

GET/api/tag/:uuid

List Tags

GET/api/tags

You can also search for tags by adding the following parameters:

{
    project: Project['uuid'];

    group?: Group['uuid'];
    value?: string;

    alert?: Alert['uuid'];
    asset?: Asset['uuid'];
    task?: Task['uuid'];
}

For example, here is a url for searching by asset:

/api/tags?asset=ASSET_UUID

Delete Tag

DELETE/api/tag/:uuid

Template

GET/task/:uuid
{
    uuid: string;
    ref: string;

    project: Project['uuid'];
    creator: Account['uuid'];
    isPublic: boolean;

    dateCreated: string;
    dateUpdated: string;

    name: string;
    description: string;

    tasks: {
        name: string
        description: string
        color: string
        duration: number
        checklist: Task.Checklist
        offset: number;
        tags: {
            [tagKey: string]: string;
        };
    }[];
}

Create Template

POST/api/template
{
    name: string;
    description?: string;
    tasks: {
        name: string
        description: string
        color: string
        duration: number
        offset: number;
        tags: {
            [tagKey: string]: string;
        };
    }[];
}

Edit Template

PATCH/api/template/:uuid
{
    name?: string;
    description?: string;
    tasks: {
        name: string
        description: string
        color: string
        duration: number
        offset: number;
        tags: {
            [tagKey: string]: string;
        };
    }[];
}

Get Template

GET/api/template/:uuid

List Templates

GET/api/templates

Delete Template

DELETE/api/template/:uuid