GET /api/v2/projects/:project_id/comments
All comments

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects/Wfaim_ejkpdiRkQb0Lbe/comments
200
{
  "comments": [
    {
      "id": 1,
      "message": "Sample comment for tests",
      "updated_at": "2023-09-22T05:57:20.557Z",
      "user": {
        "id": 83,
        "email": "admin-user-70@example.com",
        "first_name": null,
        "last_name": null,
        "avatar_url": null
      },
      "mentioned_users": []
    }
  ]
}
// If :project_id is not found
GET /api/v2/projects/not-found-id/comments
404
{
  "error": "project not found"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/comments
Create comment

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
comment
required

Comment content

Validations:

  • Must be a String

Examples

// Successful request
POST /api/v2/projects/NXf3YeFdCDcd5gh2VKdk/comments
{
  "comment": "new comment"
}
200
{
  "comment": {
    "id": 2,
    "message": "new comment",
    "updated_at": "2023-09-22T05:57:21.102Z",
    "user": {
      "id": 85,
      "email": "admin-user-72@example.com",
      "first_name": null,
      "last_name": null,
      "avatar_url": null
    },
    "mentioned_users": []
  }
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/comments
{
  "comment": "new comment"
}
404
{
  "error": "project not found"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/comments/:comment_id
Update comment

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
comment
required

Comment content

Validations:

  • Must be a String

Examples

// Successful request
POST /api/v2/projects/aaPEqnZspdsIglLjBdQH/comments/3
{
  "comment": "new updated comment"
}
200
{
  "comment": {
    "message": "new updated comment",
    "id": 3,
    "updated_at": "2023-09-22T05:57:21.702Z",
    "user": {
      "id": 87,
      "email": "admin-user-74@example.com",
      "first_name": null,
      "last_name": null,
      "avatar_url": null
    },
    "mentioned_users": []
  }
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/comments/4
{
  "comment": "new updated comment"
}
404
{
  "error": "project not found"
}
// If :comment_id is not found
POST /api/v2/projects/0aM7rK90Bto043oMmJ7B/comments/not-found-id
{
  "comment": "new updated comment"
}
404
{
  "error": "Couldn't find Comment with 'id'=not-found-id [WHERE \"comments\".\"target_id\" = $1 AND \"comments\".\"target_type\" = $2]"
}
// If current user is not a owner of the comment
POST /api/v2/projects/J8eVjDwkRQcX4s0xMh2X/comments/5
{
  "comment": "new updated comment"
}
403
{
  "error": "Not allowed to perform this action"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

DELETE /api/v2/projects/:project_id/comments/:comment_id
Delete comment

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
DELETE /api/v2/projects/LVRkCDLcrHOpe30_cqdZ/comments/6
200
{
  "ok": "comment deleted"
}
// If :project_id is not found
DELETE /api/v2/projects/not-found-id/comments/7
404
{
  "error": "project not found"
}
// If :comment_id is not found
DELETE /api/v2/projects/_yPGoD6m99vhC161Lna3/comments/not-found-id
404
{
  "error": "Couldn't find Comment with 'id'=not-found-id [WHERE \"comments\".\"target_id\" = $1 AND \"comments\".\"target_type\" = $2]"
}
// If current user is not a owner of the comment
DELETE /api/v2/projects/u1pmmrcFCS3e7F-ZBLEs/comments/8
403
{
  "error": "Not allowed to perform this action"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/comments/:comment_id
Get comment by ID

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects/BhDl3zOj3NAoYYQTCtEe/comments/9
200
{
  "comment": {
    "id": 9,
    "message": "Sample comment for tests",
    "updated_at": "2023-09-22T05:57:23.956Z",
    "user": {
      "id": 97,
      "email": "admin-user-84@example.com",
      "first_name": null,
      "last_name": null,
      "avatar_url": null
    },
    "mentioned_users": []
  }
}
// If :project_id is not found
GET /api/v2/projects/not-found-id/comments/10
404
{
  "error": "project not found"
}
// If :comment_id is not found
GET /api/v2/projects/08bDOMx7adcFAOs12EKF/comments/not-found-id
404
{
  "error": "Couldn't find Comment with 'id'=not-found-id [WHERE \"comments\".\"target_id\" = $1 AND \"comments\".\"target_type\" = $2]"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/public
Set as public

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
POST /api/v2/projects/vFy6_w1tQhy1DIraz16y/public
200
{
  "is_public": true
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/public
404
{
  "error": "project not found"
}
// Is public already
POST /api/v2/projects/Gk0xOyeL90McTp6hHGC6/public
400
{
  "error": "Project is public already"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/private
Set as private

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
POST /api/v2/projects/XyVo5BZ0G5cG24dWvR3R/private
200
{
  "is_public": false
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/private
404
{
  "error": "project not found"
}
// Is private already
POST /api/v2/projects/7MP17vyufwI7aR8Sw_s9/private
400
{
  "error": "Project is private already"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/all_users
List all users who are allowed to see this entity

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects/z8pvYigCuZckkRaeBt9j/all_users
200
{
  "users": [
    {
      "id": 106,
      "first_name": null,
      "last_name": null,
      "email": "admin-user-93@example.com",
      "user_role": {
        "name": "admin"
      }
    }
  ]
}
// If :project_id is not found
GET /api/v2/projects/not-found-id/all_users
404
{
  "error": "project not found"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/users
List users

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects/GeKH7zKJ52IrUTZpdNUI/users
200
{
  "users": [
    {
      "id": 108,
      "first_name": null,
      "last_name": null,
      "email": "admin-user-95@example.com",
      "user_role": {
        "name": "admin"
      }
    }
  ]
}
// If :project_id is not found
GET /api/v2/projects/not-found-id/users
404
{
  "error": "project not found"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/users/:user_id
Add user

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
POST /api/v2/projects/a_A19M3NwJP9TA_5Zz92/users/111
200
{
  "ok": "User 111 was added succesfully"
}
// User is already added
POST /api/v2/projects/vjz4wFjUwYSqgxVSxXwg/users/113
400
{
  "error": "User is already member of this Project"
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/users/114
404
{
  "error": "project not found"
}
// If :user_id is not found
POST /api/v2/projects/bFkR_E048TzfdOWl2vxO/users/not-found-id
404
{
  "error": "Couldn't find User with 'id'=not-found-id"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

DELETE /api/v2/projects/:project_id/users/:user_id
Remove user

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
DELETE /api/v2/projects/PMyuYqmWL3LFZgMBOiOy/users/118
200
{
  "ok": "User 118 was removed succesfully"
}
// User does not belong to entity
DELETE /api/v2/projects/CxSIuWhRcaEC7VxCPTgy/users/120
400
{
  "error": "User is not a member of this Project"
}
// If :project_id is not found
DELETE /api/v2/projects/not-found-id/users/121
404
{
  "error": "project not found"
}
// If :user_id is not found
DELETE /api/v2/projects/wnezLIfcBEjifrDdCH5m/users/not-found-id
404
{
  "error": "Couldn't find User with 'id'=not-found-id"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/guests
Invite guest by email

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
email
required

Email

Validations:

  • Must be a String

Examples

// Successful request
POST /api/v2/projects/4G0o1TkB5PyNXlolYJzw/guests
{
  "email": "example-email@example.com"
}
200
{
  "users": [
    {
      "id": 124,
      "first_name": null,
      "last_name": null,
      "email": "admin-user-111@example.com",
      "user_role": {
        "name": "admin"
      }
    },
    {
      "id": 125,
      "first_name": null,
      "last_name": null,
      "email": "example-email@example.com",
      "user_role": {
        "name": "guest"
      }
    }
  ]
}
// Successful request
POST /api/v2/projects/eSy4_08RXHWWGQ_xSNse/guests
{
  "email": "admin-user-112@example.com"
}
400
{
  "error": "User already exists"
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/guests
{
  "email": "example-email@example.com"
}
404
{
  "error": "project not found"
}
// Failed request
POST /api/v2/projects/not-found-id/guests
404
{
  "error": "project not found"
}
// Successful request
POST /api/v2/projects/9FOS615rjRhOGHdY36-G/guests
{
  "email": "testiemail@tvtools.fi"
}
200
{
  "users": [
    {
      "id": 162,
      "first_name": null,
      "last_name": null,
      "email": "admin-user-148@example.com",
      "user_role": {
        "name": "admin"
      }
    },
    {
      "id": 163,
      "first_name": null,
      "last_name": null,
      "email": "testiemail@tvtools.fi",
      "user_role": {
        "name": "guest"
      }
    }
  ]
}
// User with given email does not already exist
POST /api/v2/projects/_4AUsrmvOWEKxNPgVSOb/guests
{
  "email": "testiemail@tvtools.fi"
}
200
{
  "users": [
    {
      "id": 164,
      "first_name": null,
      "last_name": null,
      "email": "admin-user-149@example.com",
      "user_role": {
        "name": "admin"
      }
    },
    {
      "id": 165,
      "first_name": null,
      "last_name": null,
      "email": "testiemail@tvtools.fi",
      "user_role": {
        "name": "guest"
      }
    }
  ]
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/user_groups
Get user groups

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects/xtiZWQSEDMoaMLyJfD0g/user_groups
200
{
  "user_groups": [
    {
      "id": 1,
      "name": "user-group-1",
      "description": "Sample user group for tests",
      "created_at": "2023-09-22T05:57:31.398Z",
      "updated_at": "2023-09-22T05:57:31.398Z",
      "users": []
    }
  ]
}
// If :project_id is not found
GET /api/v2/projects/not-found-id/user_groups
404
{
  "error": "project not found"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/user_groups/:user_group_id
Add user group

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
POST /api/v2/projects/HnDs4PGnwCQLP8rQ6K71/user_groups/2
200
{
  "ok": "User group 2 was added succesfully"
}
// User group is already added
POST /api/v2/projects/LG1rlXN4NWomt8dM805u/user_groups/3
400
{
  "error": "User group with id 3 is already part of this Project"
}
// If :project_id is not found
POST /api/v2/projects/not-found-id/user_groups/4
404
{
  "error": "project not found"
}
// If :user_group_id is not found
POST /api/v2/projects/U1uzJzZaljG5BQ8ldWHh/user_groups/not-found-id
404
{
  "error": "Couldn't find UserGroup with 'id'=not-found-id"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

DELETE /api/v2/projects/:project_id/user_groups/:user_group_id
Remove user group

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
DELETE /api/v2/projects/a2I1AV5DojLaQ96f-T8q/user_groups/5
200
{
  "ok": "User group 5 was removed succesfully"
}
// User does not belong to entity
DELETE /api/v2/projects/w8jNQrRHg8byXmJHxuLh/user_groups/6
400
{
  "error": "User group with id 6 is not part of this Project"
}
// If :project_id is not found
DELETE /api/v2/projects/not-found-id/user_groups/7
404
{
  "error": "project not found"
}
// If :user_group_id is not found
DELETE /api/v2/projects/srFfZY1fi9dXS3u1BJqh/user_groups/not-found-id
404
{
  "error": "Couldn't find UserGroup with 'id'=not-found-id"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/history/:cursor
Get history

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects/l9edLJkmEKvKMin51xZY/history/0
200
{
  "history": {
    "results": [
      {
        "id": 139,
        "user_id": 0,
        "event_type": "USER_LINKED",
        "created_at": "2023-09-22T05:57:34.136Z",
        "updated_at": "2023-09-22T05:57:34.136Z",
        "event_targets": [
          {
            "target_type": "User",
            "target": {
              "id": 138,
              "first_name": null,
              "last_name": null
            }
          },
          {
            "target_type": "Project",
            "target": {
              "id": 52,
              "elasticsearch_id": "l9edLJkmEKvKMin51xZY",
              "title": "Sample Project"
            }
          }
        ]
      },
      {
        "id": 138,
        "user_id": 138,
        "event_type": "PROJECT_ADDED",
        "created_at": "2023-09-22T05:57:34.112Z",
        "updated_at": "2023-09-22T05:57:34.112Z",
        "event_targets": [
          {
            "target_type": "Project",
            "target": {
              "id": 52,
              "elasticsearch_id": "l9edLJkmEKvKMin51xZY",
              "title": "Sample Project"
            }
          }
        ]
      }
    ],
    "next_cursor": null
  }
}
// If :project_id is not found
GET /api/v2/projects/-1/history/0
404
{
  "error": "project not found"
}
// Unprocessable entity
GET /api/v2/projects/_hTqOEkbQF_UHrHPNNIr/history/test
422
{
  "error": "Invalid parameter 'cursor' value \"test\": Invalid cursor"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects
List top level project IDs for current user

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Successful request
GET /api/v2/projects
200
{
  "projects": []
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id
Get project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Examples

// Project is not found
GET /api/v2/projects/not-found-id
404
{
  "error": "project not found"
}
// Successful request
GET /api/v2/projects/6NXFuqJU0-9ikeoBl26n
200
{
  "project": {
    "id": "6NXFuqJU0-9ikeoBl26n",
    "external_id": null,
    "project_id": null,
    "owner": "admin-user-129@example.com",
    "title": "Sample Project",
    "description": "Sample project description.",
    "category": "test project category",
    "tags": [
      "test",
      "tag"
    ],
    "media_type": "project",
    "isPublic": false,
    "thumbnail_asset_id": null,
    "created_date": "2023-09-22T05:57:35.057Z",
    "modification_date": "2023-09-22T05:57:35.057Z",
    "deleted": null,
    "original_title": "Sample Project"
  }
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/projects
Get child projects

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Project not found
GET /api/v2/projects/not-found-id/projects
404
{
  "error": "project not found"
}
// Successful request
GET /api/v2/projects/QsVclwpQxDNQ7nlzYDlf/projects
200
{
  "projects": []
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/assets
Get assets and subproject for a project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Examples

// Project not found
GET /api/v2/projects/not-found-id/assets
404
{
  "error": "project not found"
}
// Succesful request
GET /api/v2/projects/8BNNxVGFCMyxVpUQwbC2/assets
200
{
  "assets": [],
  "subprojects": [],
  "stats": {
    "assets": 0,
    "projects": 0,
    "total_size": 0,
    "media_types": {
      "placeholder": 0,
      "video": 0,
      "image": 0,
      "audio": 0,
      "article": 0,
      "document": 0,
      "other": 0,
      "processing": 0,
      "project": 0
    }
  }
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

GET /api/v2/projects/:project_id/stats
Get project stats

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Examples

// Project not found
GET /api/v2/projects/not-found-id/stats
404
{
  "error": "project not found"
}
// Succesful request
GET /api/v2/projects/KaK2oDqQnWzNJVRKTfk4/stats
200
{
  "stats": {
    "assets": 0,
    "projects": 0,
    "total_size": 0,
    "media_types": {
      "placeholder": 0,
      "video": 0,
      "image": 0,
      "audio": 0,
      "article": 0,
      "document": 0,
      "other": 0,
      "processing": 0,
      "project": 0
    }
  }
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects
Create project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
title
required

Title

Validations:

  • Must be a String

description
optional

Description

Validations:

  • Must be a String

category
optional

Category

Validations:

  • Must be a String

tags
optional

Tags

Validations:

  • Must be an array of String

external_id
optional

External ID

Validations:

  • Must be a String

Examples

// Successful request
POST /api/v2/projects
{
  "title": "Sample Project",
  "description": "Sample project from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ]
}
200
{
  "project": {
    "id": "KKrkUITzDVG9jj5B5ep4",
    "external_id": null,
    "project_id": null,
    "owner": "admin-user-136@example.com",
    "title": "Sample Project",
    "description": "Sample project from API V2",
    "category": "sample",
    "tags": [
      "sample",
      "test"
    ],
    "media_type": "project",
    "isPublic": false,
    "thumbnail_asset_id": null,
    "created_date": "2023-09-22T05:57:36.556Z",
    "modification_date": "2023-09-22T05:57:36.556Z",
    "deleted": null,
    "original_title": "Sample Project"
  }
}
// Missing required parameters
POST /api/v2/projects
{
  "description": "Sample project from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ]
}
422
{
  "error": "Missing parameter title"
}
// With invalid parameters
POST /api/v2/projects
{
  "title": "Testing too long title: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
400
{
  "error": "Title is too long (maximum is 255 characters)"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

PUT /api/v2/projects/:project_id
Update project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
title
optional

Title

Validations:

  • Must be a String

description
optional

Description

Validations:

  • Must be a String

category
optional

Category

Validations:

  • Must be a String

tags
optional

Tags

Validations:

  • Must be an array of String

external_id
optional

External ID

Validations:

  • Must be a String

Examples

// Drop folder not found
PUT /api/v2/projects/not-found-id
{
  "title": "Modified Sample Drop Folder",
  "description": "Modified Description"
}
404
{
  "error": "project not found"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/trash_bin
Move project and all related projects and assets to trash bin from where it will be deleted after 14 days

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Project not found
POST /api/v2/projects/not-found-id/trash_bin
404
{
  "error": "project not found"
}
// Successful request
POST /api/v2/projects/zJqWAbM9JUI01i0G25Y3/trash_bin
200
{
  "ok": "ok"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/restore
Restores project and all related projects and assets from trash bin

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Examples

// Failed request
POST /api/v2/projects/not-found-id/restore
404
{
  "error": "project not found"
}
// Trying to restore project that is not in trash bin
POST /api/v2/projects/4kiJD6kAroPWNSFdOuh0/restore
400
{
  "error": "Can not restore projects that is not in trash bin"
}
// Successful request
POST /api/v2/projects/KAcxKzAGy3Fw_RSORMfn/restore
200
{
  "ok": "ok"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

DELETE /api/v2/projects/:project_id
Permanently delete project and all related projects and assets

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Examples

// Failed request
DELETE /api/v2/projects/not-found-id
404
{
  "error": "project not found"
}
// Successful request
DELETE /api/v2/projects/BfT22B5pru09d19_fzVj
200
{
  "ok": "ok"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/assign
Assign subproject to project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
to_project_id
required

Project ID

Validations:

  • Must be a String

Examples

// Failed request
POST /api/v2/projects/not-found-id/assign
404
{
  "error": "project not found"
}
// Succesful request
POST /api/v2/projects/RjoxKpVepQDHwy-RwmKs/assign
{
  "to_project_id": "4e6ZZMfzRl3RX95xCTxG"
}
200
{
  "ok": "ok"
}
// Project with to_project_id id does not exist
POST /api/v2/projects/O0TNxWPEV3XAFOlriy8g/assign
{
  "to_project_id": "not-found-id"
}
200
{
  "error": "Project not found."
}
// Trying to assign project to self
POST /api/v2/projects/TIUggDWlO7vHAc167aSA/assign
{
  "to_project_id": "TIUggDWlO7vHAc167aSA"
}
400
{
  "error": "A project cannot be its own parent project."
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

DELETE /api/v2/projects/:project_id/unassign
Unassign subproject from project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Examples

// Failed request
DELETE /api/v2/projects/not-found-id/unassign
404
{
  "error": "project not found"
}
// Successful request
DELETE /api/v2/projects/PzfpvX0BNBUyJOSNm2uA/unassign
200
{
  "ok": "ok"
}
// Trying to unassign project which has no parent project
DELETE /api/v2/projects/FHEEYQvtTME7xlOg9nQw/unassign
200
{
  "error": "FHEEYQvtTME7xlOg9nQw does not have a parent project"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

PUT /api/v2/projects/:project_id/thumbnail
Set project thumbnail

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID of project to add thumbnail to

Validations:

  • Must be a String

thumbnail_asset_id
required

ID of asset which should be set as thumbnail image

Validations:

  • Must be a String

Examples

// Invalid project_id
PUT /api/v2/projects/not-found-id/thumbnail
{
  "thumbnail_asset_id": "liFQwp9o0EOiZ7l3Hb-0"
}
404
{
  "error": "project not found"
}
// Asset with thumbnail_asset_id is not found
PUT /api/v2/projects/cWZpaB7vehTTtJ4GXUqq/thumbnail
{
  "thumbnail_asset_id": "not_found_id"
}
404
{
  "error": "Could not find asset with id not_found_id"
}
// Thumbnail asset is from different project
PUT /api/v2/projects/sMVQGNmfFOn2FaY8oYPX/thumbnail
{
  "thumbnail_asset_id": "P5Or5RQ0sFUM4sU5_1We"
}
400
{
  "error": "Thumbnail asset must belong to the given project"
}
// Thumbnail asset is not an image
PUT /api/v2/projects/ISK6TjDB2vH5g3KqV5FO/thumbnail
{
  "thumbnail_asset_id": "NGsgoPx957rd_Oh6sfwk"
}
400
{
  "error": "Thumbnail asset must be an image"
}
// Successful request
PUT /api/v2/projects/6yIMrix7CITjJO2NO0Od/thumbnail
{
  "thumbnail_asset_id": "Y3trW1WxOWTB-QmYOuP7"
}
200
{
  "message": "Succesfully added asset Y3trW1WxOWTB-QmYOuP7 as projects thumbnail image"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

DELETE /api/v2/projects/:project_id/thumbnail
Delete project thumbnail

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID of project to remove thumbnail from

Validations:

  • Must be a String

Examples

// Invalid project_id
DELETE /api/v2/projects/not-found-id/thumbnail
404
{
  "error": "project not found"
}
// Successful request
DELETE /api/v2/projects/EPQGlncJtD5y3f_8xY6R/thumbnail
200
{
  "message": "Succesfully removed thumbnail from project"
}
// When thumbnail_asset_id is already nil
DELETE /api/v2/projects/VyYnC0ST67tJ8KG1ZKOZ/thumbnail
400
{
  "error": "Project has no thumbnail asset"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/assets
Creates a new asset to project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

title
required

Title

Validations:

  • Must be a String

description
optional

Description

Validations:

  • Must be a String

category
optional

Category

Validations:

  • Must be a String

tags
optional

Tags

Validations:

  • Must be an array of String

external_id
optional

External ID

Validations:

  • Must be a String

media_type
optional

Type. During asset creation, only used for articles. Defaults to placeholder with no media.

Validations:

  • Must be one of: article.

url
optional

Media from URL

Validations:

  • Must be a Hash

url[file_url]
required

File URL

Validations:

  • Must be a String

url[filename]
required

Filename

Validations:

  • Must be a String

s3
optional

Media from S3

Validations:

  • Must be a Hash

s3[s3_key]
required

File URL

Validations:

  • Must be a String

s3[filename]
required

Filename

Validations:

  • Must be a String

Examples

// Failed request
POST /api/v2/projects/not-found-id/assets
404
{
  "error": "project not found"
}
// Failed request, missing required "title" parameter
POST /api/v2/projects/H1yGW5qBVmFoUpqSnjUK/assets
{
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ]
}
422
{
  "error": "Missing parameter title"
}
// Failed request, invalid media type
POST /api/v2/projects/7_o6HR9IZIjepR96ifA6/assets
{
  "title": "Sample Asset",
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ],
  "media_type": "image"
}
422
{
  "error": "Invalid parameter 'media_type' value \"image\": Must be one of: <code>article</code>."
}
// Successful request
POST /api/v2/projects/BSP7fGJwRjJxoWsLAxCp/assets
{
  "title": "Sample Asset",
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ]
}
200
{
  "asset": {
    "id": "jDYSvoZZwdV3-MEyXhUX",
    "external_id": null,
    "parent_id": null,
    "project_id": "BSP7fGJwRjJxoWsLAxCp",
    "owner": "admin-user-170@example.com",
    "title": "Sample Asset",
    "description": "Sample asset from API V2",
    "category": "sample",
    "tags": [
      "sample",
      "test"
    ],
    "ai_tags": [],
    "status": "open",
    "media_type": "placeholder",
    "original_filename": null,
    "drop_folder_id": null,
    "md5_sum": null,
    "created_date": "2023-09-22T05:57:46.842Z",
    "modification_date": "2023-09-22T05:57:46.903Z",
    "deleted": null
  }
}
// Successful request, valid media type
POST /api/v2/projects/oZNIqFK3Elv8cYcis1eS/assets
{
  "title": "Sample Asset",
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ],
  "media_type": "article"
}
200
{
  "asset": {
    "id": "OPUzhVYVrccYlG1Dy0we",
    "external_id": null,
    "parent_id": null,
    "project_id": "oZNIqFK3Elv8cYcis1eS",
    "owner": "admin-user-171@example.com",
    "title": "Sample Asset",
    "description": "Sample asset from API V2",
    "category": "sample",
    "tags": [
      "sample",
      "test"
    ],
    "ai_tags": [],
    "status": "open",
    "media_type": "article",
    "original_filename": null,
    "drop_folder_id": null,
    "md5_sum": null,
    "created_date": "2023-09-22T05:57:47.261Z",
    "modification_date": "2023-09-22T05:57:47.438Z",
    "deleted": null
  }
}
// HTTP file url
POST /api/v2/projects/1Gs86rY1bh7zBONsHMrH/assets
{
  "title": "Sample Asset",
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ],
  "url": {
    "file_url": "http://www.example.com/jpgfile.jpg",
    "filename": "jpgfile.jpg"
  }
}
200
{
  "asset": {
    "id": "eLm3sIRn0LtT_Uli6mcU",
    "external_id": null,
    "parent_id": null,
    "project_id": "1Gs86rY1bh7zBONsHMrH",
    "owner": "admin-user-172@example.com",
    "title": "Sample Asset",
    "description": "Sample asset from API V2",
    "category": "sample",
    "tags": [
      "sample",
      "test"
    ],
    "ai_tags": [],
    "status": "open",
    "media_type": "processing",
    "original_filename": "jpgfile.jpg",
    "drop_folder_id": null,
    "md5_sum": null,
    "created_date": "2023-09-22T05:57:47.775Z",
    "modification_date": "2023-09-22T05:57:47.926Z",
    "deleted": null
  }
}
// HTTPS file url
POST /api/v2/projects/u7MdGdIEewMclOp-vmmL/assets
{
  "title": "Sample Asset",
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ],
  "url": {
    "file_url": "https://www.example.com/jpgfile.jpg",
    "filename": "jpgfile.jpg"
  }
}
200
{
  "asset": {
    "id": "TZopLcwQ5B4sMn0aZdFR",
    "external_id": null,
    "parent_id": null,
    "project_id": "u7MdGdIEewMclOp-vmmL",
    "owner": "admin-user-173@example.com",
    "title": "Sample Asset",
    "description": "Sample asset from API V2",
    "category": "sample",
    "tags": [
      "sample",
      "test"
    ],
    "ai_tags": [],
    "status": "open",
    "media_type": "processing",
    "original_filename": "jpgfile.jpg",
    "drop_folder_id": null,
    "md5_sum": null,
    "created_date": "2023-09-22T05:57:48.258Z",
    "modification_date": "2023-09-22T05:57:48.400Z",
    "deleted": null
  }
}
// Invalid file url
POST /api/v2/projects/WS_lQnm2GIGIpd4mvX9s/assets
{
  "title": "Sample Asset",
  "description": "Sample asset from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ],
  "url": {
    "file_url": "/local/downloads/myfile.jpg",
    "filename": "jpgfile.jpg"
  }
}
200
{
  "error": "Asset kX8dWQXv3pCzwCokTgG6 created, adding media to asset failed: not a valid HTTP URL"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters

POST /api/v2/projects/:project_id/projects
Creates a new subproject to project

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

title
required

Title

Validations:

  • Must be a String

description
optional

Description

Validations:

  • Must be a String

category
optional

Category

Validations:

  • Must be a String

tags
optional

Tags

Validations:

  • Must be an array of String

external_id
optional

External ID

Validations:

  • Must be a String

Examples

// Failed request
POST /api/v2/projects/not-found-id/projects
404
{
  "error": "project not found"
}
// Failed request, missing required "title" parameter
POST /api/v2/projects/ubDfGSlWuNz8-RGBk_FY/projects
{
  "description": "Sample project from API V2",
  "category": "Sample"
}
422
{
  "error": "Missing parameter title"
}
// Successful request
POST /api/v2/projects/RaSs_G40oBuXcfZWJ83s/projects
{
  "title": "Sample Project",
  "description": "Sample project from API V2",
  "category": "Sample"
}
200
{
  "project": {
    "id": "QQnOb34oVFCH_vyRwqmG",
    "external_id": null,
    "project_id": "RaSs_G40oBuXcfZWJ83s",
    "owner": "admin-user-177@example.com",
    "title": "Sample Project",
    "description": "Sample project from API V2",
    "category": "sample",
    "tags": [],
    "media_type": "project",
    "isPublic": false,
    "thumbnail_asset_id": null,
    "created_date": "2023-09-22T05:57:49.397Z",
    "modification_date": "2023-09-22T05:57:49.489Z",
    "deleted": null,
    "original_title": "Sample Project"
  }
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters