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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

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

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

GET /api/v2/projects/Jo2wT3wBW4fR4Me2n30n
200
{
  "project": {
    "id": "Jo2wT3wBW4fR4Me2n30n",
    "external_id": null,
    "project_id": null,
    "owner": "support@mediapocket.io",
    "description": "Sample project description.",
    "title": "Sample Project",
    "category": "",
    "tags": [
      "Test",
      "Tag"
    ],
    "media_type": "project",
    "modification_date": "2021-10-05T09:02:28Z",
    "created_date": "2021-10-05T09:02:27Z",
    "status": "open",
    "deleted": false
  }
}
GET /api/v2/projects/not-found-id
404
{
  "error": "project not found"
}
GET /api/v2/projects/Q42xT3wBW4fR4Me2Nn3A
404
{
  "error": "project not found"
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

GET /api/v2/projects/MI2wT3wBW4fR4Me20n1-/members
200
{
  "members": [
    {
      "id": 307,
      "email": "support@mediapocket.io",
      "role": "Admin"
    }
  ]
}
GET /api/v2/projects/not-found-id/members
404
{
  "error": "project not found"
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Headers

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

POST /api/v2/projects/:project_id/members
Add user to project

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

POST /api/v2/projects/not-found-id/members
404
{
  "error": "project not found"
}
POST /api/v2/projects/M42wT3wBW4fR4Me24H3F/members
{
  "user_id": 0
}
200
{
  "error": "User not found with id 0"
}
POST /api/v2/projects/NI2wT3wBW4fR4Me25X0L/members
{
  "user_id": 311
}
200
{
  "error": "User is already member of this project"
}
POST /api/v2/projects/NY2wT3wBW4fR4Me26X0k/members
{
  "user_id": 313
}
200
{
  "ok": "User 313 has been added to project NY2wT3wBW4fR4Me26X0k"
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

user_id
required

User ID

Validations:

  • Must be a Integer

Headers

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

DELETE /api/v2/projects/:project_id/members
Remove user from project

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

DELETE /api/v2/projects/not-found-id/members
404
{
  "error": "project not found"
}
DELETE /api/v2/projects/N42wT3wBW4fR4Me28X1Y/members
{
  "user_id": 316
}
200
{
  "error": "User is not a member of this project"
}
DELETE /api/v2/projects/OI2wT3wBW4fR4Me29X2L/members
{
  "user_id": 317
}
200
{
  "error": "Project must have at least one member"
}
DELETE /api/v2/projects/OY2wT3wBW4fR4Me2-X2N/members
{
  "user_id": 318
}
200
{
  "ok": "User 318 has been removed from project OY2wT3wBW4fR4Me2-X2N"
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

user_id
required

User ID

Validations:

  • Must be a Integer

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

GET /api/v2/projects/KI2wT3wBW4fR4Me2p31Q/assets
200
{
  "assets": [],
  "subprojects": []
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Headers

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

POST /api/v2/projects
Create project

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

POST /api/v2/projects
{
  "title": "Sample Project",
  "description": "Sample project from API V2",
  "category": "Sample",
  "tags": [
    "sample",
    "test"
  ]
}
200
{
  "project": {
    "id": "Ko2wT3wBW4fR4Me2r30C",
    "external_id": null,
    "project_id": null,
    "owner": "support@mediapocket.io",
    "description": "Sample project from API V2",
    "title": "Sample Project",
    "category": "Sample",
    "tags": [
      "sample",
      "test"
    ],
    "media_type": "project",
    "modification_date": "2021-10-05T09:02:32Z",
    "created_date": "2021-10-05T09:02:31Z",
    "status": "open",
    "deleted": false
  }
}

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

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

PUT /api/v2/projects/K42wT3wBW4fR4Me2tH2q
{
  "title": "Modified Sample Project",
  "description": "Modified Description",
  "category": "Modified Category",
  "tags": [
    "Test",
    "Tags",
    "Here"
  ],
  "external_id": "modified_external_id"
}
200
{
  "project": {
    "id": "K42wT3wBW4fR4Me2tH2q",
    "external_id": "modified_external_id",
    "project_id": null,
    "owner": "support@mediapocket.io",
    "description": "Modified Description",
    "title": "Modified Sample Project",
    "category": "Modified Category",
    "tags": [
      "Test",
      "Tags",
      "Here"
    ],
    "media_type": "project",
    "modification_date": "2021-10-05T09:02:35Z",
    "created_date": "2021-10-05T09:02:33Z",
    "status": "open",
    "deleted": false
  },
  "errors": {}
}

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

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

POST /api/v2/projects/LI2wT3wBW4fR4Me2vX3A/trash_bin
200
{
  "ok": "ok"
}
POST /api/v2/projects/not-found-id/trash_bin
404
{
  "error": "project not found"
}

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

POST /api/v2/projects/Lo2wT3wBW4fR4Me2yn1L/restore
200
{
  "ok": "ok"
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

DELETE /api/v2/projects/Qo2xT3wBW4fR4Me2LH3K
200
{
  "ok": "ok"
}
DELETE /api/v2/projects/Q42xT3wBW4fR4Me2Nn3A
200
{
  "ok": "ok"
}

Params

Param name Description
project_id
required

Project ID

Validations:

  • Must be a String

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

POST /api/v2/projects/not-found-id/assign
404
{
  "error": "project not found"
}
POST /api/v2/projects/O42xT3wBW4fR4Me2An0I/assign
{
  "to_project_id": "not-found-id"
}
200
{
  "error": "project with id: not-found-id not found"
}
POST /api/v2/projects/PI2xT3wBW4fR4Me2Bn35/assign
{
  "to_project_id": "PY2xT3wBW4fR4Me2C32F"
}
200
{
  "ok": "ok"
}

Params

Param name Description
to_project_id
required

Project ID

Validations:

  • Must be a String

Headers

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

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

Errors

Code Description
401 Unauthorized
500 Internal Server Error
422 Missing parameters

Examples

DELETE /api/v2/projects/not-found-id/unassign
404
{
  "error": "project not found"
}
DELETE /api/v2/projects/P42xT3wBW4fR4Me2GH1J/unassign
200
{
  "error": "project doesn't belong to any project"
}
DELETE /api/v2/projects/QI2xT3wBW4fR4Me2HH3l/unassign
200
{
  "ok": "ok"
}

Headers

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